All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 1/1] Registering sgx device and it's platform data
@ 2010-03-30  7:06 Agarwal, Preshit
  2010-03-30  8:45 ` Felipe Balbi
  2010-03-30  8:49 ` Paul Walmsley
  0 siblings, 2 replies; 5+ messages in thread
From: Agarwal, Preshit @ 2010-03-30  7:06 UTC (permalink / raw)
  To: linux-omap; +Cc: Pais, Allen, felipe.balbi

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 same function.

Signed-off-by: Preshit Agarwal <preshit.agarwal@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Allen Pais <allen.pais@ti.com>

---
 arch/arm/mach-omap2/devices.c                  |   32 ++++++++++++++++++++++++
 arch/arm/mach-omap2/include/mach/omap_sgxdef.h |   11 ++++++++
 2 files changed, 43 insertions(+), 0 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..fe76248 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -27,6 +27,7 @@
 #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 +774,36 @@ static inline void omap_hdq_init(void)
 static inline void omap_hdq_init(void) {}
 #endif
 
+#ifdef CONFIG_PM
+static void omap_sgx_pm_constraints(struct device *dev, u8 agent_id,
+							unsigned long r)
+{
+	omap_pm_set_min_bus_tput(dev, agent_id, r);
+}
+#else
+static inline void omap_sgx_pm_constraints(struct device *dev, u8 agent_id,
+							unsigned long r)
+{
+}
+#endif
+
+struct sgx_platform_data omap_sgx_data = {
+	.set_min_bus_tput = omap_sgx_pm_constraints,
+};
+
+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)
@@ -787,6 +818,7 @@ static int __init omap2_init_devices(void)
 	omap_hdq_init();
 	omap_init_sti();
 	omap_init_sha1_md5();
+	omap_init_sgx();
 
 	return 0;
 }
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..195df97
--- /dev/null
+++ b/arch/arm/mach-omap2/include/mach/omap_sgxdef.h
@@ -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
-- 
1.5.4.3

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

* Re: [PATCH v3 1/1] Registering sgx device and it's platform data
  2010-03-30  7:06 [PATCH v3 1/1] Registering sgx device and it's platform data Agarwal, Preshit
@ 2010-03-30  8:45 ` Felipe Balbi
  2010-03-30  8:49 ` Paul Walmsley
  1 sibling, 0 replies; 5+ messages in thread
From: Felipe Balbi @ 2010-03-30  8:45 UTC (permalink / raw)
  To: ext Agarwal, Preshit
  Cc: linux-omap, Pais, Allen, Balbi Felipe (Nokia-D/Helsinki)

On Tue, Mar 30, 2010 at 09:06:33AM +0200, ext Agarwal, Preshit wrote:
>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..195df97
>--- /dev/null
>+++ b/arch/arm/mach-omap2/include/mach/omap_sgxdef.h
>@@ -0,0 +1,11 @@

you're missing the gpl header on this file.

-- 
balbi

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

* Re: [PATCH v3 1/1] Registering sgx device and it's platform data
  2010-03-30  7:06 [PATCH v3 1/1] Registering sgx device and it's platform data Agarwal, Preshit
  2010-03-30  8:45 ` Felipe Balbi
@ 2010-03-30  8:49 ` Paul Walmsley
  2010-03-30  9:49   ` Felipe Balbi
  1 sibling, 1 reply; 5+ messages in thread
From: Paul Walmsley @ 2010-03-30  8:49 UTC (permalink / raw)
  To: Agarwal, Preshit; +Cc: linux-omap, Pais, Allen, felipe.balbi

Hello Preshit,

a minor comment:

On Tue, 30 Mar 2010, 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 same function.
> 
> Signed-off-by: Preshit Agarwal <preshit.agarwal@ti.com>
> Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
> Signed-off-by: Allen Pais <allen.pais@ti.com>
> 
> ---
>  arch/arm/mach-omap2/devices.c                  |   32 ++++++++++++++++++++++++
>  arch/arm/mach-omap2/include/mach/omap_sgxdef.h |   11 ++++++++
>  2 files changed, 43 insertions(+), 0 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..fe76248 100644
> --- a/arch/arm/mach-omap2/devices.c
> +++ b/arch/arm/mach-omap2/devices.c
> @@ -27,6 +27,7 @@
>  #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 +774,36 @@ static inline void omap_hdq_init(void)
>  static inline void omap_hdq_init(void) {}
>  #endif
>  
> +#ifdef CONFIG_PM
> +static void omap_sgx_pm_constraints(struct device *dev, u8 agent_id,
> +							unsigned long r)

I would suggest that you name this function be named something more 
specific, such as omap_sgx_set_bus_tput(), since the SGX driver may also 
need to set other PM constraints later, such as wakeup latency 
constraints.

> +{
> +	omap_pm_set_min_bus_tput(dev, agent_id, r);
> +}
> +#else
> +static inline void omap_sgx_pm_constraints(struct device *dev, u8 agent_id,
> +							unsigned long r)
> +{
> +}
> +#endif
> +
> +struct sgx_platform_data omap_sgx_data = {
> +	.set_min_bus_tput = omap_sgx_pm_constraints,
> +};
> +
> +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)
> @@ -787,6 +818,7 @@ static int __init omap2_init_devices(void)
>  	omap_hdq_init();
>  	omap_init_sti();
>  	omap_init_sha1_md5();
> +	omap_init_sgx();
>  
>  	return 0;
>  }
> 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..195df97
> --- /dev/null
> +++ b/arch/arm/mach-omap2/include/mach/omap_sgxdef.h
> @@ -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
> -- 
> 1.5.4.3--
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


- Paul

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

* Re: [PATCH v3 1/1] Registering sgx device and it's platform data
  2010-03-30  8:49 ` Paul Walmsley
@ 2010-03-30  9:49   ` Felipe Balbi
  2010-03-31  9:39     ` Paul Walmsley
  0 siblings, 1 reply; 5+ messages in thread
From: Felipe Balbi @ 2010-03-30  9:49 UTC (permalink / raw)
  To: ext Paul Walmsley
  Cc: Agarwal, Preshit, linux-omap, Pais, Allen,
	Balbi Felipe (Nokia-D/Helsinki)

Hi,

On Tue, Mar 30, 2010 at 10:49:19AM +0200, ext Paul Walmsley wrote:
>I would suggest that you name this function be named something more
>specific, such as omap_sgx_set_bus_tput(), since the SGX driver may also
>need to set other PM constraints later, such as wakeup latency
>constraints.

then it could just add the contraints to the same function instead of 
passing another pointer to driver ??

-- 
balbi

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

* Re: [PATCH v3 1/1] Registering sgx device and it's platform data
  2010-03-30  9:49   ` Felipe Balbi
@ 2010-03-31  9:39     ` Paul Walmsley
  0 siblings, 0 replies; 5+ messages in thread
From: Paul Walmsley @ 2010-03-31  9:39 UTC (permalink / raw)
  To: Felipe Balbi; +Cc: Agarwal, Preshit, linux-omap, Pais, Allen

Hi Felipe,

On Tue, 30 Mar 2010, Felipe Balbi wrote:

> On Tue, Mar 30, 2010 at 10:49:19AM +0200, ext Paul Walmsley wrote:
> > I would suggest that you name this function be named something more
> > specific, such as omap_sgx_set_bus_tput(), since the SGX driver may also
> > need to set other PM constraints later, such as wakeup latency
> > constraints.
> 
> then it could just add the contraints to the same function instead of passing
> another pointer to driver ??

It's hard to say without looking at the driver.  

Bus throughput constraints are only needed when the device is actively 
transferring data to/from the rest of the system.

Wakeup latency constraints are only needed when the device can go idle and 
enter some low-power state, but also needs to be ready in some limited 
amount of time to service an interrupt or a wakeup.

So, often it would make sense to set the two parameters at different 
points in the driver code.


- Paul

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

end of thread, other threads:[~2010-03-31  9:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-30  7:06 [PATCH v3 1/1] Registering sgx device and it's platform data Agarwal, Preshit
2010-03-30  8:45 ` Felipe Balbi
2010-03-30  8:49 ` Paul Walmsley
2010-03-30  9:49   ` Felipe Balbi
2010-03-31  9:39     ` Paul Walmsley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.