* [PATCH 1/1] mfd: add codec resource into 88pm860x driver
@ 2010-08-23 10:24 Haojian Zhuang
2010-08-24 12:45 ` Mark Brown
2010-09-10 15:44 ` Samuel Ortiz
0 siblings, 2 replies; 3+ messages in thread
From: Haojian Zhuang @ 2010-08-23 10:24 UTC (permalink / raw)
To: Samuel Ortiz, Samuel Ortiz, Mark Brown, alsa-devel
[-- Attachment #1: Type: text/plain, Size: 2115 bytes --]
>From 28ed4af3929120b9b3853ffcb8055eb6a81d31d8 Mon Sep 17 00:00:00 2001
From: Haojian Zhuang <haojian.zhuang@marvell.com>
Date: Thu, 12 Aug 2010 11:59:33 +0800
Subject: [PATCH 1/1] 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>
---
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 07933f3..4db10a1 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),
@@ -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);
--
1.5.6.5
[-- Attachment #2: 0001-mfd-add-codec-resource-into-88pm860x-driver.patch --]
[-- Type: text/x-patch, Size: 2117 bytes --]
From 28ed4af3929120b9b3853ffcb8055eb6a81d31d8 Mon Sep 17 00:00:00 2001
From: Haojian Zhuang <haojian.zhuang@marvell.com>
Date: Thu, 12 Aug 2010 11:59:33 +0800
Subject: [PATCH 1/1] 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>
---
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 07933f3..4db10a1 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),
@@ -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);
--
1.5.6.5
[-- Attachment #3: Type: text/plain, Size: 160 bytes --]
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] mfd: add codec resource into 88pm860x driver
2010-08-23 10:24 [PATCH 1/1] mfd: add codec resource into 88pm860x driver Haojian Zhuang
@ 2010-08-24 12:45 ` Mark Brown
2010-09-10 15:44 ` Samuel Ortiz
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2010-08-24 12:45 UTC (permalink / raw)
To: Haojian Zhuang; +Cc: Samuel Ortiz, Samuel Ortiz, alsa-devel
On Mon, Aug 23, 2010 at 06:24:50PM +0800, Haojian Zhuang wrote:
> From 28ed4af3929120b9b3853ffcb8055eb6a81d31d8 Mon Sep 17 00:00:00 2001
> From: Haojian Zhuang <haojian.zhuang@marvell.com>
> Date: Thu, 12 Aug 2010 11:59:33 +0800
> Subject: [PATCH 1/1] 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>
I think the MFD tree makes most sense for this - the codec driver will
build fine without it.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] mfd: add codec resource into 88pm860x driver
2010-08-23 10:24 [PATCH 1/1] mfd: add codec resource into 88pm860x driver Haojian Zhuang
2010-08-24 12:45 ` Mark Brown
@ 2010-09-10 15:44 ` Samuel Ortiz
1 sibling, 0 replies; 3+ messages in thread
From: Samuel Ortiz @ 2010-09-10 15:44 UTC (permalink / raw)
To: Haojian Zhuang; +Cc: Samuel Ortiz, Mark Brown, alsa-devel
Hi Haojian,
On Mon, Aug 23, 2010 at 06:24:50PM +0800, Haojian Zhuang wrote:
> From 28ed4af3929120b9b3853ffcb8055eb6a81d31d8 Mon Sep 17 00:00:00 2001
> From: Haojian Zhuang <haojian.zhuang@marvell.com>
> Date: Thu, 12 Aug 2010 11:59:33 +0800
> Subject: [PATCH 1/1] mfd: add codec resource into 88pm860x driver
>
> Add codec IRQ resources that are used in 88pm860x codec driver.
Many thanks, patch applied.
Cheers,
Samuel.
--
Intel Open Source Technology Centre
http://oss.intel.com/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-09-10 15:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-23 10:24 [PATCH 1/1] mfd: add codec resource into 88pm860x driver Haojian Zhuang
2010-08-24 12:45 ` Mark Brown
2010-09-10 15:44 ` Samuel Ortiz
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.