23 #include <linux/kernel.h>
24 #include <linux/module.h>
25 #include <linux/i2c.h>
29 #include <linux/slab.h>
32 #define PM805_CHIP_ID (0x00)
58 static struct resource codec_resources[] = {
68 .name =
"audio-short1",
75 .name =
"audio-short2",
82 static struct mfd_cell codec_devs[] = {
84 .name =
"88pm80x-codec",
86 .resources = &codec_resources[0],
91 static struct regmap_irq pm805_irqs[] = {
144 if (!map || !chip->
irq) {
176 static void device_irq_exit_805(
struct pm80x_chip *chip)
181 static struct regmap_irq_chip pm805_irq_chip = {
205 dev_err(chip->
dev,
"Failed to read CHIP ID: %d\n", ret);
212 ret = device_irq_init_805(chip);
214 dev_err(chip->
dev,
"Failed to init pm805 irq!\n");
219 ARRAY_SIZE(codec_devs), &codec_resources[0], 0,
222 dev_err(chip->
dev,
"Failed to add codec subdev\n");
225 dev_info(chip->
dev,
"[%s]:Added mfd codec_devs\n", __func__);
230 device_irq_exit_805(chip);
248 chip = i2c_get_clientdata(client);
250 ret = device_805_init(chip);
252 dev_err(chip->
dev,
"%s id 0x%x failed!\n", __func__, chip->
id);
267 struct pm80x_chip *chip = i2c_get_clientdata(client);
270 device_irq_exit_805(chip);
283 .probe = pm805_probe,
285 .id_table = pm80x_id_table,
288 static int __init pm805_i2c_init(
void)
290 return i2c_add_driver(&pm805_driver);
294 static void __exit pm805_i2c_exit(
void)