13 #include <linux/module.h>
14 #include <linux/slab.h>
20 #include "../soundbus/soundbus.h"
23 #define PFX "snd-aoa-codec-toonie: "
28 #define codec_to_toonie(c) container_of(c, struct toonie, codec)
36 .dev_register = toonie_dev_register,
76 .transfers = toonie_transfers,
77 .sysclock_factor = 256,
80 .usable = toonie_usable,
82 .suspend = toonie_suspend,
83 .resume = toonie_resume,
92 if (toonie->
codec.connected != 1)
100 if (toonie->
codec.soundbus_dev->attach_codec(toonie->
codec.soundbus_dev,
102 &toonie_codec_info, toonie)) {
111 static void toonie_exit_codec(
struct aoa_codec *codec)
115 if (!toonie->
codec.soundbus_dev) {
119 toonie->
codec.soundbus_dev->detach_codec(toonie->
codec.soundbus_dev, toonie);
122 static struct toonie *toonie;
124 static int __init toonie_init(
void)
126 toonie = kzalloc(
sizeof(
struct toonie),
GFP_KERNEL);
133 toonie->
codec.init = toonie_init_codec;
134 toonie->
codec.exit = toonie_exit_codec;
144 static void __exit toonie_exit(
void)