From: Marek Vasut <marek.vasut@gmail.com>
To: avorontsov@ru.mvista.com
Cc: alsa-devel@alsa-project.org,
Russell King - ARM Linux <linux@arm.linux.org.uk>,
Takashi Iwai <tiwai@suse.de>,
Robert Jarzmik <robert.jarzmik@free.fr>,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
cbou@mail.ru, Eric Miao <eric.y.miao@gmail.com>,
dwmw2@infradead.org, linux-arm-kernel@lists.arm.linux.org.uk
Subject: Re: [PATCH] Allow passing platform_data to devices attached to AC97 bus
Date: Wed, 22 Jul 2009 00:43:33 +0200 [thread overview]
Message-ID: <200907220043.34047.marek.vasut@gmail.com> (raw)
In-Reply-To: <20090721223424.GA21147@oksana.dev.rtsoft.ru>
[-- Attachment #1: Type: text/plain, Size: 1759 bytes --]
Dne St 22. července 2009 00:34:24 Anton Vorontsov napsal(a):
> On Wed, Jul 22, 2009 at 12:13:12AM +0200, Marek Vasut wrote:
> > Btw. I also reworked the wm97xx-battery a little more. Also, CCing power-
> > supply people.
> >
> > From 0c04c7f9cac26de8b4e401c17e65051c7f44ec3e Mon Sep 17 00:00:00 2001
> > From: Marek Vasut <marek.vasut@gmail.com>
> > Date: Tue, 21 Jul 2009 18:52:28 +0200
> > Subject: [PATCH 3/4] Convert WM97xx driver to use platform_data
> >
> > This patch converts the wm97xx driver to use platform_data supplied by
> > ac97 bus. Also, this fixes the related wm97xx-battery driver to use
> > it's platform_data and prepares a structure for touchscreen driver.
> >
> > Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
> > ---
>
> Acked-by: Anton Vorontsov <cbouatmailru@gmail.com>
>
> > + ret = set_irq_type(gpio_to_irq(pdata->charge_gpio),
> > + IRQ_TYPE_EDGE_BOTH);
> > + if (ret)
> > + goto err2;
>
> I always thought that request_irq() would set trigger type
> as necessary if you pass IRQF_TRIGGER_* flags, so there is
> no need for explicit set_irq_type() call?
>
> This code in kernel/irq/manage.c:__setup_irq():
>
> /* Setup the type (level, edge polarity) if configured: */
> if (new->flags & IRQF_TRIGGER_MASK) {
> ret = __irq_set_trigger(desc, irq,
> new->flags & IRQF_TRIGGER_MASK);
>
> > + ret = request_irq(gpio_to_irq(pdata->charge_gpio),
> > + wm97xx_chrg_irq, IRQF_DISABLED,
> > + "AC Detect", 0);
> > + if (ret)
> > + goto err3;
Yes, sorry, I fixed this one. Btw. we can safely apply the attached patch then.
This will need Robert's ack though (mioa701 change).
[-- Attachment #2: 0004-Convert-all-platforms-to-pass-platform_data-to-wm97x.patch --]
[-- Type: text/x-patch, Size: 11915 bytes --]
From 0ccf06e47672e0cc1795c18c701b6db79bdc2eea Mon Sep 17 00:00:00 2001
From: Marek Vasut <marek.vasut@gmail.com>
Date: Tue, 21 Jul 2009 19:22:13 +0200
Subject: [PATCH 4/4] Convert all platforms to pass platform_data to wm97xx battery
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
arch/arm/mach-pxa/mioa701.c | 7 ++++++-
arch/arm/mach-pxa/palmld.c | 19 ++++++++++---------
arch/arm/mach-pxa/palmt5.c | 19 ++++++++++---------
arch/arm/mach-pxa/palmte2.c | 20 ++++++++++++--------
arch/arm/mach-pxa/palmtx.c | 19 ++++++++++---------
arch/arm/mach-pxa/palmz72.c | 20 ++++++++++++--------
arch/arm/mach-pxa/treo680.c | 1 -
7 files changed, 60 insertions(+), 45 deletions(-)
diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c
index 3cab452..803917d 100644
--- a/arch/arm/mach-pxa/mioa701.c
+++ b/arch/arm/mach-pxa/mioa701.c
@@ -34,7 +34,7 @@
#include <linux/irq.h>
#include <linux/pda_power.h>
#include <linux/power_supply.h>
-#include <linux/wm97xx_batt.h>
+#include <linux/wm97xx.h>
#include <linux/mtd/physmap.h>
#include <linux/usb/gpio_vbus.h>
#include <linux/regulator/max1586.h>
@@ -660,6 +660,10 @@ static struct wm97xx_batt_info mioa701_battery_data = {
.batt_name = "mioa701_battery",
};
+static struct wm97xx_pdata mioa701_wm97xx_pdata = {
+ .batt_pdata = &mioa701_battery_data,
+};
+
/*
* Voltage regulation
*/
@@ -728,6 +732,7 @@ struct i2c_pxa_platform_data i2c_pdata = {
static pxa2xx_audio_ops_t mioa701_ac97_info = {
.reset_gpio = 95,
+ .codec_pdata = { &mioa701_wm97xx_pdata, },
};
/*
diff --git a/arch/arm/mach-pxa/palmld.c b/arch/arm/mach-pxa/palmld.c
index 1ad029d..bcf5b46 100644
--- a/arch/arm/mach-pxa/palmld.c
+++ b/arch/arm/mach-pxa/palmld.c
@@ -22,7 +22,7 @@
#include <linux/pda_power.h>
#include <linux/pwm_backlight.h>
#include <linux/gpio.h>
-#include <linux/wm97xx_batt.h>
+#include <linux/wm97xx.h>
#include <linux/power_supply.h>
#include <linux/sysdev.h>
#include <linux/mtd/mtd.h>
@@ -406,9 +406,9 @@ static struct platform_device power_supply = {
};
/******************************************************************************
- * WM97xx battery
+ * WM97xx audio, battery
******************************************************************************/
-static struct wm97xx_batt_info wm97xx_batt_pdata = {
+static struct wm97xx_batt_pdata palmld_batt_pdata = {
.batt_aux = WM97XX_AUX_ID3,
.temp_aux = WM97XX_AUX_ID2,
.charge_gpio = -1,
@@ -422,15 +422,17 @@ static struct wm97xx_batt_info wm97xx_batt_pdata = {
.batt_name = "main-batt",
};
-/******************************************************************************
- * aSoC audio
- ******************************************************************************/
-static struct palm27x_asoc_info palmld_asoc_pdata = {
- .jack_gpio = GPIO_NR_PALMLD_EARPHONE_DETECT,
+static struct wm97xx_pdata palmld_wm97xx_pdata = {
+ .batt_pdata = &palmld_batt_pdata,
};
static pxa2xx_audio_ops_t palmld_ac97_pdata = {
.reset_gpio = 95,
+ .codec_pdata = { &palmld_wm97xx_pdata, },
+};
+
+static struct palm27x_asoc_info palmld_asoc_pdata = {
+ .jack_gpio = GPIO_NR_PALMLD_EARPHONE_DETECT,
};
static struct platform_device palmld_asoc = {
@@ -536,7 +538,6 @@ static void __init palmld_init(void)
pxa_set_ac97_info(&palmld_ac97_pdata);
pxa_set_ficp_info(&palmld_ficp_platform_data);
pxa_set_keypad_info(&palmld_keypad_platform_data);
- wm97xx_bat_set_pdata(&wm97xx_batt_pdata);
platform_add_devices(devices, ARRAY_SIZE(devices));
}
diff --git a/arch/arm/mach-pxa/palmt5.c b/arch/arm/mach-pxa/palmt5.c
index 2dd7ce2..3e8b21d 100644
--- a/arch/arm/mach-pxa/palmt5.c
+++ b/arch/arm/mach-pxa/palmt5.c
@@ -24,7 +24,7 @@
#include <linux/pda_power.h>
#include <linux/pwm_backlight.h>
#include <linux/gpio.h>
-#include <linux/wm97xx_batt.h>
+#include <linux/wm97xx.h>
#include <linux/power_supply.h>
#include <linux/usb/gpio_vbus.h>
@@ -317,9 +317,9 @@ static struct platform_device power_supply = {
};
/******************************************************************************
- * WM97xx battery
+ * WM97xx audio, battery
******************************************************************************/
-static struct wm97xx_batt_info wm97xx_batt_pdata = {
+static struct wm97xx_batt_pdata palmt5_batt_pdata = {
.batt_aux = WM97XX_AUX_ID3,
.temp_aux = WM97XX_AUX_ID2,
.charge_gpio = -1,
@@ -333,15 +333,17 @@ static struct wm97xx_batt_info wm97xx_batt_pdata = {
.batt_name = "main-batt",
};
-/******************************************************************************
- * aSoC audio
- ******************************************************************************/
-static struct palm27x_asoc_info palmt5_asoc_pdata = {
- .jack_gpio = GPIO_NR_PALMT5_EARPHONE_DETECT,
+static struct wm97xx_pdata palmt5_wm97xx_pdata = {
+ .batt_pdata = &palmt5_batt_pdata,
};
static pxa2xx_audio_ops_t palmt5_ac97_pdata = {
.reset_gpio = 95,
+ .codec_pdata = { &palmt5_wm97xx_pdata, },
+};
+
+static struct palm27x_asoc_info palmt5_asoc_pdata = {
+ .jack_gpio = GPIO_NR_PALMT5_EARPHONE_DETECT,
};
static struct platform_device palmt5_asoc = {
@@ -426,7 +428,6 @@ static void __init palmt5_init(void)
pxa_set_ac97_info(&palmt5_ac97_pdata);
pxa_set_ficp_info(&palmt5_ficp_platform_data);
pxa_set_keypad_info(&palmt5_keypad_platform_data);
- wm97xx_bat_set_pdata(&wm97xx_batt_pdata);
platform_add_devices(devices, ARRAY_SIZE(devices));
}
diff --git a/arch/arm/mach-pxa/palmte2.c b/arch/arm/mach-pxa/palmte2.c
index 277c406..21c241b 100644
--- a/arch/arm/mach-pxa/palmte2.c
+++ b/arch/arm/mach-pxa/palmte2.c
@@ -23,7 +23,7 @@
#include <linux/pda_power.h>
#include <linux/pwm_backlight.h>
#include <linux/gpio.h>
-#include <linux/wm97xx_batt.h>
+#include <linux/wm97xx.h>
#include <linux/power_supply.h>
#include <linux/usb/gpio_vbus.h>
@@ -290,9 +290,9 @@ static struct platform_device power_supply = {
};
/******************************************************************************
- * WM97xx battery
+ * WM97xx audio, battery
******************************************************************************/
-static struct wm97xx_batt_info wm97xx_batt_pdata = {
+static struct wm97xx_batt_info palmte2_batt_pdata = {
.batt_aux = WM97XX_AUX_ID3,
.temp_aux = WM97XX_AUX_ID2,
.charge_gpio = -1,
@@ -306,9 +306,14 @@ static struct wm97xx_batt_info wm97xx_batt_pdata = {
.batt_name = "main-batt",
};
-/******************************************************************************
- * aSoC audio
- ******************************************************************************/
+static struct wm97xx_pdata palmte2_wm97xx_pdata = {
+ .batt_pdata = &palmte2_batt_pdata,
+};
+
+static pxa2xx_audio_ops_t palmte2_ac97_pdata = {
+ .codec_pdata = { &palmte2_wm97xx_pdata, },
+};
+
static struct palm27x_asoc_info palmte2_asoc_pdata = {
.jack_gpio = GPIO_NR_PALMTE2_EARPHONE_DETECT,
};
@@ -376,9 +381,8 @@ static void __init palmte2_init(void)
set_pxa_fb_info(&palmte2_lcd_screen);
pxa_set_mci_info(&palmte2_mci_platform_data);
palmte2_udc_init();
- pxa_set_ac97_info(NULL);
+ pxa_set_ac97_info(&palmte2_ac97_pdata);
pxa_set_ficp_info(&palmte2_ficp_platform_data);
- wm97xx_bat_set_pdata(&wm97xx_batt_pdata);
platform_add_devices(devices, ARRAY_SIZE(devices));
}
diff --git a/arch/arm/mach-pxa/palmtx.c b/arch/arm/mach-pxa/palmtx.c
index f1e248c..554b3da 100644
--- a/arch/arm/mach-pxa/palmtx.c
+++ b/arch/arm/mach-pxa/palmtx.c
@@ -25,7 +25,7 @@
#include <linux/pda_power.h>
#include <linux/pwm_backlight.h>
#include <linux/gpio.h>
-#include <linux/wm97xx_batt.h>
+#include <linux/wm97xx.h>
#include <linux/power_supply.h>
#include <linux/usb/gpio_vbus.h>
#include <linux/mtd/nand.h>
@@ -340,9 +340,9 @@ static struct platform_device power_supply = {
};
/******************************************************************************
- * WM97xx battery
+ * WM97xx audio, battery
******************************************************************************/
-static struct wm97xx_batt_info wm97xx_batt_pdata = {
+static struct wm97xx_batt_pdata palmtx_batt_pdata = {
.batt_aux = WM97XX_AUX_ID3,
.temp_aux = WM97XX_AUX_ID2,
.charge_gpio = -1,
@@ -356,15 +356,17 @@ static struct wm97xx_batt_info wm97xx_batt_pdata = {
.batt_name = "main-batt",
};
-/******************************************************************************
- * aSoC audio
- ******************************************************************************/
-static struct palm27x_asoc_info palmtx_asoc_pdata = {
- .jack_gpio = GPIO_NR_PALMTX_EARPHONE_DETECT,
+static struct wm97xx_pdata palmtx_wm97xx_pdata = {
+ .batt_pdata = &palmtx_batt_pdata,
};
static pxa2xx_audio_ops_t palmtx_ac97_pdata = {
.reset_gpio = 95,
+ .codec_pdata = { &palmtx_wm97xx_pdata, },
+};
+
+static struct palm27x_asoc_info palmtx_asoc_pdata = {
+ .jack_gpio = GPIO_NR_PALMTX_EARPHONE_DETECT,
};
static struct platform_device palmtx_asoc = {
@@ -538,7 +540,6 @@ static void __init palmtx_init(void)
pxa_set_ac97_info(&palmtx_ac97_pdata);
pxa_set_ficp_info(&palmtx_ficp_platform_data);
pxa_set_keypad_info(&palmtx_keypad_platform_data);
- wm97xx_bat_set_pdata(&wm97xx_batt_pdata);
platform_add_devices(devices, ARRAY_SIZE(devices));
}
diff --git a/arch/arm/mach-pxa/palmz72.c b/arch/arm/mach-pxa/palmz72.c
index c2bf493..b769447 100644
--- a/arch/arm/mach-pxa/palmz72.c
+++ b/arch/arm/mach-pxa/palmz72.c
@@ -27,7 +27,7 @@
#include <linux/pda_power.h>
#include <linux/pwm_backlight.h>
#include <linux/gpio.h>
-#include <linux/wm97xx_batt.h>
+#include <linux/wm97xx.h>
#include <linux/power_supply.h>
#include <linux/usb/gpio_vbus.h>
@@ -343,9 +343,9 @@ static struct platform_device power_supply = {
};
/******************************************************************************
- * WM97xx battery
+ * WM97xx audio, battery
******************************************************************************/
-static struct wm97xx_batt_info wm97xx_batt_pdata = {
+static struct wm97xx_batt_info palmz72_batt_pdata = {
.batt_aux = WM97XX_AUX_ID3,
.temp_aux = WM97XX_AUX_ID2,
.charge_gpio = -1,
@@ -359,9 +359,14 @@ static struct wm97xx_batt_info wm97xx_batt_pdata = {
.batt_name = "main-batt",
};
-/******************************************************************************
- * aSoC audio
- ******************************************************************************/
+static struct wm97xx_pdata palmz72_wm97xx_pdata = {
+ .batt_pdata = &palmz72_batt_pdata,
+};
+
+static pxa2xx_audio_ops_t palmz72_ac97_pdata = {
+ .codec_pdata = { &palmz72_wm97xx_pdata, },
+};
+
static struct platform_device palmz72_asoc = {
.name = "palm27x-asoc",
.id = -1,
@@ -494,10 +499,9 @@ static void __init palmz72_init(void)
set_pxa_fb_info(&palmz72_lcd_screen);
pxa_set_mci_info(&palmz72_mci_platform_data);
palmz72_udc_init();
- pxa_set_ac97_info(NULL);
+ pxa_set_ac97_info(&palmz72_ac97_pdata);
pxa_set_ficp_info(&palmz72_ficp_platform_data);
pxa_set_keypad_info(&palmz72_keypad_platform_data);
- wm97xx_bat_set_pdata(&wm97xx_batt_pdata);
platform_add_devices(devices, ARRAY_SIZE(devices));
}
diff --git a/arch/arm/mach-pxa/treo680.c b/arch/arm/mach-pxa/treo680.c
index f537265..f9acb12 100644
--- a/arch/arm/mach-pxa/treo680.c
+++ b/arch/arm/mach-pxa/treo680.c
@@ -19,7 +19,6 @@
#include <linux/pda_power.h>
#include <linux/pwm_backlight.h>
#include <linux/gpio.h>
-#include <linux/wm97xx_batt.h>
#include <linux/power_supply.h>
#include <linux/sysdev.h>
#include <linux/w1-gpio.h>
--
1.6.3.3
[-- 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
next prev parent reply other threads:[~2009-07-21 22:43 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-21 14:33 [PATCH] Allow passing platform_data to devices attached to AC97 bus Marek Vasut
2009-07-21 14:50 ` Takashi Iwai
2009-07-21 14:53 ` Mark Brown
2009-07-21 15:16 ` Takashi Iwai
2009-07-21 15:40 ` Marek Vasut
2009-07-21 18:30 ` Mark Brown
2009-07-21 19:51 ` Marek Vasut
2009-07-22 10:40 ` Mark Brown
2009-07-22 10:59 ` [PATCH 1/4] " Marek Vasut
2009-07-23 10:16 ` Mark Brown
2009-07-23 10:28 ` Takashi Iwai
2009-07-23 10:31 ` Mark Brown
2009-07-21 20:24 ` [PATCH] " Marek Vasut
2009-07-21 20:59 ` Takashi Iwai
2009-07-21 21:53 ` Marek Vasut
2009-07-21 22:13 ` Marek Vasut
2009-07-21 22:33 ` Russell King - ARM Linux
2009-07-21 22:39 ` Marek Vasut
2009-07-21 22:40 ` Marek Vasut
2009-07-21 22:34 ` Anton Vorontsov
2009-07-21 22:43 ` Marek Vasut [this message]
2009-07-22 11:01 ` [PATCH 1/4] " Marek Vasut
2009-07-22 11:02 ` [PATCH 2/4] Allow passing platform_data for pxa2xx-ac97 Marek Vasut
2009-07-23 10:27 ` Mark Brown
2009-07-23 14:16 ` Marek Vasut
2009-07-23 15:14 ` Mark Brown
2009-07-23 18:39 ` Marek Vasut
2009-07-28 5:28 ` Marek Vasut
2009-07-30 0:55 ` Marek Vasut
2009-08-13 20:40 ` Mark Brown
2009-08-13 23:34 ` Marek Vasut
2009-08-13 23:42 ` Anton Vorontsov
2009-08-14 8:57 ` Mark Brown
2009-07-22 11:04 ` [PATCH 3/4] Convert WM97xx driver to use platform_data Marek Vasut
2009-07-23 11:49 ` Mark Brown
2009-07-24 19:44 ` Robert Jarzmik
2009-07-24 21:03 ` Marek Vasut
2009-07-22 11:05 ` [PATCH 4/4] Convert all platforms to pass platform_data to wm97xx battery Marek Vasut
2009-07-22 18:09 ` Robert Jarzmik
2009-07-22 18:30 ` Marek Vasut
2009-07-25 20:55 ` Robert Jarzmik
2009-07-27 0:06 ` Marek Vasut
2009-07-21 20:25 ` [PATCH] Allow passing platform_data to devices attached to AC97 bus Marek Vasut
2009-07-21 15:41 ` Marek Vasut
2009-07-21 17:40 ` Marek Vasut
2009-07-21 18:27 ` Mark Brown
2009-07-21 18:38 ` Mark Brown
2009-07-21 17:42 ` Marek Vasut
2009-07-21 18:18 ` Marek Vasut
2009-07-21 15:11 ` Robert Jarzmik
2009-07-21 15:17 ` Takashi Iwai
2009-07-25 20:56 ` Robert Jarzmik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200907220043.34047.marek.vasut@gmail.com \
--to=marek.vasut@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=avorontsov@ru.mvista.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=cbou@mail.ru \
--cc=dwmw2@infradead.org \
--cc=eric.y.miao@gmail.com \
--cc=linux-arm-kernel@lists.arm.linux.org.uk \
--cc=linux@arm.linux.org.uk \
--cc=robert.jarzmik@free.fr \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox