linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] cbus: add of_match_table
@ 2011-10-17 20:50 Felipe Balbi
  2011-10-17 20:50 ` [PATCH 2/4] cbus: retu: no need to pass devid via pdata Felipe Balbi
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Felipe Balbi @ 2011-10-17 20:50 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Linux OMAP Mailing List, Felipe Balbi

then we can make DeviceTree conversion happen.

Signed-off-by: Felipe Balbi <balbi@ti.com>
---
 drivers/cbus/retu.c  |    9 +++++++++
 drivers/cbus/tahvo.c |   10 ++++++++++
 2 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/drivers/cbus/retu.c b/drivers/cbus/retu.c
index 35bcb50..464fc0c 100644
--- a/drivers/cbus/retu.c
+++ b/drivers/cbus/retu.c
@@ -522,11 +522,20 @@ static int __devexit retu_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static const struct of_device_id retu_match_table[] __devinitconst = {
+	{
+		.compatible = "nokia,retu",
+	},
+	{},
+};
+MODULE_DEVICE_TABLE(of, retu_match);
+
 static struct platform_driver retu_driver = {
 	.probe		= retu_probe,
 	.remove		= __devexit_p(retu_remove),
 	.driver		= {
 		.name	= "retu",
+		.of_match_table = retu_match_table,
 	},
 };
 
diff --git a/drivers/cbus/tahvo.c b/drivers/cbus/tahvo.c
index 6119d19..0387721 100644
--- a/drivers/cbus/tahvo.c
+++ b/drivers/cbus/tahvo.c
@@ -395,11 +395,21 @@ static int __devexit tahvo_remove(struct platform_device *pdev)
 	return 0;
 }
 
+
+static const struct of_device_id tahvo_match_table[] __devinitconst = {
+	{
+		.compatible = "nokia,tahvo",
+	},
+	{},
+};
+MODULE_DEVICE_TABLE(of, tahvo_match);
+
 static struct platform_driver tahvo_driver = {
 	.probe		= tahvo_probe,
 	.remove		= __devexit_p(tahvo_remove),
 	.driver		= {
 		.name	= "tahvo",
+		.of_match_table = tahvo_match_table,
 	},
 };
 
-- 
1.7.7


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/4] cbus: retu: no need to pass devid via pdata
  2011-10-17 20:50 [PATCH 1/4] cbus: add of_match_table Felipe Balbi
@ 2011-10-17 20:50 ` Felipe Balbi
  2011-10-17 20:50 ` [PATCH 3/4] cbus: move device IDs to local header Felipe Balbi
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Felipe Balbi @ 2011-10-17 20:50 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Linux OMAP Mailing List, Felipe Balbi

that's a constant, which will never change.

Signed-off-by: Felipe Balbi <balbi@ti.com>
---
 drivers/cbus/retu.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/cbus/retu.c b/drivers/cbus/retu.c
index 464fc0c..d2f43bb 100644
--- a/drivers/cbus/retu.c
+++ b/drivers/cbus/retu.c
@@ -46,8 +46,6 @@ struct retu {
 	struct mutex		mutex;
 	struct device		*dev;
 
-	int			devid;
-
 	int			irq_base;
 	int			irq_end;
 
@@ -71,7 +69,7 @@ static struct retu *the_retu;
  */
 static int __retu_read_reg(struct retu *retu, unsigned reg)
 {
-	return cbus_read_reg(retu->dev, retu->devid, reg);
+	return cbus_read_reg(retu->dev, CBUS_RETU_DEVICE_ID, reg);
 }
 
 /**
@@ -82,7 +80,7 @@ static int __retu_read_reg(struct retu *retu, unsigned reg)
  */
 static void __retu_write_reg(struct retu *retu, unsigned reg, u16 val)
 {
-	cbus_write_reg(retu->dev, retu->devid, reg, val);
+	cbus_write_reg(retu->dev, CBUS_RETU_DEVICE_ID, reg, val);
 }
 
 /**
@@ -430,7 +428,6 @@ static int retu_allocate_children(struct device *parent, int irq_base)
 static int __devinit retu_probe(struct platform_device *pdev)
 {
 	struct retu	*retu;
-	struct cbus_retu_platform_data *pdata = pdev->dev.platform_data;
 
 	int		ret = -ENOMEM;
 	int		rev;
@@ -452,7 +449,6 @@ static int __devinit retu_probe(struct platform_device *pdev)
 	retu->irq	= platform_get_irq(pdev, 0);
 	retu->irq_base	= ret;
 	retu->irq_end	= ret + MAX_RETU_IRQ_HANDLERS;
-	retu->devid	= pdata->devid;
 	retu->dev	= &pdev->dev;
 	the_retu	= retu;
 
-- 
1.7.7


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/4] cbus: move device IDs to local header
  2011-10-17 20:50 [PATCH 1/4] cbus: add of_match_table Felipe Balbi
  2011-10-17 20:50 ` [PATCH 2/4] cbus: retu: no need to pass devid via pdata Felipe Balbi
@ 2011-10-17 20:50 ` Felipe Balbi
  2011-10-17 20:50 ` [PATCH 4/4] cbus: retu: drop useless platform_data Felipe Balbi
  2011-11-03 21:45 ` [PATCH 1/4] cbus: add of_match_table Tony Lindgren
  3 siblings, 0 replies; 7+ messages in thread
From: Felipe Balbi @ 2011-10-17 20:50 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Linux OMAP Mailing List, Felipe Balbi

there's no need to show that to the world.

Signed-off-by: Felipe Balbi <balbi@ti.com>
---
 drivers/cbus/cbus.h                |    3 +++
 include/linux/platform_data/cbus.h |    3 ---
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/cbus/cbus.h b/drivers/cbus/cbus.h
index c1c3bd6..5380d173 100644
--- a/drivers/cbus/cbus.h
+++ b/drivers/cbus/cbus.h
@@ -23,6 +23,9 @@
 #ifndef __DRIVERS_CBUS_CBUS_H
 #define __DRIVERS_CBUS_CBUS_H
 
+#define CBUS_RETU_DEVICE_ID	0x01
+#define CBUS_TAHVO_DEVICE_ID	0x02
+
 extern int cbus_read_reg(struct device *, unsigned dev, unsigned reg);
 extern int cbus_write_reg(struct device *, unsigned dev, unsigned reg,
 		unsigned val);
diff --git a/include/linux/platform_data/cbus.h b/include/linux/platform_data/cbus.h
index 09809c7..5bd9211 100644
--- a/include/linux/platform_data/cbus.h
+++ b/include/linux/platform_data/cbus.h
@@ -22,9 +22,6 @@
 #ifndef __INCLUDE_LINUX_CBUS_H
 #define __INCLUDE_LINUX_CBUS_H
 
-#define CBUS_RETU_DEVICE_ID	0x01
-#define CBUS_TAHVO_DEVICE_ID	0x02
-
 struct cbus_host_platform_data {
 	int	dat_gpio;
 	int	clk_gpio;
-- 
1.7.7


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/4] cbus: retu: drop useless platform_data
  2011-10-17 20:50 [PATCH 1/4] cbus: add of_match_table Felipe Balbi
  2011-10-17 20:50 ` [PATCH 2/4] cbus: retu: no need to pass devid via pdata Felipe Balbi
  2011-10-17 20:50 ` [PATCH 3/4] cbus: move device IDs to local header Felipe Balbi
@ 2011-10-17 20:50 ` Felipe Balbi
  2011-11-03 21:45 ` [PATCH 1/4] cbus: add of_match_table Tony Lindgren
  3 siblings, 0 replies; 7+ messages in thread
From: Felipe Balbi @ 2011-10-17 20:50 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Linux OMAP Mailing List, Felipe Balbi

there's no need for that at all.

Signed-off-by: Felipe Balbi <balbi@ti.com>
---
 arch/arm/mach-omap1/board-nokia770.c |    5 -----
 arch/arm/mach-omap2/board-n8x0.c     |    5 -----
 include/linux/platform_data/cbus.h   |    4 ----
 3 files changed, 0 insertions(+), 14 deletions(-)

diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
index 3a72a44..62533cd 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -123,17 +123,12 @@ static struct resource retu_resource[] = {
 	},
 };
 
-static struct cbus_retu_platform_data nokia770_retu_data = {
-	.devid		= CBUS_RETU_DEVICE_ID,
-};
-
 static struct platform_device retu_device = {
 	.name		= "retu",
 	.id		= -1,
 	.resource	= retu_resource,
 	.num_resources	= ARRAY_SIZE(retu_resource),
 	.dev		= {
-		.platform_data = &nokia770_retu_data,
 		.parent	= &nokia770_cbus_device.dev,
 	},
 };
diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c
index bf2e51f..1cbacde 100644
--- a/arch/arm/mach-omap2/board-n8x0.c
+++ b/arch/arm/mach-omap2/board-n8x0.c
@@ -219,17 +219,12 @@ static struct resource retu_resource[] = {
 	},
 };
 
-static struct cbus_retu_platform_data n8x0_retu_data = {
-	.devid		= CBUS_RETU_DEVICE_ID,
-};
-
 static struct platform_device retu_device = {
 	.name		= "retu",
 	.id		= -1,
 	.resource	= retu_resource,
 	.num_resources	= ARRAY_SIZE(retu_resource),
 	.dev		= {
-		.platform_data = &n8x0_retu_data,
 		.parent	= &n8x0_cbus_device.dev,
 	},
 };
diff --git a/include/linux/platform_data/cbus.h b/include/linux/platform_data/cbus.h
index 5bd9211..7a977e1 100644
--- a/include/linux/platform_data/cbus.h
+++ b/include/linux/platform_data/cbus.h
@@ -28,8 +28,4 @@ struct cbus_host_platform_data {
 	int	sel_gpio;
 };
 
-struct cbus_retu_platform_data {
-	int	devid;
-};
-
 #endif /* __INCLUDE_LINUX_CBUS_H */
-- 
1.7.7


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/4] cbus: add of_match_table
  2011-10-17 20:50 [PATCH 1/4] cbus: add of_match_table Felipe Balbi
                   ` (2 preceding siblings ...)
  2011-10-17 20:50 ` [PATCH 4/4] cbus: retu: drop useless platform_data Felipe Balbi
@ 2011-11-03 21:45 ` Tony Lindgren
  2011-11-04  9:13   ` Felipe Balbi
  3 siblings, 1 reply; 7+ messages in thread
From: Tony Lindgren @ 2011-11-03 21:45 UTC (permalink / raw)
  To: Felipe Balbi; +Cc: Linux OMAP Mailing List

* Felipe Balbi <balbi@ti.com> [111017 13:16]:
> then we can make DeviceTree conversion happen.

Cool. Looks like n800 keeps running after these, pushing
to cbus branch.

Tony

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/4] cbus: add of_match_table
  2011-11-03 21:45 ` [PATCH 1/4] cbus: add of_match_table Tony Lindgren
@ 2011-11-04  9:13   ` Felipe Balbi
  2011-11-04 12:42     ` Cousson, Benoit
  0 siblings, 1 reply; 7+ messages in thread
From: Felipe Balbi @ 2011-11-04  9:13 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Felipe Balbi, Linux OMAP Mailing List

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

Hi,

On Thu, Nov 03, 2011 at 02:45:59PM -0700, Tony Lindgren wrote:
> * Felipe Balbi <balbi@ti.com> [111017 13:16]:
> > then we can make DeviceTree conversion happen.
> 
> Cool. Looks like n800 keeps running after these, pushing
> to cbus branch.

need to find out a way to create all devices via devicetree. Do you have
a branch which I could patch on top of ?

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/4] cbus: add of_match_table
  2011-11-04  9:13   ` Felipe Balbi
@ 2011-11-04 12:42     ` Cousson, Benoit
  0 siblings, 0 replies; 7+ messages in thread
From: Cousson, Benoit @ 2011-11-04 12:42 UTC (permalink / raw)
  To: Balbi, Felipe; +Cc: Tony Lindgren, Linux OMAP Mailing List

Hi Felipe,

On 11/4/2011 10:13 AM, Balbi, Felipe wrote:
> Hi,
>
> On Thu, Nov 03, 2011 at 02:45:59PM -0700, Tony Lindgren wrote:
>> * Felipe Balbi<balbi@ti.com>  [111017 13:16]:
>>> then we can make DeviceTree conversion happen.
>>
>> Cool. Looks like n800 keeps running after these, pushing
>> to cbus branch.
>
> need to find out a way to create all devices via devicetree. Do you have
> a branch which I could patch on top of ?

The latest mainline master branch does contain the first DT patches for 
basic OMAP3 & 4 support. You can probably start from here for OMAP2 DT 
support as well.

Regards,
Benoit

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-11-04 12:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-17 20:50 [PATCH 1/4] cbus: add of_match_table Felipe Balbi
2011-10-17 20:50 ` [PATCH 2/4] cbus: retu: no need to pass devid via pdata Felipe Balbi
2011-10-17 20:50 ` [PATCH 3/4] cbus: move device IDs to local header Felipe Balbi
2011-10-17 20:50 ` [PATCH 4/4] cbus: retu: drop useless platform_data Felipe Balbi
2011-11-03 21:45 ` [PATCH 1/4] cbus: add of_match_table Tony Lindgren
2011-11-04  9:13   ` Felipe Balbi
2011-11-04 12:42     ` Cousson, Benoit

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).