diff options
author | Haojian Zhuang <haojian.zhuang@marvell.com> | 2010-08-11 23:59:33 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2010-10-28 18:28:54 -0400 |
commit | 2c36af7b57540ea52d74dbbe71bf860aca910bb9 (patch) | |
tree | e6a667b8735fb0dbe87aaa2a7afd5c305e7e4cda /drivers/mfd | |
parent | 4b751cf5de975a91246110f3da1299f9e466646d (diff) |
mfd: Add codec resource into 88pm860x driver
Add codec IRQ resources that are used in 88pm860x codec driver.
Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/88pm860x-core.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/drivers/mfd/88pm860x-core.c b/drivers/mfd/88pm860x-core.c index 07933f3f7e4c..4db10a150369 100644 --- a/drivers/mfd/88pm860x-core.c +++ b/drivers/mfd/88pm860x-core.c | |||
@@ -158,6 +158,43 @@ static struct mfd_cell onkey_devs[] = { | |||
158 | }, | 158 | }, |
159 | }; | 159 | }; |
160 | 160 | ||
161 | static struct resource codec_resources[] = { | ||
162 | { | ||
163 | /* Headset microphone insertion or removal */ | ||
164 | .name = "micin", | ||
165 | .start = PM8607_IRQ_MICIN, | ||
166 | .end = PM8607_IRQ_MICIN, | ||
167 | .flags = IORESOURCE_IRQ, | ||
168 | }, { | ||
169 | /* Hook-switch press or release */ | ||
170 | .name = "hook", | ||
171 | .start = PM8607_IRQ_HOOK, | ||
172 | .end = PM8607_IRQ_HOOK, | ||
173 | .flags = IORESOURCE_IRQ, | ||
174 | }, { | ||
175 | /* Headset insertion or removal */ | ||
176 | .name = "headset", | ||
177 | .start = PM8607_IRQ_HEADSET, | ||
178 | .end = PM8607_IRQ_HEADSET, | ||
179 | .flags = IORESOURCE_IRQ, | ||
180 | }, { | ||
181 | /* Audio short */ | ||
182 | .name = "audio-short", | ||
183 | .start = PM8607_IRQ_AUDIO_SHORT, | ||
184 | .end = PM8607_IRQ_AUDIO_SHORT, | ||
185 | .flags = IORESOURCE_IRQ, | ||
186 | }, | ||
187 | }; | ||
188 | |||
189 | static struct mfd_cell codec_devs[] = { | ||
190 | { | ||
191 | .name = "88pm860x-codec", | ||
192 | .num_resources = ARRAY_SIZE(codec_resources), | ||
193 | .resources = &codec_resources[0], | ||
194 | .id = -1, | ||
195 | }, | ||
196 | }; | ||
197 | |||
161 | static struct resource regulator_resources[] = { | 198 | static struct resource regulator_resources[] = { |
162 | PM8607_REG_RESOURCE(BUCK1, BUCK1), | 199 | PM8607_REG_RESOURCE(BUCK1, BUCK1), |
163 | PM8607_REG_RESOURCE(BUCK2, BUCK2), | 200 | PM8607_REG_RESOURCE(BUCK2, BUCK2), |
@@ -687,6 +724,13 @@ static void __devinit device_8607_init(struct pm860x_chip *chip, | |||
687 | goto out_dev; | 724 | goto out_dev; |
688 | } | 725 | } |
689 | 726 | ||
727 | ret = mfd_add_devices(chip->dev, 0, &codec_devs[0], | ||
728 | ARRAY_SIZE(codec_devs), | ||
729 | &codec_resources[0], 0); | ||
730 | if (ret < 0) { | ||
731 | dev_err(chip->dev, "Failed to add codec subdev\n"); | ||
732 | goto out_dev; | ||
733 | } | ||
690 | return; | 734 | return; |
691 | out_dev: | 735 | out_dev: |
692 | mfd_remove_devices(chip->dev); | 736 | mfd_remove_devices(chip->dev); |