Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 220581
b: refs/heads/master
c: 2c36af7
h: refs/heads/master
i:
  220579: 428b7ce
v: v3
  • Loading branch information
Haojian Zhuang authored and Samuel Ortiz committed Oct 28, 2010
1 parent 00b4c03 commit 558e98c
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4b751cf5de975a91246110f3da1299f9e466646d
refs/heads/master: 2c36af7b57540ea52d74dbbe71bf860aca910bb9
44 changes: 44 additions & 0 deletions trunk/drivers/mfd/88pm860x-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,43 @@ static struct mfd_cell onkey_devs[] = {
},
};

static struct resource codec_resources[] = {
{
/* Headset microphone insertion or removal */
.name = "micin",
.start = PM8607_IRQ_MICIN,
.end = PM8607_IRQ_MICIN,
.flags = IORESOURCE_IRQ,
}, {
/* Hook-switch press or release */
.name = "hook",
.start = PM8607_IRQ_HOOK,
.end = PM8607_IRQ_HOOK,
.flags = IORESOURCE_IRQ,
}, {
/* Headset insertion or removal */
.name = "headset",
.start = PM8607_IRQ_HEADSET,
.end = PM8607_IRQ_HEADSET,
.flags = IORESOURCE_IRQ,
}, {
/* Audio short */
.name = "audio-short",
.start = PM8607_IRQ_AUDIO_SHORT,
.end = PM8607_IRQ_AUDIO_SHORT,
.flags = IORESOURCE_IRQ,
},
};

static struct mfd_cell codec_devs[] = {
{
.name = "88pm860x-codec",
.num_resources = ARRAY_SIZE(codec_resources),
.resources = &codec_resources[0],
.id = -1,
},
};

static struct resource regulator_resources[] = {
PM8607_REG_RESOURCE(BUCK1, BUCK1),
PM8607_REG_RESOURCE(BUCK2, BUCK2),
Expand Down Expand Up @@ -687,6 +724,13 @@ static void __devinit device_8607_init(struct pm860x_chip *chip,
goto out_dev;
}

ret = mfd_add_devices(chip->dev, 0, &codec_devs[0],
ARRAY_SIZE(codec_devs),
&codec_resources[0], 0);
if (ret < 0) {
dev_err(chip->dev, "Failed to add codec subdev\n");
goto out_dev;
}
return;
out_dev:
mfd_remove_devices(chip->dev);
Expand Down

0 comments on commit 558e98c

Please sign in to comment.