public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Registering sgx device and it's platform specific data
@ 2010-03-26 10:33 Agarwal, Preshit
  2010-03-26 17:02 ` Mike Turquette
  2010-03-26 17:49 ` Felipe Balbi
  0 siblings, 2 replies; 3+ messages in thread
From: Agarwal, Preshit @ 2010-03-26 10:33 UTC (permalink / raw)
  To: linux-omap@vger.kernel.org

In this patch SGX powervr_device is registered with it's platform specific
data to provide information about setting constraint through 
omap_pm_set_min_bus_tput.
This patch removes the requirement of EXPORT_SYMBOL for the omap_pm_set_min_bus_tput
function.

Signed-off-by: Allen Pais <allen.pais@ti.com>
Signed-off-by: Preshit Agarwal <preshit.agarwal@ti.com>
---
 arch/arm/mach-omap2/devices.c                  |   26 ++++++++++++++++++++++-
 arch/arm/mach-omap2/include/mach/omap_sgxdef.h |   13 ++++++++++++
 2 files changed, 37 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/mach-omap2/include/mach/omap_sgxdef.h

diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 7131d8d..32a06b6 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -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)
@@ -773,6 +773,28 @@ static inline void omap_hdq_init(void)
 static inline void omap_hdq_init(void) {}
 #endif
 
+struct sgx_platform_data omap_sgx_data = {
+	.set_min_bus_tput = omap_pm_set_min_bus_tput,
+};
+
+static struct platform_device powervr_device = {
+	.name            = "pvrsrvkm",
+	.id              = -1,
+#ifdef CONFIG_PM
+	.dev            = {
+	.platform_data = &omap_sgx_data,
+       }
+#else
+	.dev            = {
+	.platform_data = NULL,}
+#endif
+};
+static void omap_init_sgx(void)
+{
+       (void) platform_device_register(&powervr_device);
+}
+
+
 /*-------------------------------------------------------------------------*/
 
 static int __init omap2_init_devices(void)
@@ -787,7 +809,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);
diff --git a/arch/arm/mach-omap2/include/mach/omap_sgxdef.h b/arch/arm/mach-omap2/include/mach/omap_sgxdef.h
new file mode 100644
index 0000000..08e24bb
--- /dev/null
+++ b/arch/arm/mach-omap2/include/mach/omap_sgxdef.h
@@ -0,0 +1,13 @@
+#ifndef OMAP_SGXDEF_H
+#define OMAP_SGXDEF_H
+
+#include <plat/omap-pm.h>
+
+#ifdef CONFIG_PM
+struct sgx_platform_data {
+	void(*set_min_bus_tput)(struct device *dev, u8 agent_id,
+							unsigned long r);
+};
+
+#endif
+#endif
-- 
1.5.4.3

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

* Re: [PATCH] Registering sgx device and it's platform specific data
  2010-03-26 10:33 [PATCH] Registering sgx device and it's platform specific data Agarwal, Preshit
@ 2010-03-26 17:02 ` Mike Turquette
  2010-03-26 17:49 ` Felipe Balbi
  1 sibling, 0 replies; 3+ messages in thread
From: Mike Turquette @ 2010-03-26 17:02 UTC (permalink / raw)
  To: Agarwal, Preshit; +Cc: linux-omap@vger.kernel.org

Agarwal, Preshit wrote:
> In this patch SGX powervr_device is registered with it's platform specific
> data to provide information about setting constraint through 
> omap_pm_set_min_bus_tput.
> This patch removes the requirement of EXPORT_SYMBOL for the omap_pm_set_min_bus_tput
> function.
> 
> Signed-off-by: Allen Pais <allen.pais@ti.com>
> Signed-off-by: Preshit Agarwal <preshit.agarwal@ti.com>
> ---
>  arch/arm/mach-omap2/devices.c                  |   26 ++++++++++++++++++++++-
>  arch/arm/mach-omap2/include/mach/omap_sgxdef.h |   13 ++++++++++++
>  2 files changed, 37 insertions(+), 2 deletions(-)
>  create mode 100644 arch/arm/mach-omap2/include/mach/omap_sgxdef.h
> 
> diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
> index 7131d8d..32a06b6 100644
> --- a/arch/arm/mach-omap2/devices.c
> +++ b/arch/arm/mach-omap2/devices.c
> @@ -26,7 +26,7 @@
>  #include <plat/mux.h>
>  #include <mach/gpio.h>
>  #include <plat/mmc.h>
> -
> +#include <mach/omap_sgxdef.h>

It is best to maintain the original whitespace.

>  #include "mux.h"
>  
>  #if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE)
> @@ -773,6 +773,28 @@ static inline void omap_hdq_init(void)
>  static inline void omap_hdq_init(void) {}
>  #endif
>  
> +struct sgx_platform_data omap_sgx_data = {
> +	.set_min_bus_tput = omap_pm_set_min_bus_tput,
> +};
> +
> +static struct platform_device powervr_device = {
> +	.name            = "pvrsrvkm",
> +	.id              = -1,
> +#ifdef CONFIG_PM
> +	.dev            = {
> +	.platform_data = &omap_sgx_data,
> +       }
> +#else
> +	.dev            = {
> +	.platform_data = NULL,}
> +#endif
> +};
> +static void omap_init_sgx(void)
> +{
> +       (void) platform_device_register(&powervr_device);
> +}
> +
> +
>  /*-------------------------------------------------------------------------*/
>  
>  static int __init omap2_init_devices(void)
> @@ -787,7 +809,7 @@ static int __init omap2_init_devices(void)
>  	omap_hdq_init();
>  	omap_init_sti();
>  	omap_init_sha1_md5();
> -
> +	omap_init_sgx();

Same whitespace issue as above.

Regards,
Mike

>  	return 0;
>  }
>  arch_initcall(omap2_init_devices);
> diff --git a/arch/arm/mach-omap2/include/mach/omap_sgxdef.h b/arch/arm/mach-omap2/include/mach/omap_sgxdef.h
> new file mode 100644
> index 0000000..08e24bb
> --- /dev/null
> +++ b/arch/arm/mach-omap2/include/mach/omap_sgxdef.h
> @@ -0,0 +1,13 @@
> +#ifndef OMAP_SGXDEF_H
> +#define OMAP_SGXDEF_H
> +
> +#include <plat/omap-pm.h>
> +
> +#ifdef CONFIG_PM
> +struct sgx_platform_data {
> +	void(*set_min_bus_tput)(struct device *dev, u8 agent_id,
> +							unsigned long r);
> +};
> +
> +#endif
> +#endif


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

* Re: [PATCH] Registering sgx device and it's platform specific data
  2010-03-26 10:33 [PATCH] Registering sgx device and it's platform specific data Agarwal, Preshit
  2010-03-26 17:02 ` Mike Turquette
@ 2010-03-26 17:49 ` Felipe Balbi
  1 sibling, 0 replies; 3+ messages in thread
From: Felipe Balbi @ 2010-03-26 17:49 UTC (permalink / raw)
  To: Agarwal, Preshit; +Cc: linux-omap

On Fri, 26 Mar 2010 16:03:26 +0530, "Agarwal, Preshit"
<preshit.agarwal@ti.com> wrote:
> In this patch SGX powervr_device is registered with it's platform
specific
> data to provide information about setting constraint through 
> omap_pm_set_min_bus_tput.
> This patch removes the requirement of EXPORT_SYMBOL for the
> omap_pm_set_min_bus_tput
> function.
> 
> Signed-off-by: Allen Pais <allen.pais@ti.com>
> Signed-off-by: Preshit Agarwal <preshit.agarwal@ti.com>
> ---
>  arch/arm/mach-omap2/devices.c                  |   26
>  ++++++++++++++++++++++-
>  arch/arm/mach-omap2/include/mach/omap_sgxdef.h |   13 ++++++++++++
>  2 files changed, 37 insertions(+), 2 deletions(-)
>  create mode 100644 arch/arm/mach-omap2/include/mach/omap_sgxdef.h
> 
> diff --git a/arch/arm/mach-omap2/devices.c
b/arch/arm/mach-omap2/devices.c
> index 7131d8d..32a06b6 100644
> --- a/arch/arm/mach-omap2/devices.c
> +++ b/arch/arm/mach-omap2/devices.c
> @@ -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)
> @@ -773,6 +773,28 @@ static inline void omap_hdq_init(void)
>  static inline void omap_hdq_init(void) {}
>  #endif
>  
> +struct sgx_platform_data omap_sgx_data = {
> +	.set_min_bus_tput = omap_pm_set_min_bus_tput,
> +};
> +
> +static struct platform_device powervr_device = {
> +	.name            = "pvrsrvkm",
> +	.id              = -1,
> +#ifdef CONFIG_PM
> +	.dev            = {
> +	.platform_data = &omap_sgx_data,
> +       }
> +#else
> +	.dev            = {
> +	.platform_data = NULL,}
> +#endif

it would be better that you move the ifdef to the implementation
of omap_pm_set_min_bus_tput() and if I remember correctly,
you're supposed to provide your own user of omap_pm_set_min_bus_tput()
instead of just passing that to driver. So you would

#ifdef CONFIG_PM
static void omap_sgx_pm_constraints(struct device *dev)
{
	return omap_pm_set_min_bus_tput(dev, blablablabla);
}
#else
static inline void omap_sgx_pm_constrainsts(struct device *dev)
{  }
#endif

struct sgx_platform_data omap_sgx_data = {
	.set_min_bus_tput = omap_pm_set_min_bus_tput,
};

static struct platform_device powervr_device = {
	.name            = "pvrsrvkm",
	.id              = -1,
	.dev            = {
		.platform_data = &omap_sgx_data,
       },
};

-- 
balbi

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

end of thread, other threads:[~2010-03-26 17:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-26 10:33 [PATCH] Registering sgx device and it's platform specific data Agarwal, Preshit
2010-03-26 17:02 ` Mike Turquette
2010-03-26 17:49 ` Felipe Balbi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox