public inbox for alsa-devel@alsa-project.org
 help / color / mirror / Atom feed
From: Marek Vasut <marek.vasut@gmail.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org,
	Mark Brown <broonie@opensource.wolfsonmicro.com>
Subject: Re: [PATCH] Allow passing platform_data to devices attached to AC97 bus
Date: Tue, 21 Jul 2009 20:18:44 +0200	[thread overview]
Message-ID: <200907212018.44914.marek.vasut@gmail.com> (raw)
In-Reply-To: <s5hd47u2hjc.wl%tiwai@suse.de>

[-- Attachment #1: Type: text/plain, Size: 1002 bytes --]

Dne Út 21. července 2009 17:16:07 Takashi Iwai napsal(a):
> At Tue, 21 Jul 2009 15:53:23 +0100,
>
> Mark Brown wrote:
> > On Tue, Jul 21, 2009 at 04:50:26PM +0200, Takashi Iwai wrote:
> > > Marek Vasut wrote:
> > > >  	int ret;
> > > > +	pxa2xx_audio_ops_t *pdata = dev->dev.platform_data;
> > >
> > > Use the get function.
> >
> > There's no such function in mainline right now.  However, apropos of
> > something else I submitted a patch adding that to the driver core - it's
> > been merged for 2.6.32 but won't be available in ALSA until after the
> > next merge window.  The function is dev_get_platdata().
>
> Ah, right.  This can be fixed later, then.
>
> > > Also, at the next time, add Russell or linux-arm to Cc so that he
> > > knows at least that a file in arch/arm will be changed.
> >
> > Ideally split things into two separate patches.
>
> Agreed.
>
>
> Takashi

And one more patch to convert the mainstone accelerated touch driver to use 
platform_data.

[-- Attachment #2: 0001-Convert-the-mainstone-accelerated-touch-driver-to-us.patch --]
[-- Type: text/x-patch, Size: 6737 bytes --]

From c75defb486f199d4bc9ead3245032ca2c0d298c9 Mon Sep 17 00:00:00 2001
From: Marek Vasut <marek.vasut@gmail.com>
Date: Tue, 21 Jul 2009 20:12:23 +0200
Subject: [PATCH] Convert the mainstone accelerated touch driver to use platform_data

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
 arch/arm/mach-pxa/mainstone.c                |   10 ++++++++++
 arch/arm/mach-pxa/palmld.c                   |    9 ++++++++-
 arch/arm/mach-pxa/palmt5.c                   |    9 ++++++++-
 arch/arm/mach-pxa/palmtx.c                   |    9 ++++++++-
 drivers/input/touchscreen/mainstone-wm97xx.c |   26 ++++++++++++++++----------
 include/linux/wm97xx.h                       |    3 ++-
 6 files changed, 52 insertions(+), 14 deletions(-)

diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c
index a4eeae3..b116927 100644
--- a/arch/arm/mach-pxa/mainstone.c
+++ b/arch/arm/mach-pxa/mainstone.c
@@ -27,6 +27,7 @@
 #include <linux/gpio_keys.h>
 #include <linux/pwm_backlight.h>
 #include <linux/smc91x.h>
+#include <linux/wm97xx.h>
 
 #include <asm/types.h>
 #include <asm/setup.h>
@@ -284,11 +285,20 @@ static void mst_audio_resume(void *priv)
 	MST_MSCWR2 &= mst_audio_suspend_mask | ~MST_MSCWR2_AC97_SPKROFF;
 }
 
+static struct wm97xx_touch_pdata mainstone_touch_pdata = {
+	.irq_gpio	= 4,
+};
+
+static struct wm97xx_pdata mainstone_wm97xx_pdata = {
+	.touch_pdata	= &palmtx_touch_pdata,
+};
+
 static pxa2xx_audio_ops_t mst_audio_ops = {
 	.startup	= mst_audio_startup,
 	.shutdown	= mst_audio_shutdown,
 	.suspend	= mst_audio_suspend,
 	.resume		= mst_audio_resume,
+	.codec_pdata	= { &mainstone_wm97xx_pdata, },
 };
 
 static struct resource flash_resources[] = {
diff --git a/arch/arm/mach-pxa/palmld.c b/arch/arm/mach-pxa/palmld.c
index bcf5b46..e7af187 100644
--- a/arch/arm/mach-pxa/palmld.c
+++ b/arch/arm/mach-pxa/palmld.c
@@ -406,7 +406,7 @@ static struct platform_device power_supply = {
 };
 
 /******************************************************************************
- * WM97xx audio, battery
+ * WM97xx audio, touchscreen, battery
  ******************************************************************************/
 static struct wm97xx_batt_pdata palmld_batt_pdata = {
 	.batt_aux	= WM97XX_AUX_ID3,
@@ -422,8 +422,15 @@ static struct wm97xx_batt_pdata palmld_batt_pdata = {
 	.batt_name	= "main-batt",
 };
 
+static struct wm97xx_touch_pdata palmld_touch_pdata = {
+	.irq_gpio	= GPIO_NR_PALMLD_WM9712_IRQ,
+	.pen_int	= 1,
+	.variant	= WM97xx_WM1613,
+};
+
 static struct wm97xx_pdata palmld_wm97xx_pdata = {
 	.batt_pdata	= &palmld_batt_pdata,
+	.touch_pdata	= &palmld_touch_pdata,
 };
 
 static pxa2xx_audio_ops_t palmld_ac97_pdata = {
diff --git a/arch/arm/mach-pxa/palmt5.c b/arch/arm/mach-pxa/palmt5.c
index 3e8b21d..3863cb9 100644
--- a/arch/arm/mach-pxa/palmt5.c
+++ b/arch/arm/mach-pxa/palmt5.c
@@ -317,7 +317,7 @@ static struct platform_device power_supply = {
 };
 
 /******************************************************************************
- * WM97xx audio, battery
+ * WM97xx audio, touchscreen, battery
  ******************************************************************************/
 static struct wm97xx_batt_pdata palmt5_batt_pdata = {
 	.batt_aux	= WM97XX_AUX_ID3,
@@ -333,8 +333,15 @@ static struct wm97xx_batt_pdata palmt5_batt_pdata = {
 	.batt_name	= "main-batt",
 };
 
+static struct wm97xx_touch_pdata palmt5_touch_pdata = {
+	.irq_gpio	= GPIO_NR_PALMT5_WM9712_IRQ,
+	.pen_int	= 1,
+	.variant	= WM97xx_WM1613,
+};
+
 static struct wm97xx_pdata palmt5_wm97xx_pdata = {
 	.batt_pdata	= &palmt5_batt_pdata,
+	.touch_pdata	= &palmt5_touch_pdata,
 };
 
 static pxa2xx_audio_ops_t palmt5_ac97_pdata = {
diff --git a/arch/arm/mach-pxa/palmtx.c b/arch/arm/mach-pxa/palmtx.c
index 554b3da..9009bd6 100644
--- a/arch/arm/mach-pxa/palmtx.c
+++ b/arch/arm/mach-pxa/palmtx.c
@@ -340,7 +340,7 @@ static struct platform_device power_supply = {
 };
 
 /******************************************************************************
- * WM97xx audio, battery
+ * WM97xx audio, touchscreen, battery
  ******************************************************************************/
 static struct wm97xx_batt_pdata palmtx_batt_pdata = {
 	.batt_aux	= WM97XX_AUX_ID3,
@@ -356,8 +356,15 @@ static struct wm97xx_batt_pdata palmtx_batt_pdata = {
 	.batt_name	= "main-batt",
 };
 
+static struct wm97xx_touch_pdata palmtx_touch_pdata = {
+	.irq_gpio	= GPIO_NR_PALMTX_WM9712_IRQ,
+	.pen_int	= 1,
+	.variant	= WM97xx_WM1613,
+};
+
 static struct wm97xx_pdata palmtx_wm97xx_pdata = {
 	.batt_pdata	= &palmtx_batt_pdata,
+	.touch_pdata	= &palmtx_touch_pdata,
 };
 
 static pxa2xx_audio_ops_t palmtx_ac97_pdata = {
diff --git a/drivers/input/touchscreen/mainstone-wm97xx.c b/drivers/input/touchscreen/mainstone-wm97xx.c
index e000ab3..96bedd3 100644
--- a/drivers/input/touchscreen/mainstone-wm97xx.c
+++ b/drivers/input/touchscreen/mainstone-wm97xx.c
@@ -194,16 +194,6 @@ static int wm97xx_acc_startup(struct wm97xx *wm)
 		 "mainstone accelerated touchscreen driver, %d samples/sec\n",
 		 cinfo[sp_idx].speed);
 
-	/* IRQ driven touchscreen is used on Palm hardware */
-	if (machine_is_palmt5() || machine_is_palmtx() || machine_is_palmld()) {
-		pen_int = 1;
-		irq = 27;
-		/* There is some obscure mutant of WM9712 interbred with WM9713
-		 * used on Palm HW */
-		wm->variant = WM97xx_WM1613;
-	} else if (machine_is_mainstone() && pen_int)
-		irq = 4;
-
 	if (irq) {
 		ret = gpio_request(irq, "Touchscreen IRQ");
 		if (ret)
@@ -280,6 +270,22 @@ static struct wm97xx_mach_ops mainstone_mach_ops = {
 static int mainstone_wm97xx_probe(struct platform_device *pdev)
 {
 	struct wm97xx *wm = platform_get_drvdata(pdev);
+	struct wm97xx_touch_pdata *pdata = pdev->dev.platform_data;
+
+	if (pdata) {
+		if (pdata->irq_gpio)
+			irq = pdata->irq_gpio;
+		if (pdata->cont_rate)
+			cont_rate = pdata->cont_rate;
+		if (pdata->pen_int)
+			pen_int = pdata->pen_int;
+		if (pdata->pressure)
+			pressure = pdata->pressure;
+		if (pdata->ac97_touch_slot)
+			ac97_touch_slot = pdata->ac97_touch_slot;
+		if (pdata->variant)
+			wm->variant = pdata->variant;
+	}
 
 	return wm97xx_register_mach_ops(wm, &mainstone_mach_ops);
 }
diff --git a/include/linux/wm97xx.h b/include/linux/wm97xx.h
index 746edfa..0c71c63 100644
--- a/include/linux/wm97xx.h
+++ b/include/linux/wm97xx.h
@@ -309,7 +309,8 @@ struct wm97xx_batt_pdata {
 
 struct wm97xx_touch_pdata {
 	int	irq;
-	bool	irq_inverted;
+	int	irq_gpio;	/* this is for mainstone and palm */
+	int	variant;
 
 	int	cont_rate;
 	int	pen_int;
-- 
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

  parent reply	other threads:[~2009-07-21 18:19 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
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 [this message]
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=200907212018.44914.marek.vasut@gmail.com \
    --to=marek.vasut@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --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