Skip to contentSkip to conversation

OMAP3: Registering sgx device and it's platform data

PATCH Superseded Manjunatha GK 2 participants 3 messages May 11, 2010 – May 12, 2010

Subsystems (3)

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 OMAP3: Registering sgx device and it's platform data

The SGX powervr_device is registered with it's platform specific data to provide information about setting constraint through omap_pm_set_min_bus_tput.

Cc Tony Lindgren <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc Mike Turquette <[email protected]>
Cc Hemanth V <[email protected]>
---
 arch/arm/mach-omap2/devices.c                  |   26 ++++++++++++++++++++++-
 arch/arm/mach-omap2/include/mach/omap_sgxdef.h |   11 ++++++++++
 2 files changed, 35 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/mach-omap2/include/mach/omap_sgxdef.h
arch/arm/mach-omap2/devices.c +24 -2
index 20fa76e..aabbf7b 100644
@@ -26,7 +26,7 @@
 #include <plat/mux.h>
 #include <mach/gpio.h>
 #include <plat/mmc.h>
-
+#include <mach/omap_sgxdef.h>
 #include "mux.h"
 
 #if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE)
@@ -791,6 +791,28 @@ static inline void omap_hdq_init(void)
 static inline void omap_hdq_init(void) {}
 #endif
 
+struct sgx_platform_data omap_sgx_data = {
+#ifdef CONFIG_PM
+	.set_min_bus_tput = omap_pm_set_min_bus_tput,
+#else
+	.set_min_bus_tput = NULL,
+#endif
+};
+
+static struct platform_device powervr_device = {
+	.name            = "pvrsrvkm",
+	.id              = -1,
+	.dev            = {
+	.platform_data = &omap_sgx_data,
+       }
+};
+
+static void omap_init_sgx(void)
+{
+       (void) platform_device_register(&powervr_device);
+}
+
+
 /*-------------------------------------------------------------------------*/
 
 static int __init omap2_init_devices(void)
@@ -805,7 +827,7 @@ static int __init omap2_init_devices(void)
 	omap_hdq_init();
 	omap_init_sti();
 	omap_init_sha1_md5();
-
+	omap_init_sgx();
 	return 0;
 }
 arch_initcall(omap2_init_devices);
arch/arm/mach-omap2/include/mach/omap_sgxdef.h new file +11 -0
new file mode 100644
index 0000000..5d90a6a
@@ -0,0 +1,11 @@
+#ifndef OMAP_SGXDEF_H
+#define OMAP_SGXDEF_H
+
+#include <plat/omap-pm.h>
+
+struct sgx_platform_data {
+	void(*set_min_bus_tput)(struct device *dev, u8 agent_id,
+							unsigned long r);
+};
+
+#endif
Signature · 1 line
1.6.3.3
#1 lore raw
Quoted 30 lines · Manjunatha GK

The SGX powervr_device is registered with it's platform specific data to provide information about setting constraint through omap_pm_set_min_bus_tput.

Cc Tony Lindgren <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc Mike Turquette <[email protected]>
Cc Hemanth V <[email protected]>
---
 arch/arm/mach-omap2/devices.c                  |   26 ++++++++++++++++++++++-
 arch/arm/mach-omap2/include/mach/omap_sgxdef.h |   11 ++++++++++
 2 files changed, 35 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/mach-omap2/include/mach/omap_sgxdef.h
arch/arm/mach-omap2/devices.c +1 -1
index 20fa76e..aabbf7b 100644
@@ -26,7 +26,7 @@
 #include <plat/mux.h>
 #include <mach/gpio.h>
 #include <plat/mmc.h>
-
+#include <mach/omap_sgxdef.h>
 #include "mux.h"
 
 #if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE)

arch/arm/mach-omap2/devices.c static inline void omap_hdq_init(void) · line 799

Quoted 9 lines
arch/arm/mach-omap2/devices.c +6 -0
@@ -791,6 +791,28 @@ static inline void omap_hdq_init(void)
 static inline void omap_hdq_init(void) {}
 #endif
 
+struct sgx_platform_data omap_sgx_data = {
+#ifdef CONFIG_PM
+	.set_min_bus_tput = omap_pm_set_min_bus_tput,
+#else
+	.set_min_bus_tput = NULL,
+#endif

Please explain why this should be dependent on CONFIG_PM?

I suspect you should be making these kinds of decisions in the driver itself, not in device init.

Quoted 34 lines
arch/arm/mach-omap2/devices.c +17 -1
+};
+
+static struct platform_device powervr_device = {
+	.name            = "pvrsrvkm",
+	.id              = -1,
+	.dev            = {
+	.platform_data = &omap_sgx_data,
+       }
+};
+
+static void omap_init_sgx(void)
+{
+       (void) platform_device_register(&powervr_device);
+}
+
+
 /*-------------------------------------------------------------------------*/
 
 static int __init omap2_init_devices(void)
@@ -805,7 +827,7 @@ static int __init omap2_init_devices(void)
 	omap_hdq_init();
 	omap_init_sti();
 	omap_init_sha1_md5();
-
+	omap_init_sgx();
 	return 0;
 }
 arch_initcall(omap2_init_devices);
arch/arm/mach-omap2/include/mach/omap_sgxdef.h new file +0 -0
new file mode 100644
index 0000000..5d90a6a

arch/arm/mach-omap2/include/mach/omap_sgxdef.h line 7

Quoted 7 lines
arch/arm/mach-omap2/include/mach/omap_sgxdef.h new file +7 -0
@@ -0,0 +1,11 @@
+#ifndef OMAP_SGXDEF_H
+#define OMAP_SGXDEF_H
+
+#include <plat/omap-pm.h>
+
+struct sgx_platform_data {
+	void(*set_min_bus_tput)(struct device *dev, u8 agent_id,

need a space after 'void' and before '('

arch/arm/mach-omap2/include/mach/omap_sgxdef.h line 8

Quoted 1 line
arch/arm/mach-omap2/include/mach/omap_sgxdef.h new file +1 -0
+							unsigned long r);

minor nit: you could drop a tab of 3 for nicer looking alignment

Kevin

#2 lore raw
Quoted 58 lines

-----Original Message-----
From: Kevin Hilman [mailto:[email protected]]
Sent: Tuesday, May 11, 2010 8:27 PM
To: G, Manjunath Kondaiah
Cc: [email protected]; Agarwal, Preshit; Tony Lindgren; Turquette, Mike; V, Hemanth
Subject: Re: [PATCH v3] OMAP3: Registering sgx device and it's platform data

Quoted 4 lines · Manjunatha GK

The SGX powervr_device is registered with it's platform specific data to provide information about setting constraint through omap_pm_set_min_bus_tput.

Quoted 8 lines
Cc Tony Lindgren <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc Mike Turquette <[email protected]>
Cc Hemanth V <[email protected]>
---
 arch/arm/mach-omap2/devices.c                  |   26 

++++++++++++++++++++++-

Review

Quoted 5 lines
 arch/arm/mach-omap2/include/mach/omap_sgxdef.h |   11 ++++++++++
 2 files changed, 35 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/mach-omap2/include/mach/omap_sgxdef.h
(quoted diff) +0 -0

b/arch/arm/mach-omap2/devices.c

arch/arm/mach-omap2/devices.c line 32

Quoted 12 lines

index 20fa76e..aabbf7b 100644

arch/arm/mach-omap2/devices.c +1 -1
@@ -26,7 +26,7 @@
 #include <plat/mux.h>
 #include <mach/gpio.h>
 #include <plat/mmc.h>
-
+#include <mach/omap_sgxdef.h>
 #include "mux.h"
 
 #if defined(CONFIG_VIDEO_OMAP2) || 

defined(CONFIG_VIDEO_OMAP2_MODULE)

arch/arm/mach-omap2/devices.c static inline void omap_hdq_init(void) · line 799

Quoted 10 lines
arch/arm/mach-omap2/devices.c +6 -0
@@ -791,6 +791,28 @@ static inline void omap_hdq_init(void)
 static inline void omap_hdq_init(void) {}
 #endif
 
+struct sgx_platform_data omap_sgx_data = {
+#ifdef CONFIG_PM
+	.set_min_bus_tput = omap_pm_set_min_bus_tput,
+#else
+	.set_min_bus_tput = NULL,
+#endif

Please explain why this should be dependent on CONFIG_PM?

Quoted 2 lines

I suspect you should be making these kinds of decisions in the driver itself, not in device init.

Not sure in which context the SGX driver uses this platform data. But, as you mentioned, we can leave it to SGX driver for handling it in driver itself. I will make this as NULL in device init.

Quoted 33 lines
Quoted 8 lines
arch/arm/mach-omap2/devices.c +7 -0
+};
+
+static struct platform_device powervr_device = {
+	.name            = "pvrsrvkm",
+	.id              = -1,
+	.dev            = {
+	.platform_data = &omap_sgx_data,

arch/arm/mach-omap2/devices.c static inline void omap_hdq_init(void) · line 817

Quoted 10 lines
arch/arm/mach-omap2/devices.c +9 -0
+       }
+};
+
+static void omap_init_sgx(void)
+{
+       (void) platform_device_register(&powervr_device);
+}
+
+
 

/*------------------------------------------------------------ -------------*/

Review

Quoted 12 lines
arch/arm/mach-omap2/devices.c +1 -1
 static int __init omap2_init_devices(void)
@@ -805,7 +827,7 @@ static int __init omap2_init_devices(void)
 	omap_hdq_init();
 	omap_init_sti();
 	omap_init_sha1_md5();
-
+	omap_init_sgx();
 	return 0;
 }
 arch_initcall(omap2_init_devices);
(quoted diff) +0 -0

b/arch/arm/mach-omap2/include/mach/omap_sgxdef.h

Quoted 14 lines

arch/arm/mach-omap2/include/mach/omap_sgxdef.h line 7

Quoted 12 lines

new file mode 100644
index 0000000..5d90a6a

arch/arm/mach-omap2/include/mach/omap_sgxdef.h new file +7 -0
@@ -0,0 +1,11 @@
+#ifndef OMAP_SGXDEF_H
+#define OMAP_SGXDEF_H
+
+#include <plat/omap-pm.h>
+
+struct sgx_platform_data {
+	void(*set_min_bus_tput)(struct device *dev, u8 agent_id,

need a space after 'void' and before '('

Ok.

Quoted 5 lines

arch/arm/mach-omap2/include/mach/omap_sgxdef.h line 8

Quoted 2 lines
arch/arm/mach-omap2/include/mach/omap_sgxdef.h new file +1 -0
+							

unsigned long r);

minor nit: you could drop a tab of 3 for nicer looking alignment

Ok. Thanks

-Manjunath