diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-28 18:54:04 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-28 18:54:04 -0400 |
commit | b779b332d0e1ef68f40867948ae5526a3e925163 (patch) | |
tree | d2fc8bb455d696fbdb288055ce0a4f0cfcee31fd /drivers/mfd/88pm860x-core.c | |
parent | a0cadc2777a71b1fde62e6417284b38e52128e88 (diff) | |
parent | 0f48285755991b73c14b6eeeee464590f490ac25 (diff) |
Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6
* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6: (73 commits)
power: Revert "power_supply: Mark twl4030_charger as broken"
mfd: Fix a memory leak when unload mc13xxx-core module
mfd: Fix resource reclaim for max8998
mfd: Remove unneeded ret value checking for max8998 register updates
mfd: Add free max8998->ono irq in max8998_irq_exit()
mfd: Fix resource reclaim in pcf50633_remove()
omap4: pandaboard: fix up mmc card detect logic
mfd: Fix ezx_pcap_probe error path
mfd: Fix off-by-one value range checking for tps6507x
mfd: Remove __devinitdata from tc6393xb_mmc_resources
mfd: Add WM831x SPI support
mfd: Factor out WM831x I2C I/O from the core driver
mfd: Remove DEBUG defines from mc13xxx-core
mfd: Fix jz4740_adc_set_enabled
mfd: Add TPS658621C device ID
mfd: Fix twl-irq function declaration warnings
regulator: max8998 BUCK1/2 voltage change with use of GPIOs
mfd: Voltages and GPIOs platform_data definitions for max8998
regulator: max8998 BUCK1/2 internal voltages and indexes defined
mfd: Support for ICs compliant with max8998
...
Diffstat (limited to 'drivers/mfd/88pm860x-core.c')
-rw-r--r-- | drivers/mfd/88pm860x-core.c | 51 |
1 files changed, 49 insertions, 2 deletions
diff --git a/drivers/mfd/88pm860x-core.c b/drivers/mfd/88pm860x-core.c index 07933f3f7e4c..20895e7a99c9 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), |
@@ -608,10 +645,13 @@ static void __devinit device_8607_init(struct pm860x_chip *chip, | |||
608 | dev_err(chip->dev, "Failed to read CHIP ID: %d\n", ret); | 645 | dev_err(chip->dev, "Failed to read CHIP ID: %d\n", ret); |
609 | goto out; | 646 | goto out; |
610 | } | 647 | } |
611 | if ((ret & PM8607_VERSION_MASK) == PM8607_VERSION) | 648 | switch (ret & PM8607_VERSION_MASK) { |
649 | case 0x40: | ||
650 | case 0x50: | ||
612 | dev_info(chip->dev, "Marvell 88PM8607 (ID: %02x) detected\n", | 651 | dev_info(chip->dev, "Marvell 88PM8607 (ID: %02x) detected\n", |
613 | ret); | 652 | ret); |
614 | else { | 653 | break; |
654 | default: | ||
615 | dev_err(chip->dev, "Failed to detect Marvell 88PM8607. " | 655 | dev_err(chip->dev, "Failed to detect Marvell 88PM8607. " |
616 | "Chip ID: %02x\n", ret); | 656 | "Chip ID: %02x\n", ret); |
617 | goto out; | 657 | goto out; |
@@ -687,6 +727,13 @@ static void __devinit device_8607_init(struct pm860x_chip *chip, | |||
687 | goto out_dev; | 727 | goto out_dev; |
688 | } | 728 | } |
689 | 729 | ||
730 | ret = mfd_add_devices(chip->dev, 0, &codec_devs[0], | ||
731 | ARRAY_SIZE(codec_devs), | ||
732 | &codec_resources[0], 0); | ||
733 | if (ret < 0) { | ||
734 | dev_err(chip->dev, "Failed to add codec subdev\n"); | ||
735 | goto out_dev; | ||
736 | } | ||
690 | return; | 737 | return; |
691 | out_dev: | 738 | out_dev: |
692 | mfd_remove_devices(chip->dev); | 739 | mfd_remove_devices(chip->dev); |