Lines Matching +full:off +full:- +full:codec

1 // SPDX-License-Identifier: GPL-2.0-only
3 * Apple Onboard Audio driver for Toonie codec
7 * This is a driver for the toonie codec chip. This chip is present
15 MODULE_DESCRIPTION("toonie codec driver for snd-aoa");
21 #define PFX "snd-aoa-codec-toonie: "
24 struct aoa_codec codec; member
26 #define codec_to_toonie(c) container_of(c, struct toonie, codec)
63 /* can we turn it off somehow? */ in toonie_suspend()
85 static int toonie_init_codec(struct aoa_codec *codec) in toonie_init_codec() argument
87 struct toonie *toonie = codec_to_toonie(codec); in toonie_init_codec()
90 if (toonie->codec.connected != 1) in toonie_init_codec()
91 return -ENOTCONN; in toonie_init_codec()
95 return -ENODEV; in toonie_init_codec()
98 if (toonie->codec.soundbus_dev->attach_codec(toonie->codec.soundbus_dev, in toonie_init_codec()
103 return -ENODEV; in toonie_init_codec()
109 static void toonie_exit_codec(struct aoa_codec *codec) in toonie_exit_codec() argument
111 struct toonie *toonie = codec_to_toonie(codec); in toonie_exit_codec()
113 if (!toonie->codec.soundbus_dev) { in toonie_exit_codec()
117 toonie->codec.soundbus_dev->detach_codec(toonie->codec.soundbus_dev, toonie); in toonie_exit_codec()
127 return -ENOMEM; in toonie_init()
129 strscpy(toonie->codec.name, "toonie", sizeof(toonie->codec.name)); in toonie_init()
130 toonie->codec.owner = THIS_MODULE; in toonie_init()
131 toonie->codec.init = toonie_init_codec; in toonie_init()
132 toonie->codec.exit = toonie_exit_codec; in toonie_init()
134 if (aoa_codec_register(&toonie->codec)) { in toonie_init()
136 return -EINVAL; in toonie_init()
144 aoa_codec_unregister(&toonie->codec); in toonie_exit()