* [PATCH 1/5] mfd: add codec resource into 88pm860x driver
@ 2010-08-13 13:55 Haojian Zhuang
2010-08-13 13:58 ` Mark Brown
0 siblings, 1 reply; 6+ messages in thread
From: Haojian Zhuang @ 2010-08-13 13:55 UTC (permalink / raw)
To: linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/5] mfd: add codec resource into 88pm860x driver
2010-08-13 13:55 [PATCH 1/5] mfd: add codec resource into 88pm860x driver Haojian Zhuang
@ 2010-08-13 13:58 ` Mark Brown
2010-08-20 21:42 ` Samuel Ortiz
0 siblings, 1 reply; 6+ messages in thread
From: Mark Brown @ 2010-08-13 13:58 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Aug 13, 2010 at 09:55:19PM +0800, Haojian Zhuang wrote:
> From 7f48ab298f0017ff8b86dbc11f8de21505965ce7 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/5] mfd: add codec resource into 88pm860x driver
>
> Add codec IRQ resources that are used in 88pm860x codec driver.
CCing in Samuel since this ought to have his ack. It may as well be
merged via the MFD tree since there's no build time dependency, I guess.
I do have one comment...
> 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 1580f1f..fba00b4 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 = 4,
It'd be better to use ARRAY_SIZE() here.
> + .resources = &codec_resources[0],
> + .id = -1,
> + },
> +};
> +
> static struct resource regulator_resources[] = {
> PM8607_REG_RESOURCE(BUCK1, BUCK1),
> PM8607_REG_RESOURCE(BUCK2, BUCK2),
> @@ -695,6 +732,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
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/5] mfd: add codec resource into 88pm860x driver
2010-08-13 13:58 ` Mark Brown
@ 2010-08-20 21:42 ` Samuel Ortiz
2010-08-23 10:22 ` Haojian Zhuang
0 siblings, 1 reply; 6+ messages in thread
From: Samuel Ortiz @ 2010-08-20 21:42 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Aug 13, 2010 at 02:58:58PM +0100, Mark Brown wrote:
> On Fri, Aug 13, 2010 at 09:55:19PM +0800, Haojian Zhuang wrote:
> > From 7f48ab298f0017ff8b86dbc11f8de21505965ce7 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/5] mfd: add codec resource into 88pm860x driver
> >
> > Add codec IRQ resources that are used in 88pm860x codec driver.
>
> CCing in Samuel since this ought to have his ack.
The patch looks good. I'll ack it once Mark's comment gets integrated.
As for how it should hit upstream, I'm fine taking it unless Haojian prefers
to see the whole patchset going through Liam's tree.
Cheers,
Samuel.
> It may as well be
> merged via the MFD tree since there's no build time dependency, I guess.
> I do have one comment...
>
> > 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 1580f1f..fba00b4 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 = 4,
>
> It'd be better to use ARRAY_SIZE() here.
>
> > + .resources = &codec_resources[0],
> > + .id = -1,
> > + },
> > +};
> > +
> > static struct resource regulator_resources[] = {
> > PM8607_REG_RESOURCE(BUCK1, BUCK1),
> > PM8607_REG_RESOURCE(BUCK2, BUCK2),
> > @@ -695,6 +732,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
--
Intel Open Source Technology Centre
http://oss.intel.com/
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/5] mfd: add codec resource into 88pm860x driver
2010-08-20 21:42 ` Samuel Ortiz
@ 2010-08-23 10:22 ` Haojian Zhuang
0 siblings, 0 replies; 6+ messages in thread
From: Haojian Zhuang @ 2010-08-23 10:22 UTC (permalink / raw)
To: linux-arm-kernel
On Sat, Aug 21, 2010 at 5:42 AM, Samuel Ortiz <sameo@linux.intel.com> wrote:
> On Fri, Aug 13, 2010 at 02:58:58PM +0100, Mark Brown wrote:
>> On Fri, Aug 13, 2010 at 09:55:19PM +0800, Haojian Zhuang wrote:
>> > From 7f48ab298f0017ff8b86dbc11f8de21505965ce7 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/5] mfd: add codec resource into 88pm860x driver
>> >
>> > Add codec IRQ resources that are used in 88pm860x codec driver.
>>
>> CCing in Samuel since this ought to have his ack.
> The patch looks good. I'll ack it once Mark's comment gets integrated.
> As for how it should hit upstream, I'm fine taking it unless Haojian prefers
> to see the whole patchset going through Liam's tree.
>
> Cheers,
> Samuel.
>
>> It may as well be
>> merged via the MFD tree since there's no build time dependency, I guess.
>> I do have one comment...
>>
Actually I'm OK whether this patch is merged into mfd tree or ASoC tree.
And I refreshed this patch by changing hardcoding to ARRAY_SIZE().
I'll paste it in another mail thread. Please help to review it again.
Thanks
Haojian
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/5] mfd: add codec resource into 88pm860x driver
@ 2010-09-08 13:44 Haojian Zhuang
0 siblings, 0 replies; 6+ messages in thread
From: Haojian Zhuang @ 2010-09-08 13:44 UTC (permalink / raw)
To: linux-arm-kernel
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>
Cc: Samuel Ortiz <sameo@openedhand.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
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 1/5] mfd: add codec resource into 88pm860x driver
@ 2010-08-12 3:59 Haojian Zhuang
0 siblings, 0 replies; 6+ messages in thread
From: Haojian Zhuang @ 2010-08-12 3:59 UTC (permalink / raw)
To: linux-arm-kernel
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 1580f1f..fba00b4 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 = 4,
+ .resources = &codec_resources[0],
+ .id = -1,
+ },
+};
+
static struct resource regulator_resources[] = {
PM8607_REG_RESOURCE(BUCK1, BUCK1),
PM8607_REG_RESOURCE(BUCK2, BUCK2),
@@ -695,6 +732,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
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-09-08 13:44 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-13 13:55 [PATCH 1/5] mfd: add codec resource into 88pm860x driver Haojian Zhuang
2010-08-13 13:58 ` Mark Brown
2010-08-20 21:42 ` Samuel Ortiz
2010-08-23 10:22 ` Haojian Zhuang
-- strict thread matches above, loose matches on Subject: below --
2010-09-08 13:44 Haojian Zhuang
2010-08-12 3:59 Haojian Zhuang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).