13 #include <linux/module.h>
15 #include <linux/errno.h>
17 #include <linux/device.h>
18 #include <linux/slab.h>
19 #include <linux/string.h>
23 #define to_mcp(d) container_of(d, struct mcp, attached_device)
24 #define to_mcp_driver(d) container_of(d, struct mcp_driver, drv)
31 static int mcp_bus_probe(
struct device *
dev)
36 return drv->
probe(mcp);
39 static int mcp_bus_remove(
struct device *dev)
41 struct mcp *mcp =
to_mcp(dev);
48 static struct bus_type mcp_bus_type = {
50 .match = mcp_bus_match,
51 .probe = mcp_bus_probe,
52 .remove = mcp_bus_remove,
68 mcp->
ops->set_telecom_divisor(mcp, div);
69 spin_unlock_irqrestore(&mcp->
lock, flags);
85 mcp->
ops->set_audio_divisor(mcp, div);
86 spin_unlock_irqrestore(&mcp->
lock, flags);
104 mcp->
ops->reg_write(mcp, reg, val);
105 spin_unlock_irqrestore(&mcp->
lock, flags);
123 val = mcp->
ops->reg_read(mcp, reg);
124 spin_unlock_irqrestore(&mcp->
lock, flags);
142 mcp->
ops->enable(mcp);
143 spin_unlock_irqrestore(&mcp->
lock, flags);
161 mcp->
ops->disable(mcp);
162 spin_unlock_irqrestore(&mcp->
lock, flags);
166 static void mcp_release(
struct device *dev)
177 mcp = kzalloc(
sizeof(
struct mcp) + size,
GFP_KERNEL);
212 mcpdrv->
drv.bus = &mcp_bus_type;
223 static int __init mcp_init(
void)
228 static void __exit mcp_exit(
void)