diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-11-15 06:33:11 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-11-15 06:33:11 +0000 |
commit | 1bb95834bbcdc969e477a9284cf96c17a4c2616f (patch) | |
tree | 9cf66b22a611bb6bc78778c05dac72263bb45a23 /drivers/mfd/88pm860x-core.c | |
parent | 85345517fe6d4de27b0d6ca19fef9d28ac947c4a (diff) | |
parent | a41c73e04673b47730df682446f0d52f95e32a5b (diff) |
Merge remote branch 'airlied/drm-fixes' into drm-intel-fixes
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 07933f3f7e4..20895e7a99c 100644 --- a/drivers/mfd/88pm860x-core.c +++ b/drivers/mfd/88pm860x-core.c @@ -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), @@ -608,10 +645,13 @@ static void __devinit device_8607_init(struct pm860x_chip *chip, dev_err(chip->dev, "Failed to read CHIP ID: %d\n", ret); goto out; } - if ((ret & PM8607_VERSION_MASK) == PM8607_VERSION) + switch (ret & PM8607_VERSION_MASK) { + case 0x40: + case 0x50: dev_info(chip->dev, "Marvell 88PM8607 (ID: %02x) detected\n", ret); - else { + break; + default: dev_err(chip->dev, "Failed to detect Marvell 88PM8607. " "Chip ID: %02x\n", ret); goto out; @@ -687,6 +727,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); |