diff options
-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 07933f3f7e4..4db10a15036 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); |