Re: [PATCHv2 0/5] OMAP DSS HWMOD fixes

2011-08-22 Thread Tomi Valkeinen
On Sun, 2011-08-21 at 00:03 -0600, Paul Walmsley wrote:
 On Thu, 18 Aug 2011, Tomi Valkeinen wrote:
 
  Did you get a chance to look at this series? These fixes will allow us
  to remove the temporary hacks from the DSS driver.
 
 These have been queued for the 3.1-rc fixes series.  Thanks for the 
 reminder,

Thanks. The !CONFIG_OMAP2_DSS fix looks fine to me.

 Tomi


--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCHv2 5/5] OMAP: HWMOD: Unify DSS resets for all OMAPs

2011-08-22 Thread Tomi Valkeinen
Hi Paul,

On Sat, 2011-08-20 at 00:26 -0600, Paul Walmsley wrote:
 On Fri, 19 Aug 2011, Paul Walmsley wrote:
 
  This one doesn't build when !CONFIG_OMAP2_DSS - the following is the 
  updated patch.
 
 Looks like my previous update missed a warning.  This also moves the 
 omap_dss_reset() prototype from arch/arm/mach-omap2/common-board-devices.h 
 to arch/arm/plat-omap/include/plat/common.h.

Related to this, there's also omap_display_init() function in display.c,
called by the board files, which I would like to move elsewhere from
include/video/omapdss.h.

I was thinking of moving it to
arch/arm/mach-omap2/common-board-devices.h but should I move it to
arch/arm/plat-omap/include/plat/common.h so that it's in the same place
with omap_dss_reset() (also from display.c)?

 Tomi


--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Re: Re: [alsa-devel] [PATCH 0/4] ASoC: OMAP4: McPDM: Fix legacy support

2011-08-22 Thread Péter Ujfalusi
On Friday 19 August 2011 15:04:20 Tony Lindgren wrote:
 It seems OK to me.

Thanks!

 But for the -rc cycle it has potential for
 fixes for features that never worked flame bait. If you guys
 are OK to deal with that then go ahead.

Hrm, I have not thought about this. Not sure, if we want to go there...

-- 
Péter
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [alsa-devel] [PATCH 0/4] ASoC: OMAP4: McPDM: Fix legacy support

2011-08-22 Thread Liam Girdwood
On 22/08/11 08:13, Ujfalusi, Peter wrote:
 On Friday 19 August 2011 15:04:20 Tony Lindgren wrote:
 It seems OK to me.
 
 Thanks!
 
 But for the -rc cycle it has potential for
 fixes for features that never worked flame bait. If you guys
 are OK to deal with that then go ahead.
 
 Hrm, I have not thought about this. Not sure, if we want to go there...
 

Yeah, lets take it for 3.2

Liam
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/3] OMAPDSS: Cleanup after HWMOD fixes

2011-08-22 Thread Tomi Valkeinen
After the patch-set [PATCHv2 0/5] OMAP DSS HWMOD fixes we can revert the DSS
hacks added to circumvent broken HWMOD data, and clean up unneeded clock
handling.

Tomi

Tomi Valkeinen (3):
  Revert HACK: OMAP: DSS2: clk hack for OMAP2/3
  Revert OMAP: DSS2: HDMI: fix hdmi clock name
  OMAP: DSS2: remove unneeded fck enable/disables

 drivers/video/omap2/dss/dispc.c |2 --
 drivers/video/omap2/dss/dsi.c   |   12 +---
 drivers/video/omap2/dss/dss.c   |7 ---
 drivers/video/omap2/dss/dss.h   |2 --
 drivers/video/omap2/dss/hdmi.c  |   14 --
 drivers/video/omap2/dss/rfbi.c  |5 +
 drivers/video/omap2/dss/venc.c  |   19 +--
 7 files changed, 3 insertions(+), 58 deletions(-)

-- 
1.7.4.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/3] Revert HACK: OMAP: DSS2: clk hack for OMAP2/3

2011-08-22 Thread Tomi Valkeinen
This reverts commit 9ede365aa6f74428a1f69c21ca1cf21213167576.

The hack is no longer needed, as the HWMOD data has been fixed.

Signed-off-by: Tomi Valkeinen tomi.valkei...@ti.com
---
 drivers/video/omap2/dss/dsi.c  |5 +
 drivers/video/omap2/dss/dss.c  |5 -
 drivers/video/omap2/dss/dss.h  |2 --
 drivers/video/omap2/dss/rfbi.c |5 +
 drivers/video/omap2/dss/venc.c |5 +
 5 files changed, 3 insertions(+), 19 deletions(-)

diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 12da2fb..707e5af 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -4441,10 +4441,7 @@ static int dsi_get_clocks(struct platform_device *dsidev)
 
dsi-dss_clk = clk;
 
-   if (cpu_is_omap34xx() || cpu_is_omap3630())
-   clk = clk_get(dsidev-dev, dss2_alwon_fck);
-   else
-   clk = clk_get(dsidev-dev, sys_clk);
+   clk = clk_get(dsidev-dev, sys_clk);
if (IS_ERR(clk)) {
DSSERR(can't get sys_clk\n);
clk_put(dsi-dss_clk);
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 0f9c3a6..9423a2e 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -691,11 +691,6 @@ static void dss_put_clocks(void)
clk_put(dss.dss_clk);
 }
 
-struct clk *dss_get_ick(void)
-{
-   return clk_get(dss.pdev-dev, ick);
-}
-
 int dss_runtime_get(void)
 {
int r;
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index 9c94b11..adeff04 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -209,8 +209,6 @@ void dss_uninit_platform_driver(void);
 int dss_runtime_get(void);
 void dss_runtime_put(void);
 
-struct clk *dss_get_ick(void);
-
 void dss_select_hdmi_venc_clk_source(enum dss_hdmi_venc_clk_source_select);
 const char *dss_get_generic_clk_source_name(enum omap_dss_clk_source clk_src);
 void dss_dump_clocks(struct seq_file *s);
diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c
index 1bb8ce1..50394ba 100644
--- a/drivers/video/omap2/dss/rfbi.c
+++ b/drivers/video/omap2/dss/rfbi.c
@@ -957,10 +957,7 @@ static int omap_rfbihw_probe(struct platform_device *pdev)
 
msleep(10);
 
-   if (cpu_is_omap24xx() || cpu_is_omap34xx() || cpu_is_omap3630())
-   clk = dss_get_ick();
-   else
-   clk = clk_get(pdev-dev, ick);
+   clk = clk_get(pdev-dev, ick);
if (IS_ERR(clk)) {
DSSERR(can't get ick\n);
r = PTR_ERR(clk);
diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
index 173c664..71e005d 100644
--- a/drivers/video/omap2/dss/venc.c
+++ b/drivers/video/omap2/dss/venc.c
@@ -741,10 +741,7 @@ static int venc_get_clocks(struct platform_device *pdev)
venc.tv_clk = clk;
 
if (dss_has_feature(FEAT_VENC_REQUIRES_TV_DAC_CLK)) {
-   if (cpu_is_omap34xx() || cpu_is_omap3630())
-   clk = clk_get(pdev-dev, dss_96m_fck);
-   else
-   clk = clk_get(pdev-dev, tv_dac_clk);
+   clk = clk_get(pdev-dev, tv_dac_clk);
if (IS_ERR(clk)) {
DSSERR(can't get tv_dac_clk\n);
clk_put(venc.tv_clk);
-- 
1.7.4.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/3] Revert OMAP: DSS2: HDMI: fix hdmi clock name

2011-08-22 Thread Tomi Valkeinen
This reverts commit df5d3ed23cf73ee0763a8963003bda9b69d9620f.

The HDMI clock name has been fixed in HWMOD data.

Signed-off-by: Tomi Valkeinen tomi.valkei...@ti.com
---
 drivers/video/omap2/dss/hdmi.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
index 3767323..9353dcf 100644
--- a/drivers/video/omap2/dss/hdmi.c
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -1704,9 +1704,9 @@ static int hdmi_get_clocks(struct platform_device *pdev)
 
hdmi.sys_clk = clk;
 
-   clk = clk_get(pdev-dev, dss_48mhz_clk);
+   clk = clk_get(pdev-dev, fck);
if (IS_ERR(clk)) {
-   DSSERR(can't get hdmi_clk\n);
+   DSSERR(can't get fck\n);
clk_put(hdmi.sys_clk);
return PTR_ERR(clk);
}
-- 
1.7.4.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/3] OMAP: DSS2: remove unneeded fck enable/disables

2011-08-22 Thread Tomi Valkeinen
Now that the HWMOD fmwk handles the fcks of DSS modules properly, the
DSS driver no longer needs to explicitely enable/disable the fck.

This patch removes the enables/disables of fck from dispc, dsi and dss.
The clk_get(fck) is still needed there, as the modules need to know the
frequency of the clock.

For hdmi and venc this patch also removes the clk_get(fck), as they
don't need the clock at all.

Signed-off-by: Tomi Valkeinen tomi.valkei...@ti.com
---
 drivers/video/omap2/dss/dispc.c |2 --
 drivers/video/omap2/dss/dsi.c   |7 ---
 drivers/video/omap2/dss/dss.c   |2 --
 drivers/video/omap2/dss/hdmi.c  |   14 --
 drivers/video/omap2/dss/venc.c  |   14 --
 5 files changed, 0 insertions(+), 39 deletions(-)

diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index bbd8340..9d9fbeb 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -3480,7 +3480,6 @@ static int omap_dispchw_remove(struct platform_device 
*pdev)
 static int dispc_runtime_suspend(struct device *dev)
 {
dispc_save_context();
-   clk_disable(dispc.dss_clk);
dss_runtime_put();
 
return 0;
@@ -3494,7 +3493,6 @@ static int dispc_runtime_resume(struct device *dev)
if (r  0)
return r;
 
-   clk_enable(dispc.dss_clk);
dispc_restore_context();
 
return 0;
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 707e5af..d167a54 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -4605,10 +4605,6 @@ static int omap_dsi1hw_remove(struct platform_device 
*dsidev)
 
 static int dsi_runtime_suspend(struct device *dev)
 {
-   struct dsi_data *dsi = dsi_get_dsidrv_data(to_platform_device(dev));
-
-   clk_disable(dsi-dss_clk);
-
dispc_runtime_put();
dss_runtime_put();
 
@@ -4617,7 +4613,6 @@ static int dsi_runtime_suspend(struct device *dev)
 
 static int dsi_runtime_resume(struct device *dev)
 {
-   struct dsi_data *dsi = dsi_get_dsidrv_data(to_platform_device(dev));
int r;
 
r = dss_runtime_get();
@@ -4628,8 +4623,6 @@ static int dsi_runtime_resume(struct device *dev)
if (r)
goto err_get_dispc;
 
-   clk_enable(dsi-dss_clk);
-
return 0;
 
 err_get_dispc:
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 9423a2e..356d3c1 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -819,13 +819,11 @@ static int omap_dsshw_remove(struct platform_device *pdev)
 static int dss_runtime_suspend(struct device *dev)
 {
dss_save_context();
-   clk_disable(dss.dss_clk);
return 0;
 }
 
 static int dss_runtime_resume(struct device *dev)
 {
-   clk_enable(dss.dss_clk);
dss_restore_context();
return 0;
 }
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
index 9353dcf..876274b 100644
--- a/drivers/video/omap2/dss/hdmi.c
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -56,7 +56,6 @@ static struct {
struct hdmi_config cfg;
 
struct clk *sys_clk;
-   struct clk *hdmi_clk;
 } hdmi;
 
 /*
@@ -1704,15 +1703,6 @@ static int hdmi_get_clocks(struct platform_device *pdev)
 
hdmi.sys_clk = clk;
 
-   clk = clk_get(pdev-dev, fck);
-   if (IS_ERR(clk)) {
-   DSSERR(can't get fck\n);
-   clk_put(hdmi.sys_clk);
-   return PTR_ERR(clk);
-   }
-
-   hdmi.hdmi_clk = clk;
-
return 0;
 }
 
@@ -1720,8 +1710,6 @@ static void hdmi_put_clocks(void)
 {
if (hdmi.sys_clk)
clk_put(hdmi.sys_clk);
-   if (hdmi.hdmi_clk)
-   clk_put(hdmi.hdmi_clk);
 }
 
 /* HDMI HW IP initialisation */
@@ -1792,7 +1780,6 @@ static int omapdss_hdmihw_remove(struct platform_device 
*pdev)
 
 static int hdmi_runtime_suspend(struct device *dev)
 {
-   clk_disable(hdmi.hdmi_clk);
clk_disable(hdmi.sys_clk);
 
dispc_runtime_put();
@@ -1815,7 +1802,6 @@ static int hdmi_runtime_resume(struct device *dev)
 
 
clk_enable(hdmi.sys_clk);
-   clk_enable(hdmi.hdmi_clk);
 
return 0;
 
diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
index 71e005d..5331958 100644
--- a/drivers/video/omap2/dss/venc.c
+++ b/drivers/video/omap2/dss/venc.c
@@ -295,7 +295,6 @@ static struct {
u32 wss_data;
struct regulator *vdda_dac_reg;
 
-   struct clk  *tv_clk;
struct clk  *tv_dac_clk;
 } venc;
 
@@ -732,19 +731,10 @@ static int venc_get_clocks(struct platform_device *pdev)
 {
struct clk *clk;
 
-   clk = clk_get(pdev-dev, fck);
-   if (IS_ERR(clk)) {
-   DSSERR(can't get fck\n);
-   return PTR_ERR(clk);
-   }
-
-   venc.tv_clk = clk;
-
if (dss_has_feature(FEAT_VENC_REQUIRES_TV_DAC_CLK)) {
clk = clk_get(pdev-dev, tv_dac_clk);
if 

[PATCH 0/4] OMAPDSS: DSI related improvements

2011-08-22 Thread Tomi Valkeinen
These patches add support for the second DSI module on OMAP4 by fixing the DSI 
device naming and adding necessary powers. Also DSI pad muxing is improved to 
support OMAP4.

 Tomi

Tomi Valkeinen (4):
  OMAP: DSS2: Change DSI device naming
  OMAP4: TWL: Add common omapdss supplies
  OMAP: DSS2: DSI: Improve dsi_mux_pads parameters
  OMAP: DSS2: Implement dsi_mux_pads for OMAP4

 arch/arm/mach-omap2/board-devkit8000.c   |2 +-
 arch/arm/mach-omap2/board-omap3pandora.c |2 +-
 arch/arm/mach-omap2/display.c|   60 +-
 arch/arm/mach-omap2/twl-common.c |   11 -
 drivers/video/omap2/dss/dsi.c|   67 ++---
 include/video/omapdss.h  |3 +-
 6 files changed, 112 insertions(+), 33 deletions(-)

-- 
1.7.4.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/4] OMAP: DSS2: Change DSI device naming

2011-08-22 Thread Tomi Valkeinen
Currently, there are 2 differently named platform devices generated for
the 2 DSS DSI modules. In order to use the same driver, the dsi devices
should be 2 instances of the same platform device.

Change the platform device names from omapdss_dsi1 and omapdss_dsi2
to omapdss_dsi, and set the device indices to 0 and 1.

Signed-off-by: Archit Taneja arc...@ti.com
Signed-off-by: Tomi Valkeinen tomi.valkei...@ti.com
---
 arch/arm/mach-omap2/board-devkit8000.c   |2 +-
 arch/arm/mach-omap2/board-omap3pandora.c |2 +-
 arch/arm/mach-omap2/display.c|6 +++---
 arch/arm/mach-omap2/twl-common.c |2 +-
 drivers/video/omap2/dss/dsi.c|   25 ++---
 5 files changed, 16 insertions(+), 21 deletions(-)

diff --git a/arch/arm/mach-omap2/board-devkit8000.c 
b/arch/arm/mach-omap2/board-devkit8000.c
index b6002ec..d3941e6 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -267,7 +267,7 @@ static struct twl4030_gpio_platform_data 
devkit8000_gpio_data = {
 
 static struct regulator_consumer_supply devkit8000_vpll1_supplies[] = {
REGULATOR_SUPPLY(vdds_dsi, omapdss),
-   REGULATOR_SUPPLY(vdds_dsi, omapdss_dsi1),
+   REGULATOR_SUPPLY(vdds_dsi, omapdss_dsi.0),
 };
 
 /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c 
b/arch/arm/mach-omap2/board-omap3pandora.c
index 080d7bd..3f10001 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -335,7 +335,7 @@ static struct regulator_consumer_supply 
pandora_vmmc3_supply[] = {
 static struct regulator_consumer_supply pandora_vdds_supplies[] = {
REGULATOR_SUPPLY(vdds_sdi, omapdss),
REGULATOR_SUPPLY(vdds_dsi, omapdss),
-   REGULATOR_SUPPLY(vdds_dsi, omapdss_dsi1),
+   REGULATOR_SUPPLY(vdds_dsi, omapdss_dsi.0),
 };
 
 static struct regulator_consumer_supply pandora_vcc_lcd_supply[] = {
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index cdb675a..0339605 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -62,7 +62,7 @@ static const struct omap_dss_hwmod_data 
omap3_dss_hwmod_data[] __initdata = {
{ dss_dispc, omapdss_dispc, -1 },
{ dss_rfbi, omapdss_rfbi, -1 },
{ dss_venc, omapdss_venc, -1 },
-   { dss_dsi1, omapdss_dsi1, -1 },
+   { dss_dsi1, omapdss_dsi, 0 },
 };
 
 static const struct omap_dss_hwmod_data omap4_dss_hwmod_data[] __initdata = {
@@ -70,8 +70,8 @@ static const struct omap_dss_hwmod_data 
omap4_dss_hwmod_data[] __initdata = {
{ dss_dispc, omapdss_dispc, -1 },
{ dss_rfbi, omapdss_rfbi, -1 },
{ dss_venc, omapdss_venc, -1 },
-   { dss_dsi1, omapdss_dsi1, -1 },
-   { dss_dsi2, omapdss_dsi2, -1 },
+   { dss_dsi1, omapdss_dsi, 0 },
+   { dss_dsi2, omapdss_dsi, 1 },
{ dss_hdmi, omapdss_hdmi, -1 },
 };
 
diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c
index daa056e..4f6d216 100644
--- a/arch/arm/mach-omap2/twl-common.c
+++ b/arch/arm/mach-omap2/twl-common.c
@@ -99,7 +99,7 @@ static struct regulator_init_data omap3_vdac_idata = {
 
 static struct regulator_consumer_supply omap3_vpll2_supplies[] = {
REGULATOR_SUPPLY(vdds_dsi, omapdss),
-   REGULATOR_SUPPLY(vdds_dsi, omapdss_dsi1),
+   REGULATOR_SUPPLY(vdds_dsi, omapdss_dsi.0),
 };
 
 static struct regulator_init_data omap3_vpll2_idata = {
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index d167a54..713e1d9 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -368,14 +368,9 @@ struct platform_device *dsi_get_dsidev_from_id(int module)
return dsi_pdev_map[module];
 }
 
-static int dsi_get_dsidev_id(struct platform_device *dsidev)
+static inline int dsi_get_dsidev_id(struct platform_device *dsidev)
 {
-   /* TEMP: Pass 0 as the dsi module index till the time the dsi platform
-* device names aren't changed to the form omapdss_dsi.0,
-* omapdss_dsi.1 and so on */
-   BUG_ON(dsidev-id != -1);
-
-   return 0;
+   return dsidev-id;
 }
 
 static inline void dsi_write_reg(struct platform_device *dsidev,
@@ -4465,7 +4460,7 @@ static void dsi_put_clocks(struct platform_device *dsidev)
 }
 
 /* DSI1 HW IP initialisation */
-static int omap_dsi1hw_probe(struct platform_device *dsidev)
+static int omap_dsihw_probe(struct platform_device *dsidev)
 {
struct omap_display_platform_data *dss_plat_data;
struct omap_dss_board_info *board_info;
@@ -4575,7 +4570,7 @@ err_alloc:
return r;
 }
 
-static int omap_dsi1hw_remove(struct platform_device *dsidev)
+static int omap_dsihw_remove(struct platform_device *dsidev)
 {
struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
 
@@ -4636,11 +4631,11 @@ static const struct dev_pm_ops dsi_pm_ops = {
.runtime_resume = 

[PATCH 2/4] OMAP4: TWL: Add common omapdss supplies

2011-08-22 Thread Tomi Valkeinen
OMAP DSS normally gets power from VCXIO on OMAP4. Add configuration for
this into twl-common.c

Mark VCXIO as always_on, as VCXIO is used by multiple components,
including the MPU, and turning it off when DSS doesn't need it would
lead the device to halt.

Signed-off-by: Tomi Valkeinen tomi.valkei...@ti.com
---
 arch/arm/mach-omap2/twl-common.c |9 +
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c
index 4f6d216..52243577 100644
--- a/arch/arm/mach-omap2/twl-common.c
+++ b/arch/arm/mach-omap2/twl-common.c
@@ -235,6 +235,12 @@ static struct regulator_init_data omap4_vana_idata = {
},
 };
 
+static struct regulator_consumer_supply omap4_vcxio_supply[] = {
+   REGULATOR_SUPPLY(vdds_dsi, omapdss_dss),
+   REGULATOR_SUPPLY(vdds_dsi, omapdss_dsi.0),
+   REGULATOR_SUPPLY(vdds_dsi, omapdss_dsi.1),
+};
+
 static struct regulator_init_data omap4_vcxio_idata = {
.constraints = {
.min_uV = 180,
@@ -243,7 +249,10 @@ static struct regulator_init_data omap4_vcxio_idata = {
| REGULATOR_MODE_STANDBY,
.valid_ops_mask = REGULATOR_CHANGE_MODE
| REGULATOR_CHANGE_STATUS,
+   .always_on  = true,
},
+   .num_consumer_supplies  = ARRAY_SIZE(omap4_vcxio_supply),
+   .consumer_supplies  = omap4_vcxio_supply,
 };
 
 static struct regulator_init_data omap4_vusb_idata = {
-- 
1.7.4.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/4] OMAP: DSS2: DSI: Improve dsi_mux_pads parameters

2011-08-22 Thread Tomi Valkeinen
dsi_mux_pads() needs to know about the DSI HW module and the DSI lanes
used. Split the function into two, enable and disable, which take
necessary arguments, and add empty implementations for both.

Signed-off-by: Tomi Valkeinen tomi.valkei...@ti.com
---
 arch/arm/mach-omap2/display.c |   14 +
 drivers/video/omap2/dss/dsi.c |   42 ++--
 include/video/omapdss.h   |3 +-
 3 files changed, 47 insertions(+), 12 deletions(-)

diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index 0339605..74f0aff 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -75,6 +75,15 @@ static const struct omap_dss_hwmod_data 
omap4_dss_hwmod_data[] __initdata = {
{ dss_hdmi, omapdss_hdmi, -1 },
 };
 
+static int omap_dsi_enable_pads(int dsi_id, unsigned lane_mask)
+{
+   return 0;
+}
+
+static void omap_dsi_disable_pads(int dsi_id, unsigned lane_mask)
+{
+}
+
 int __init omap_display_init(struct omap_dss_board_info *board_data)
 {
int r = 0;
@@ -97,6 +106,11 @@ int __init omap_display_init(struct omap_dss_board_info 
*board_data)
oh_count = ARRAY_SIZE(omap4_dss_hwmod_data);
}
 
+   if (board_data-dsi_enable_pads == NULL)
+   board_data-dsi_enable_pads = omap_dsi_enable_pads;
+   if (board_data-dsi_disable_pads == NULL)
+   board_data-dsi_disable_pads = omap_dsi_disable_pads;
+
pdata.board_data = board_data;
pdata.board_data-get_context_loss_count =
omap_pm_get_dev_context_loss_count;
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 713e1d9..ae6bf1d 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -274,7 +274,8 @@ struct dsi_data {
struct clk *dss_clk;
struct clk *sys_clk;
 
-   void (*dsi_mux_pads)(bool enable);
+   int (*enable_pads)(int dsi_id, unsigned lane_mask);
+   void (*disable_pads)(int dsi_id, unsigned lane_mask);
 
struct dsi_clock_info current_cinfo;
 
@@ -2355,6 +2356,24 @@ static int dsi_cio_wait_tx_clk_esc_reset(struct 
omap_dss_device *dssdev)
return 0;
 }
 
+static unsigned dsi_get_lane_mask(struct omap_dss_device *dssdev)
+{
+   unsigned lanes = 0;
+
+   if (dssdev-phy.dsi.clk_lane != 0)
+   lanes |= 1  (dssdev-phy.dsi.clk_lane - 1);
+   if (dssdev-phy.dsi.data1_lane != 0)
+   lanes |= 1  (dssdev-phy.dsi.data1_lane - 1);
+   if (dssdev-phy.dsi.data2_lane != 0)
+   lanes |= 1  (dssdev-phy.dsi.data2_lane - 1);
+   if (dssdev-phy.dsi.data3_lane != 0)
+   lanes |= 1  (dssdev-phy.dsi.data3_lane - 1);
+   if (dssdev-phy.dsi.data4_lane != 0)
+   lanes |= 1  (dssdev-phy.dsi.data4_lane - 1);
+
+   return lanes;
+}
+
 static int dsi_cio_init(struct omap_dss_device *dssdev)
 {
struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
@@ -2365,8 +2384,9 @@ static int dsi_cio_init(struct omap_dss_device *dssdev)
 
DSSDBGF();
 
-   if (dsi-dsi_mux_pads)
-   dsi-dsi_mux_pads(true);
+   r = dsi-enable_pads(dsidev-id, dsi_get_lane_mask(dssdev));
+   if (r)
+   return r;
 
dsi_enable_scp_clk(dsidev);
 
@@ -2462,19 +2482,18 @@ err_cio_pwr:
dsi_cio_disable_lane_override(dsidev);
 err_scp_clk_dom:
dsi_disable_scp_clk(dsidev);
-   if (dsi-dsi_mux_pads)
-   dsi-dsi_mux_pads(false);
+   dsi-disable_pads(dsidev-id, dsi_get_lane_mask(dssdev));
return r;
 }
 
-static void dsi_cio_uninit(struct platform_device *dsidev)
+static void dsi_cio_uninit(struct omap_dss_device *dssdev)
 {
+   struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
 
dsi_cio_power(dsidev, DSI_COMPLEXIO_POWER_OFF);
dsi_disable_scp_clk(dsidev);
-   if (dsi-dsi_mux_pads)
-   dsi-dsi_mux_pads(false);
+   dsi-disable_pads(dsidev-id, dsi_get_lane_mask(dssdev));
 }
 
 static void dsi_config_tx_fifo(struct platform_device *dsidev,
@@ -4161,7 +4180,7 @@ static int dsi_display_init_dsi(struct omap_dss_device 
*dssdev)
 
return 0;
 err3:
-   dsi_cio_uninit(dsidev);
+   dsi_cio_uninit(dssdev);
 err2:
dss_select_dispc_clk_source(OMAP_DSS_CLK_SRC_FCK);
dss_select_dsi_clk_source(dsi_module, OMAP_DSS_CLK_SRC_FCK);
@@ -4190,7 +4209,7 @@ static void dsi_display_uninit_dsi(struct omap_dss_device 
*dssdev,
 
dss_select_dispc_clk_source(OMAP_DSS_CLK_SRC_FCK);
dss_select_dsi_clk_source(dsi_module, OMAP_DSS_CLK_SRC_FCK);
-   dsi_cio_uninit(dsidev);
+   dsi_cio_uninit(dssdev);
dsi_pll_uninit(dsidev, disconnect_lanes);
 }
 
@@ -4481,7 +4500,8 @@ static int omap_dsihw_probe(struct platform_device 
*dsidev)
 
dss_plat_data = dsidev-dev.platform_data;
board_info = 

[PATCH 4/4] OMAP: DSS2: Implement dsi_mux_pads for OMAP4

2011-08-22 Thread Tomi Valkeinen
Implement dsi_mux_pads for OMAP4. On enable the function enables the DSI
pins and disables pull down. On disable the function disables the pins
and enables pull down.

It is unclear from the TRM whether the pull down is active if the pins
are disabled, so this implementation may leave the pins floating when
the DSI device is disabled.

Signed-off-by: Tomi Valkeinen tomi.valkei...@ti.com
---
 arch/arm/mach-omap2/display.c |   40 
 1 files changed, 40 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index 74f0aff..93db7c1 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -28,6 +28,8 @@
 #include plat/omap-pm.h
 #include plat/common.h
 
+#include control.h
+
 static struct platform_device omap_display_device = {
.name  = omapdss,
.id= -1,
@@ -75,13 +77,51 @@ static const struct omap_dss_hwmod_data 
omap4_dss_hwmod_data[] __initdata = {
{ dss_hdmi, omapdss_hdmi, -1 },
 };
 
+static int omap4_dsi_mux_pads(int dsi_id, unsigned lanes)
+{
+   u32 enable_mask, enable_shift;
+   u32 pipd_mask, pipd_shift;
+   u32 reg;
+
+   if (dsi_id == 0) {
+   enable_mask = OMAP4_DSI1_LANEENABLE_MASK;
+   enable_shift = OMAP4_DSI1_LANEENABLE_SHIFT;
+   pipd_mask = OMAP4_DSI1_PIPD_MASK;
+   pipd_shift = OMAP4_DSI1_PIPD_SHIFT;
+   } else if (dsi_id == 1) {
+   enable_mask = OMAP4_DSI2_LANEENABLE_MASK;
+   enable_shift = OMAP4_DSI2_LANEENABLE_SHIFT;
+   pipd_mask = OMAP4_DSI2_PIPD_MASK;
+   pipd_shift = OMAP4_DSI2_PIPD_SHIFT;
+   } else {
+   return -ENODEV;
+   }
+
+   reg = omap4_ctrl_pad_readl(OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_DSIPHY);
+
+   reg = ~enable_mask;
+   reg = ~pipd_mask;
+
+   reg |= (lanes  enable_shift)  enable_mask;
+   reg |= (lanes  pipd_shift)  pipd_mask;
+
+   omap4_ctrl_pad_writel(reg, OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_DSIPHY);
+
+   return 0;
+}
+
 static int omap_dsi_enable_pads(int dsi_id, unsigned lane_mask)
 {
+   if (cpu_is_omap44xx())
+   return omap4_dsi_mux_pads(dsi_id, lane_mask);
+
return 0;
 }
 
 static void omap_dsi_disable_pads(int dsi_id, unsigned lane_mask)
 {
+   if (cpu_is_omap44xx())
+   omap4_dsi_mux_pads(dsi_id, 0);
 }
 
 int __init omap_display_init(struct omap_dss_board_info *board_data)
-- 
1.7.4.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/4] OMAPDSS: misc minor fixes

2011-08-22 Thread Tomi Valkeinen
Some minor fixes for DSS. 

 Tomi

Tomi Valkeinen (4):
  OMAP: OMAPFB: make omapfb start even when a display is missing a
driver
  OMAP: DSS2: fix clock sources on error and uninit
  OMAP: DSS2: Handle manager change in apply
  OMAP: DSS2: Remove EXPERIMENTAL from Kconfig

 drivers/video/omap2/dss/Kconfig  |2 +-
 drivers/video/omap2/dss/dispc.c  |4 +++-
 drivers/video/omap2/dss/dpi.c|4 +++-
 drivers/video/omap2/dss/dsi.c|3 +++
 drivers/video/omap2/dss/dss.h|2 --
 drivers/video/omap2/dss/manager.c|5 +
 drivers/video/omap2/dss/overlay.c|9 ++---
 drivers/video/omap2/omapfb/Kconfig   |2 +-
 drivers/video/omap2/omapfb/omapfb-main.c |5 +++--
 include/video/omapdss.h  |1 +
 10 files changed, 22 insertions(+), 15 deletions(-)

-- 
1.7.4.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/4] OMAP: DSS2: fix clock sources on error and uninit

2011-08-22 Thread Tomi Valkeinen
DPI and DSI were not cleaning up the clock source in error or uninit
cases. Set the clock source back to PRCM.

Signed-off-by: Tomi Valkeinen tomi.valkei...@ti.com
---
 drivers/video/omap2/dss/dpi.c |4 +++-
 drivers/video/omap2/dss/dsi.c |3 +++
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c
index 046ce08..dc698bd 100644
--- a/drivers/video/omap2/dss/dpi.c
+++ b/drivers/video/omap2/dss/dpi.c
@@ -83,8 +83,10 @@ static int dpi_set_dsi_clk(struct omap_dss_device *dssdev, 
bool is_tft,
dss_select_dispc_clk_source(dssdev-clocks.dispc.dispc_fclk_src);
 
r = dispc_set_clock_div(dssdev-manager-id, dispc_cinfo);
-   if (r)
+   if (r) {
+   dss_select_dispc_clk_source(OMAP_DSS_CLK_SRC_FCK);
return r;
+   }
 
*fck = dsi_cinfo.dsi_pll_hsdiv_dispc_clk;
*lck_div = dispc_cinfo.lck_div;
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index ae6bf1d..c951a75 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -4184,6 +4184,8 @@ err3:
 err2:
dss_select_dispc_clk_source(OMAP_DSS_CLK_SRC_FCK);
dss_select_dsi_clk_source(dsi_module, OMAP_DSS_CLK_SRC_FCK);
+   dss_select_lcd_clk_source(dssdev-manager-id, OMAP_DSS_CLK_SRC_FCK);
+
 err1:
dsi_pll_uninit(dsidev, true);
 err0:
@@ -4209,6 +4211,7 @@ static void dsi_display_uninit_dsi(struct omap_dss_device 
*dssdev,
 
dss_select_dispc_clk_source(OMAP_DSS_CLK_SRC_FCK);
dss_select_dsi_clk_source(dsi_module, OMAP_DSS_CLK_SRC_FCK);
+   dss_select_lcd_clk_source(dssdev-manager-id, OMAP_DSS_CLK_SRC_FCK);
dsi_cio_uninit(dssdev);
dsi_pll_uninit(dsidev, disconnect_lanes);
 }
-- 
1.7.4.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/4] OMAP: OMAPFB: make omapfb start even when a display is missing a driver

2011-08-22 Thread Tomi Valkeinen
Currently omapfb wants that all the display devices have a driver,
otherwise omapfb refuses to start. There's no real requirement to act
like that, and this patch will make omapfb give a warning and skip that
device.

Signed-off-by: Tomi Valkeinen tomi.valkei...@ti.com
---
 drivers/video/omap2/omapfb/omapfb-main.c |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/video/omap2/omapfb/omapfb-main.c 
b/drivers/video/omap2/omapfb/omapfb-main.c
index e5a64b3..cd2cae8e 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -2373,9 +2373,10 @@ static int omapfb_probe(struct platform_device *pdev)
omap_dss_get_device(dssdev);
 
if (!dssdev-driver) {
-   dev_err(pdev-dev, no driver for display: %s\n,
+   dev_warn(pdev-dev, no driver for display: %s\n,
dssdev-name);
-   r = -ENODEV;
+   omap_dss_put_device(dssdev);
+   continue;
}
 
d = fbdev-displays[fbdev-num_displays++];
-- 
1.7.4.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/4] OMAP: DSS2: Handle manager change in apply

2011-08-22 Thread Tomi Valkeinen
Currently when changing the manager of an overlay, set_manager() directly
calls dispc to set the overlay's destination.

Change this to be more in line with other overlay configurations, and
this will also remove the need to have dispc clocks enabled when calling
set_manager().

A new field is added to overlay struct, manager_changed. This is
similar to display_changed field in manager struct, and is used to
inform apply that the manager has changed and thus write to the
registers is needed.

Signed-off-by: Tomi Valkeinen tomi.valkei...@ti.com
---
 drivers/video/omap2/dss/dispc.c   |4 +++-
 drivers/video/omap2/dss/dss.h |2 --
 drivers/video/omap2/dss/manager.c |5 +
 drivers/video/omap2/dss/overlay.c |9 ++---
 include/video/omapdss.h   |1 +
 5 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 9d9fbeb..003227c 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -841,7 +841,7 @@ static void _dispc_set_color_mode(enum omap_plane plane,
REG_FLD_MOD(DISPC_OVL_ATTRIBUTES(plane), m, 4, 1);
 }
 
-void dispc_set_channel_out(enum omap_plane plane,
+static void dispc_set_channel_out(enum omap_plane plane,
enum omap_channel channel)
 {
int shift;
@@ -1860,6 +1860,8 @@ int dispc_setup_plane(enum omap_plane plane,
_dispc_set_pre_mult_alpha(plane, pre_mult_alpha);
_dispc_setup_global_alpha(plane, global_alpha);
 
+   dispc_set_channel_out(plane, channel);
+
return 0;
 }
 
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index adeff04..ff7ac35 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -399,8 +399,6 @@ void dispc_set_plane_ba0(enum omap_plane plane, u32 paddr);
 void dispc_set_plane_ba1(enum omap_plane plane, u32 paddr);
 void dispc_set_plane_pos(enum omap_plane plane, u16 x, u16 y);
 void dispc_set_plane_size(enum omap_plane plane, u16 width, u16 height);
-void dispc_set_channel_out(enum omap_plane plane,
-   enum omap_channel channel_out);
 
 void dispc_enable_gamma_table(bool enable);
 int dispc_setup_plane(enum omap_plane plane,
diff --git a/drivers/video/omap2/dss/manager.c 
b/drivers/video/omap2/dss/manager.c
index 63674b0..a6a909a 100644
--- a/drivers/video/omap2/dss/manager.c
+++ b/drivers/video/omap2/dss/manager.c
@@ -1338,6 +1338,11 @@ static int omap_dss_mgr_apply(struct 
omap_overlay_manager *mgr)
 
oc = dss_cache.overlay_cache[ovl-id];
 
+   if (ovl-manager_changed) {
+   ovl-manager_changed = false;
+   ovl-info_dirty  = true;
+   }
+
if (!overlay_enabled(ovl)) {
if (oc-enabled) {
oc-enabled = false;
diff --git a/drivers/video/omap2/dss/overlay.c 
b/drivers/video/omap2/dss/overlay.c
index c84380c..ab44403 100644
--- a/drivers/video/omap2/dss/overlay.c
+++ b/drivers/video/omap2/dss/overlay.c
@@ -516,6 +516,7 @@ static int omap_dss_set_manager(struct omap_overlay *ovl,
}
 
ovl-manager = mgr;
+   ovl-manager_changed = true;
 
/* XXX: When there is an overlay on a DSI manual update display, and
 * the overlay is first disabled, then moved to tv, and enabled, we
@@ -529,15 +530,12 @@ static int omap_dss_set_manager(struct omap_overlay *ovl,
 * Userspace workaround for this is to update the LCD after disabling
 * the overlay, but before moving the overlay to TV.
 */
-   dispc_set_channel_out(ovl-id, mgr-id);
 
return 0;
 }
 
 static int omap_dss_unset_manager(struct omap_overlay *ovl)
 {
-   int r;
-
if (!ovl-manager) {
DSSERR(failed to detach overlay: manager not set\n);
return -EINVAL;
@@ -548,11 +546,8 @@ static int omap_dss_unset_manager(struct omap_overlay *ovl)
return -EINVAL;
}
 
-   r = ovl-wait_for_go(ovl);
-   if (r)
-   return r;
-
ovl-manager = NULL;
+   ovl-manager_changed = true;
 
return 0;
 }
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index 9301805..b965f5a 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -326,6 +326,7 @@ struct omap_overlay {
struct omap_overlay_manager *manager;
struct omap_overlay_info info;
 
+   bool manager_changed;
/* if true, info has been changed, but not applied() yet */
bool info_dirty;
 
-- 
1.7.4.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/3] trace points: power: remove 'cpu_id' from trace_cpu_idle

2011-08-22 Thread Thomas Renninger
On Saturday, August 20, 2011 04:40:09 AM Ming Lei wrote:
 Hi,
 
 2011/8/20 Thomas Renninger tr...@suse.de:
  On Friday, August 19, 2011 05:04:04 PM tom.leim...@gmail.com wrote:
  From: Ming Lei tom.leim...@gmail.com
 
  This patch removes the 'cpu_id' parameter of the cpu_idle
  trace point, based on the ideas below:
 
  - the cpu_id which is passed to trace point is always the current
cpu
  Are you sure this will always be true?
 
 It is sure at least now,  the only place to pass 'dev-cpu' is inside
 cpuidle_idle_call,
It was known that cpu_id is always the current cpu with current 
implementation when this got introduced.
But the perf events API must not change back and forth for userspace 
compatibility. Therefore the cpu_id was added in case
that future implementations want to pass info where the current cpu
is not the cpu which is sent to the sleep state.

 smp_processor_id() can't be used safely in preemptible context.
I expect the only side effect that could happen is that if smp_process_id
is interrupted you get the wrong core id on a cpu idle trace event.
This only happens if cpuidle is not used and even then should happen
very rarely, nothing to worry for a debug tool like that.
And it should get fixed if these idle functions get fully integrated into
cpuidle at some point of time.

   Thomas
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[PATCH 00/10] OMAPDSS: code cleanups

2011-08-22 Thread Tomi Valkeinen
Cleanups for DSS driver, no functionality changed.

 Tomi

Tomi Valkeinen (10):
  OMAP: DSS2: Remove support for non-DISPC overlays
  OMAP: DSS2: DISPC: use lookup tables for bit shifts
  OMAP: DSS2: Add overlay caps to DSS features
  OMAP: DSS2: Add GLOBAL_ALPHA  PRE_MULT_ALPHA to ovl caps
  OMAP: DSS2: string parsing cleanups
  OMAP: OMAPFB: string parsing cleanups
  OMAP: DSS2: DISPC: remove non-existing func prototypes
  OMAP: DSS2: DISPC: rename overlay related funcs
  OMAP: DSS2: DISPC: rename manager related funcs
  OMAP: DSS2: reorganize functions in dss.h

 drivers/video/omap2/dss/dispc.c   |  478 +++--
 drivers/video/omap2/dss/display.c |   21 +-
 drivers/video/omap2/dss/dpi.c |   16 +-
 drivers/video/omap2/dss/dsi.c |  205 ++---
 drivers/video/omap2/dss/dss.h |   93 +++---
 drivers/video/omap2/dss/dss_features.c|   68 -
 drivers/video/omap2/dss/dss_features.h|3 +-
 drivers/video/omap2/dss/hdmi.c|6 +-
 drivers/video/omap2/dss/manager.c |  126 +++-
 drivers/video/omap2/dss/overlay.c |   38 +--
 drivers/video/omap2/dss/rfbi.c|   33 +--
 drivers/video/omap2/dss/sdi.c |   12 +-
 drivers/video/omap2/omapfb/omapfb-sysfs.c |6 +-
 include/video/omapdss.h   |9 +-
 14 files changed, 396 insertions(+), 718 deletions(-)

-- 
1.7.4.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/4] OMAP: DSS2: Remove EXPERIMENTAL from Kconfig

2011-08-22 Thread Tomi Valkeinen
DSS driver has not been experimental for many years now, so perhaps
it's time to remove the text from Kconfig titles.

Signed-off-by: Tomi Valkeinen tomi.valkei...@ti.com
---
 drivers/video/omap2/dss/Kconfig|2 +-
 drivers/video/omap2/omapfb/Kconfig |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/omap2/dss/Kconfig b/drivers/video/omap2/dss/Kconfig
index 0d12524..7be7c06 100644
--- a/drivers/video/omap2/dss/Kconfig
+++ b/drivers/video/omap2/dss/Kconfig
@@ -1,5 +1,5 @@
 menuconfig OMAP2_DSS
-tristate OMAP2+ Display Subsystem support (EXPERIMENTAL)
+tristate OMAP2+ Display Subsystem support
 depends on ARCH_OMAP2PLUS
 help
  OMAP2+ Display Subsystem support.
diff --git a/drivers/video/omap2/omapfb/Kconfig 
b/drivers/video/omap2/omapfb/Kconfig
index aa33386..83d3fe7 100644
--- a/drivers/video/omap2/omapfb/Kconfig
+++ b/drivers/video/omap2/omapfb/Kconfig
@@ -1,5 +1,5 @@
 menuconfig FB_OMAP2
-tristate OMAP2+ frame buffer support (EXPERIMENTAL)
+tristate OMAP2+ frame buffer support
 depends on FB  OMAP2_DSS
 
select OMAP2_VRAM
-- 
1.7.4.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 01/10] OMAP: DSS2: Remove support for non-DISPC overlays

2011-08-22 Thread Tomi Valkeinen
Remove support for non-DISPC overlays and overlay managers.

The support to possibly have non-DISPC overlays and managers was made to
make it possible to use CPU and/or sDMA to update RFBI or DSI command
mode displays. It is ok to remove the support, because:

- No one has used the feature.
- Display update without DISPC is very slow, so it is debatable if the
  update would even be usable.
- Removal cleans up code.
- If such a feature is needed later, it is better implemented outside
  omapdss driver.

Signed-off-by: Tomi Valkeinen tomi.valkei...@ti.com
Acked-by: Archit Taneja arc...@ti.com
---
 drivers/video/omap2/dss/dispc.c   |   22 +
 drivers/video/omap2/dss/dsi.c |  190 ++--
 drivers/video/omap2/dss/manager.c |   47 +-
 drivers/video/omap2/dss/overlay.c |8 +-
 drivers/video/omap2/dss/rfbi.c|   23 +
 include/video/omapdss.h   |7 +-
 6 files changed, 22 insertions(+), 275 deletions(-)

diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 9d9fbeb..7c76370 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -3056,9 +3056,6 @@ static void dispc_error_worker(struct work_struct *work)
struct omap_overlay *ovl;
ovl = omap_dss_get_overlay(i);
 
-   if (!(ovl-caps  OMAP_DSS_OVL_CAP_DISPC))
-   continue;
-
if (ovl-id == 0) {
dispc_enable_plane(ovl-id, 0);
dispc_go(ovl-manager-id);
@@ -3074,9 +3071,6 @@ static void dispc_error_worker(struct work_struct *work)
struct omap_overlay *ovl;
ovl = omap_dss_get_overlay(i);
 
-   if (!(ovl-caps  OMAP_DSS_OVL_CAP_DISPC))
-   continue;
-
if (ovl-id == 1) {
dispc_enable_plane(ovl-id, 0);
dispc_go(ovl-manager-id);
@@ -3092,9 +3086,6 @@ static void dispc_error_worker(struct work_struct *work)
struct omap_overlay *ovl;
ovl = omap_dss_get_overlay(i);
 
-   if (!(ovl-caps  OMAP_DSS_OVL_CAP_DISPC))
-   continue;
-
if (ovl-id == 2) {
dispc_enable_plane(ovl-id, 0);
dispc_go(ovl-manager-id);
@@ -3129,9 +3120,6 @@ static void dispc_error_worker(struct work_struct *work)
struct omap_overlay *ovl;
ovl = omap_dss_get_overlay(i);
 
-   if (!(ovl-caps  OMAP_DSS_OVL_CAP_DISPC))
-   continue;
-
if (ovl-id != 0  ovl-manager == manager)
dispc_enable_plane(ovl-id, 0);
}
@@ -3168,9 +3156,6 @@ static void dispc_error_worker(struct work_struct *work)
struct omap_overlay *ovl;
ovl = omap_dss_get_overlay(i);
 
-   if (!(ovl-caps  OMAP_DSS_OVL_CAP_DISPC))
-   continue;
-
if (ovl-id != 0  ovl-manager == manager)
dispc_enable_plane(ovl-id, 0);
}
@@ -3207,9 +3192,6 @@ static void dispc_error_worker(struct work_struct *work)
struct omap_overlay *ovl;
ovl = omap_dss_get_overlay(i);
 
-   if (!(ovl-caps  OMAP_DSS_OVL_CAP_DISPC))
-   continue;
-
if (ovl-id != 0  ovl-manager == manager)
dispc_enable_plane(ovl-id, 0);
}
@@ -3226,9 +3208,7 @@ static void dispc_error_worker(struct work_struct *work)
for (i = 0; i  omap_dss_get_num_overlay_managers(); ++i) {
struct omap_overlay_manager *mgr;
mgr = omap_dss_get_overlay_manager(i);
-
-   if (mgr-caps  OMAP_DSS_OVL_CAP_DISPC)
-   mgr-device-driver-disable(mgr-device);
+   mgr-device-driver-disable(mgr-device);
}
}
 
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index c951a75..bd0ff1d 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -3648,161 +3648,6 @@ static void dsi_proto_timings(struct omap_dss_device 
*dssdev)
enter_hs_mode_lat, exit_hs_mode_lat);
 }
 
-
-#define DSI_DECL_VARS \
-   int __dsi_cb = 0; u32 __dsi_cv = 0;
-
-#define DSI_FLUSH(dsidev, ch) \
-   if (__dsi_cb  0) { \
- 

[PATCH 02/10] OMAP: DSS2: DISPC: use lookup tables for bit shifts

2011-08-22 Thread Tomi Valkeinen
Use lookup tables instead of switch/if in some DISPC functions to make
the code cleaner.

Signed-off-by: Tomi Valkeinen tomi.valkei...@ti.com
Acked-by: Archit Taneja arc...@ti.com
---
 drivers/video/omap2/dss/dispc.c |  204 ++-
 1 files changed, 50 insertions(+), 154 deletions(-)

diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 7c76370..f7451fe 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -737,6 +737,9 @@ static void _dispc_set_pre_mult_alpha(enum omap_plane 
plane, bool enable)
 
 static void _dispc_setup_global_alpha(enum omap_plane plane, u8 global_alpha)
 {
+   static const unsigned shifts[] = { 0, 8, 16, };
+   int shift;
+
if (!dss_has_feature(FEAT_GLOBAL_ALPHA))
return;
 
@@ -744,10 +747,8 @@ static void _dispc_setup_global_alpha(enum omap_plane 
plane, u8 global_alpha)
plane == OMAP_DSS_VIDEO1)
return;
 
-   if (plane == OMAP_DSS_GFX)
-   REG_FLD_MOD(DISPC_GLOBAL_ALPHA, global_alpha, 7, 0);
-   else if (plane == OMAP_DSS_VIDEO2)
-   REG_FLD_MOD(DISPC_GLOBAL_ALPHA, global_alpha, 23, 16);
+   shift = shifts[plane];
+   REG_FLD_MOD(DISPC_GLOBAL_ALPHA, global_alpha, shift + 7, shift);
 }
 
 static void _dispc_set_pix_inc(enum omap_plane plane, s32 inc)
@@ -891,21 +892,10 @@ void dispc_set_channel_out(enum omap_plane plane,
 static void dispc_set_burst_size(enum omap_plane plane,
enum omap_burst_size burst_size)
 {
+   static const unsigned shifts[] = { 6, 14, 14, };
int shift;
 
-   switch (plane) {
-   case OMAP_DSS_GFX:
-   shift = 6;
-   break;
-   case OMAP_DSS_VIDEO1:
-   case OMAP_DSS_VIDEO2:
-   shift = 14;
-   break;
-   default:
-   BUG();
-   return;
-   }
-
+   shift = shifts[plane];
REG_FLD_MOD(DISPC_OVL_ATTRIBUTES(plane), burst_size, shift + 1, shift);
 }
 
@@ -987,14 +977,11 @@ static void _dispc_set_vid_color_conv(enum omap_plane 
plane, bool enable)
 
 void dispc_enable_replication(enum omap_plane plane, bool enable)
 {
-   int bit;
-
-   if (plane == OMAP_DSS_GFX)
-   bit = 5;
-   else
-   bit = 10;
+   static const unsigned shifts[] = { 5, 10, 10 };
+   int shift;
 
-   REG_FLD_MOD(DISPC_OVL_ATTRIBUTES(plane), enable, bit, bit);
+   shift = shifts[plane];
+   REG_FLD_MOD(DISPC_OVL_ATTRIBUTES(plane), enable, shift, shift);
 }
 
 void dispc_set_lcd_size(enum omap_channel channel, u16 width, u16 height)
@@ -3042,6 +3029,17 @@ static void dispc_error_worker(struct work_struct *work)
int i;
u32 errors;
unsigned long flags;
+   static const unsigned fifo_underflow_bits[] = {
+   DISPC_IRQ_GFX_FIFO_UNDERFLOW,
+   DISPC_IRQ_VID1_FIFO_UNDERFLOW,
+   DISPC_IRQ_VID2_FIFO_UNDERFLOW,
+   };
+
+   static const unsigned sync_lost_bits[] = {
+   DISPC_IRQ_SYNC_LOST,
+   DISPC_IRQ_SYNC_LOST_DIGIT,
+   DISPC_IRQ_SYNC_LOST2,
+   };
 
spin_lock_irqsave(dispc.irq_lock, flags);
errors = dispc.error_irqs;
@@ -3050,154 +3048,52 @@ static void dispc_error_worker(struct work_struct 
*work)
 
dispc_runtime_get();
 
-   if (errors  DISPC_IRQ_GFX_FIFO_UNDERFLOW) {
-   DSSERR(GFX_FIFO_UNDERFLOW, disabling GFX\n);
-   for (i = 0; i  omap_dss_get_num_overlays(); ++i) {
-   struct omap_overlay *ovl;
-   ovl = omap_dss_get_overlay(i);
-
-   if (ovl-id == 0) {
-   dispc_enable_plane(ovl-id, 0);
-   dispc_go(ovl-manager-id);
-   mdelay(50);
-   break;
-   }
-   }
-   }
-
-   if (errors  DISPC_IRQ_VID1_FIFO_UNDERFLOW) {
-   DSSERR(VID1_FIFO_UNDERFLOW, disabling VID1\n);
-   for (i = 0; i  omap_dss_get_num_overlays(); ++i) {
-   struct omap_overlay *ovl;
-   ovl = omap_dss_get_overlay(i);
-
-   if (ovl-id == 1) {
-   dispc_enable_plane(ovl-id, 0);
-   dispc_go(ovl-manager-id);
-   mdelay(50);
-   break;
-   }
-   }
-   }
-
-   if (errors  DISPC_IRQ_VID2_FIFO_UNDERFLOW) {
-   DSSERR(VID2_FIFO_UNDERFLOW, disabling VID2\n);
-   for (i = 0; i  omap_dss_get_num_overlays(); ++i) {
-   struct omap_overlay *ovl;
-   ovl = omap_dss_get_overlay(i);
-
-   if (ovl-id == 2) {
-   dispc_enable_plane(ovl-id, 0);
-   

[PATCH 03/10] OMAP: DSS2: Add overlay caps to DSS features

2011-08-22 Thread Tomi Valkeinen
Add support to define overlay capabilities into dss_features. The
features are set to overlay-caps at initialization time.

Signed-off-by: Tomi Valkeinen tomi.valkei...@ti.com
Acked-by: Archit Taneja arc...@ti.com
---
 drivers/video/omap2/dss/dss_features.c |   55 
 drivers/video/omap2/dss/dss_features.h |1 +
 drivers/video/omap2/dss/overlay.c  |4 +--
 3 files changed, 57 insertions(+), 3 deletions(-)

diff --git a/drivers/video/omap2/dss/dss_features.c 
b/drivers/video/omap2/dss/dss_features.c
index b415c4e..6bf508d 100644
--- a/drivers/video/omap2/dss/dss_features.c
+++ b/drivers/video/omap2/dss/dss_features.c
@@ -47,6 +47,7 @@ struct omap_dss_features {
const int num_ovls;
const enum omap_display_type *supported_displays;
const enum omap_color_mode *supported_color_modes;
+   const enum omap_overlay_caps *overlay_caps;
const char * const *clksrc_names;
const struct dss_param_range *dss_params;
 
@@ -211,6 +212,50 @@ static const enum omap_color_mode 
omap4_dss_supported_color_modes[] = {
OMAP_DSS_COLOR_RGBX32,
 };
 
+static const enum omap_overlay_caps omap2_dss_overlay_caps[] = {
+   /* OMAP_DSS_GFX */
+   0,
+
+   /* OMAP_DSS_VIDEO1 */
+   OMAP_DSS_OVL_CAP_SCALE,
+
+   /* OMAP_DSS_VIDEO2 */
+   OMAP_DSS_OVL_CAP_SCALE,
+};
+
+static const enum omap_overlay_caps omap3430_dss_overlay_caps[] = {
+   /* OMAP_DSS_GFX */
+   0,
+
+   /* OMAP_DSS_VIDEO1 */
+   OMAP_DSS_OVL_CAP_SCALE,
+
+   /* OMAP_DSS_VIDEO2 */
+   OMAP_DSS_OVL_CAP_SCALE,
+};
+
+static const enum omap_overlay_caps omap3630_dss_overlay_caps[] = {
+   /* OMAP_DSS_GFX */
+   0,
+
+   /* OMAP_DSS_VIDEO1 */
+   OMAP_DSS_OVL_CAP_SCALE,
+
+   /* OMAP_DSS_VIDEO2 */
+   OMAP_DSS_OVL_CAP_SCALE,
+};
+
+static const enum omap_overlay_caps omap4_dss_overlay_caps[] = {
+   /* OMAP_DSS_GFX */
+   0,
+
+   /* OMAP_DSS_VIDEO1 */
+   OMAP_DSS_OVL_CAP_SCALE,
+
+   /* OMAP_DSS_VIDEO2 */
+   OMAP_DSS_OVL_CAP_SCALE,
+};
+
 static const char * const omap2_dss_clk_source_names[] = {
[OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC]  = N/A,
[OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DSI]= N/A,
@@ -275,6 +320,7 @@ static const struct omap_dss_features omap2_dss_features = {
.num_ovls = 3,
.supported_displays = omap2_dss_supported_displays,
.supported_color_modes = omap2_dss_supported_color_modes,
+   .overlay_caps = omap2_dss_overlay_caps,
.clksrc_names = omap2_dss_clk_source_names,
.dss_params = omap2_dss_param_range,
.buffer_size_unit = 1,
@@ -299,6 +345,7 @@ static const struct omap_dss_features omap3430_dss_features 
= {
.num_ovls = 3,
.supported_displays = omap3430_dss_supported_displays,
.supported_color_modes = omap3_dss_supported_color_modes,
+   .overlay_caps = omap3430_dss_overlay_caps,
.clksrc_names = omap3_dss_clk_source_names,
.dss_params = omap3_dss_param_range,
.buffer_size_unit = 1,
@@ -322,6 +369,7 @@ static const struct omap_dss_features omap3630_dss_features 
= {
.num_ovls = 3,
.supported_displays = omap3630_dss_supported_displays,
.supported_color_modes = omap3_dss_supported_color_modes,
+   .overlay_caps = omap3630_dss_overlay_caps,
.clksrc_names = omap3_dss_clk_source_names,
.dss_params = omap3_dss_param_range,
.buffer_size_unit = 1,
@@ -346,6 +394,7 @@ static const struct omap_dss_features 
omap4430_es1_0_dss_features  = {
.num_ovls = 3,
.supported_displays = omap4_dss_supported_displays,
.supported_color_modes = omap4_dss_supported_color_modes,
+   .overlay_caps = omap4_dss_overlay_caps,
.clksrc_names = omap4_dss_clk_source_names,
.dss_params = omap4_dss_param_range,
.buffer_size_unit = 16,
@@ -370,6 +419,7 @@ static const struct omap_dss_features omap4_dss_features = {
.num_ovls = 3,
.supported_displays = omap4_dss_supported_displays,
.supported_color_modes = omap4_dss_supported_color_modes,
+   .overlay_caps = omap4_dss_overlay_caps,
.clksrc_names = omap4_dss_clk_source_names,
.dss_params = omap4_dss_param_range,
.buffer_size_unit = 16,
@@ -407,6 +457,11 @@ enum omap_color_mode 
dss_feat_get_supported_color_modes(enum omap_plane plane)
return omap_current_dss_features-supported_color_modes[plane];
 }
 
+enum omap_overlay_caps dss_feat_get_overlay_caps(enum omap_plane plane)
+{
+   return omap_current_dss_features-overlay_caps[plane];
+}
+
 bool dss_feat_color_mode_supported(enum omap_plane plane,
enum omap_color_mode color_mode)
 {
diff --git a/drivers/video/omap2/dss/dss_features.h 
b/drivers/video/omap2/dss/dss_features.h
index b7398cb..fd09196 100644
--- a/drivers/video/omap2/dss/dss_features.h
+++ b/drivers/video/omap2/dss/dss_features.h
@@ -90,6 +90,7 @@ unsigned long 

[PATCH 05/10] OMAP: DSS2: string parsing cleanups

2011-08-22 Thread Tomi Valkeinen
Use strtobool and kstrto* functions when parsing sysfs inputs.

Signed-off-by: Tomi Valkeinen tomi.valkei...@ti.com
---
 drivers/video/omap2/dss/display.c |   21 +
 drivers/video/omap2/dss/manager.c |   37 +++--
 drivers/video/omap2/dss/overlay.c |7 +++
 3 files changed, 31 insertions(+), 34 deletions(-)

diff --git a/drivers/video/omap2/dss/display.c 
b/drivers/video/omap2/dss/display.c
index 94495e4..2c6e2bc 100644
--- a/drivers/video/omap2/dss/display.c
+++ b/drivers/video/omap2/dss/display.c
@@ -45,14 +45,13 @@ static ssize_t display_enabled_store(struct device *dev,
const char *buf, size_t size)
 {
struct omap_dss_device *dssdev = to_dss_device(dev);
-   int r, enabled;
+   int r;
+   bool enabled;
 
-   r = kstrtoint(buf, 0, enabled);
+   r = strtobool(buf, enabled);
if (r)
return r;
 
-   enabled = !!enabled;
-
if (enabled != (dssdev-state != OMAP_DSS_DISPLAY_DISABLED)) {
if (enabled) {
r = dssdev-driver-enable(dssdev);
@@ -79,17 +78,16 @@ static ssize_t display_tear_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t size)
 {
struct omap_dss_device *dssdev = to_dss_device(dev);
-   int te, r;
+   int r;
+   bool te;
 
if (!dssdev-driver-enable_te || !dssdev-driver-get_te)
return -ENOENT;
 
-   r = kstrtoint(buf, 0, te);
+   r = strtobool(buf, te);
if (r)
return r;
 
-   te = !!te;
-
r = dssdev-driver-enable_te(dssdev, te);
if (r)
return r;
@@ -195,17 +193,16 @@ static ssize_t display_mirror_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t size)
 {
struct omap_dss_device *dssdev = to_dss_device(dev);
-   int mirror, r;
+   int r;
+   bool mirror;
 
if (!dssdev-driver-set_mirror || !dssdev-driver-get_mirror)
return -ENOENT;
 
-   r = kstrtoint(buf, 0, mirror);
+   r = strtobool(buf, mirror);
if (r)
return r;
 
-   mirror = !!mirror;
-
r = dssdev-driver-set_mirror(dssdev, mirror);
if (r)
return r;
diff --git a/drivers/video/omap2/dss/manager.c 
b/drivers/video/omap2/dss/manager.c
index b9c4fb0..2e5d728 100644
--- a/drivers/video/omap2/dss/manager.c
+++ b/drivers/video/omap2/dss/manager.c
@@ -106,7 +106,7 @@ put_device:
 static ssize_t manager_default_color_show(struct omap_overlay_manager *mgr,
  char *buf)
 {
-   return snprintf(buf, PAGE_SIZE, %d\n, mgr-info.default_color);
+   return snprintf(buf, PAGE_SIZE, %#x\n, mgr-info.default_color);
 }
 
 static ssize_t manager_default_color_store(struct omap_overlay_manager *mgr,
@@ -116,8 +116,9 @@ static ssize_t manager_default_color_store(struct 
omap_overlay_manager *mgr,
u32 color;
int r;
 
-   if (sscanf(buf, %d, color) != 1)
-   return -EINVAL;
+   r = kstrtouint(buf, 0, color);
+   if (r)
+   return r;
 
mgr-get_manager_info(mgr, info);
 
@@ -184,7 +185,7 @@ static ssize_t manager_trans_key_type_store(struct 
omap_overlay_manager *mgr,
 static ssize_t manager_trans_key_value_show(struct omap_overlay_manager *mgr,
char *buf)
 {
-   return snprintf(buf, PAGE_SIZE, %d\n, mgr-info.trans_key);
+   return snprintf(buf, PAGE_SIZE, %#x\n, mgr-info.trans_key);
 }
 
 static ssize_t manager_trans_key_value_store(struct omap_overlay_manager *mgr,
@@ -194,8 +195,9 @@ static ssize_t manager_trans_key_value_store(struct 
omap_overlay_manager *mgr,
u32 key_value;
int r;
 
-   if (sscanf(buf, %d, key_value) != 1)
-   return -EINVAL;
+   r = kstrtouint(buf, 0, key_value);
+   if (r)
+   return r;
 
mgr-get_manager_info(mgr, info);
 
@@ -222,15 +224,16 @@ static ssize_t manager_trans_key_enabled_store(struct 
omap_overlay_manager *mgr,
   const char *buf, size_t size)
 {
struct omap_overlay_manager_info info;
-   int enable;
+   bool enable;
int r;
 
-   if (sscanf(buf, %d, enable) != 1)
-   return -EINVAL;
+   r = strtobool(buf, enable);
+   if (r)
+   return r;
 
mgr-get_manager_info(mgr, info);
 
-   info.trans_enabled = enable ? true : false;
+   info.trans_enabled = enable;
 
r = mgr-set_manager_info(mgr, info);
if (r)
@@ -254,15 +257,16 @@ static ssize_t manager_alpha_blending_enabled_store(
const char *buf, size_t size)
 {
struct omap_overlay_manager_info info;
-   int enable;
+   bool enable;
int r;
 
-   if (sscanf(buf, %d, enable) != 1)
-   return -EINVAL;
+   r 

[PATCH 04/10] OMAP: DSS2: Add GLOBAL_ALPHA PRE_MULT_ALPHA to ovl caps

2011-08-22 Thread Tomi Valkeinen
Add OMAP_DSS_OVL_CAP_GLOBAL_ALPHA and OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA to
overlay capabilities. Use these instead of FEAT_GLOBAL_ALPHA,
FEAT_GLOBAL_ALPHA_VID1 and FEAT_PRE_MULT_ALPHA in code.

Remove FEAT_GLOBAL_ALPHA_VID1 and FEAT_PRE_MULT_ALPHA which are no
longer used. FEAT_GLOBAL_ALPHA is still used to decide if the HW has
global alpha register.

Signed-off-by: Tomi Valkeinen tomi.valkei...@ti.com
Acked-by: Archit Taneja arc...@ti.com
---
 drivers/video/omap2/dss/dispc.c|   13 -
 drivers/video/omap2/dss/dss_features.c |   27 +++
 drivers/video/omap2/dss/dss_features.h |2 --
 drivers/video/omap2/dss/overlay.c  |   23 ++-
 include/video/omapdss.h|2 ++
 5 files changed, 27 insertions(+), 40 deletions(-)

diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index f7451fe..2cc6237 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -725,11 +725,9 @@ static void _dispc_set_vid_size(enum omap_plane plane, int 
width, int height)
 
 static void _dispc_set_pre_mult_alpha(enum omap_plane plane, bool enable)
 {
-   if (!dss_has_feature(FEAT_PRE_MULT_ALPHA))
-   return;
+   struct omap_overlay *ovl = omap_dss_get_overlay(plane);
 
-   if (!dss_has_feature(FEAT_GLOBAL_ALPHA_VID1) 
-   plane == OMAP_DSS_VIDEO1)
+   if ((ovl-caps  OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA) == 0)
return;
 
REG_FLD_MOD(DISPC_OVL_ATTRIBUTES(plane), enable ? 1 : 0, 28, 28);
@@ -739,12 +737,9 @@ static void _dispc_setup_global_alpha(enum omap_plane 
plane, u8 global_alpha)
 {
static const unsigned shifts[] = { 0, 8, 16, };
int shift;
+   struct omap_overlay *ovl = omap_dss_get_overlay(plane);
 
-   if (!dss_has_feature(FEAT_GLOBAL_ALPHA))
-   return;
-
-   if (!dss_has_feature(FEAT_GLOBAL_ALPHA_VID1) 
-   plane == OMAP_DSS_VIDEO1)
+   if ((ovl-caps  OMAP_DSS_OVL_CAP_GLOBAL_ALPHA) == 0)
return;
 
shift = shifts[plane];
diff --git a/drivers/video/omap2/dss/dss_features.c 
b/drivers/video/omap2/dss/dss_features.c
index 6bf508d..b63c5f8 100644
--- a/drivers/video/omap2/dss/dss_features.c
+++ b/drivers/video/omap2/dss/dss_features.c
@@ -225,35 +225,38 @@ static const enum omap_overlay_caps 
omap2_dss_overlay_caps[] = {
 
 static const enum omap_overlay_caps omap3430_dss_overlay_caps[] = {
/* OMAP_DSS_GFX */
-   0,
+   OMAP_DSS_OVL_CAP_GLOBAL_ALPHA,
 
/* OMAP_DSS_VIDEO1 */
OMAP_DSS_OVL_CAP_SCALE,
 
/* OMAP_DSS_VIDEO2 */
-   OMAP_DSS_OVL_CAP_SCALE,
+   OMAP_DSS_OVL_CAP_SCALE | OMAP_DSS_OVL_CAP_GLOBAL_ALPHA,
 };
 
 static const enum omap_overlay_caps omap3630_dss_overlay_caps[] = {
/* OMAP_DSS_GFX */
-   0,
+   OMAP_DSS_OVL_CAP_GLOBAL_ALPHA | OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA,
 
/* OMAP_DSS_VIDEO1 */
OMAP_DSS_OVL_CAP_SCALE,
 
/* OMAP_DSS_VIDEO2 */
-   OMAP_DSS_OVL_CAP_SCALE,
+   OMAP_DSS_OVL_CAP_SCALE | OMAP_DSS_OVL_CAP_GLOBAL_ALPHA |
+   OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA,
 };
 
 static const enum omap_overlay_caps omap4_dss_overlay_caps[] = {
/* OMAP_DSS_GFX */
-   0,
+   OMAP_DSS_OVL_CAP_GLOBAL_ALPHA | OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA,
 
/* OMAP_DSS_VIDEO1 */
-   OMAP_DSS_OVL_CAP_SCALE,
+   OMAP_DSS_OVL_CAP_SCALE | OMAP_DSS_OVL_CAP_GLOBAL_ALPHA |
+   OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA,
 
/* OMAP_DSS_VIDEO2 */
-   OMAP_DSS_OVL_CAP_SCALE,
+   OMAP_DSS_OVL_CAP_SCALE | OMAP_DSS_OVL_CAP_GLOBAL_ALPHA |
+   OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA,
 };
 
 static const char * const omap2_dss_clk_source_names[] = {
@@ -359,7 +362,7 @@ static const struct omap_dss_features omap3630_dss_features 
= {
.has_feature=
FEAT_GLOBAL_ALPHA | FEAT_LCDENABLEPOL |
FEAT_LCDENABLESIGNAL | FEAT_PCKFREEENABLE |
-   FEAT_PRE_MULT_ALPHA | FEAT_FUNCGATED |
+   FEAT_FUNCGATED |
FEAT_ROWREPEATENABLE | FEAT_LINEBUFFERSPLIT |
FEAT_RESIZECONF | FEAT_DSI_PLL_PWR_BUG |
FEAT_DSI_PLL_FREQSEL | FEAT_CPR | FEAT_PRELOAD |
@@ -383,8 +386,8 @@ static const struct omap_dss_features 
omap4430_es1_0_dss_features  = {
.num_reg_fields = ARRAY_SIZE(omap4_dss_reg_fields),
 
.has_feature=
-   FEAT_GLOBAL_ALPHA | FEAT_PRE_MULT_ALPHA |
-   FEAT_MGR_LCD2 | FEAT_GLOBAL_ALPHA_VID1 |
+   FEAT_GLOBAL_ALPHA |
+   FEAT_MGR_LCD2 |
FEAT_CORE_CLK_DIV | FEAT_LCD_CLK_SRC |
FEAT_DSI_DCS_CMD_CONFIG_VC | FEAT_DSI_VC_OCP_WIDTH |
FEAT_DSI_GNQ | FEAT_HANDLE_UV_SEPARATE | FEAT_ATTR2 |
@@ -407,8 +410,8 @@ static const struct omap_dss_features omap4_dss_features = {
.num_reg_fields = ARRAY_SIZE(omap4_dss_reg_fields),
 
.has_feature   

[PATCH 06/10] OMAP: OMAPFB: string parsing cleanups

2011-08-22 Thread Tomi Valkeinen
Use strtobool instead of kstrtoint when parsing bool from sysfs.

Signed-off-by: Tomi Valkeinen tomi.valkei...@ti.com
---
 drivers/video/omap2/omapfb/omapfb-sysfs.c |6 ++
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/omap2/omapfb/omapfb-sysfs.c 
b/drivers/video/omap2/omapfb/omapfb-sysfs.c
index 153bf1a..1694d51 100644
--- a/drivers/video/omap2/omapfb/omapfb-sysfs.c
+++ b/drivers/video/omap2/omapfb/omapfb-sysfs.c
@@ -104,16 +104,14 @@ static ssize_t store_mirror(struct device *dev,
 {
struct fb_info *fbi = dev_get_drvdata(dev);
struct omapfb_info *ofbi = FB2OFB(fbi);
-   int mirror;
+   bool mirror;
int r;
struct fb_var_screeninfo new_var;
 
-   r = kstrtoint(buf, 0, mirror);
+   r = strtobool(buf, mirror);
if (r)
return r;
 
-   mirror = !!mirror;
-
if (!lock_fb_info(fbi))
return -ENODEV;
 
-- 
1.7.4.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 07/10] OMAP: DSS2: DISPC: remove non-existing func prototypes

2011-08-22 Thread Tomi Valkeinen
The functions do not exist, so remove the prototypes.

Signed-off-by: Tomi Valkeinen tomi.valkei...@ti.com
---
 drivers/video/omap2/dss/dss.h |4 
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index adeff04..c9b50af 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -395,10 +395,6 @@ void dispc_enable_cpr(enum omap_channel channel, bool 
enable);
 void dispc_set_cpr_coef(enum omap_channel channel,
struct omap_dss_cpr_coefs *coefs);
 
-void dispc_set_plane_ba0(enum omap_plane plane, u32 paddr);
-void dispc_set_plane_ba1(enum omap_plane plane, u32 paddr);
-void dispc_set_plane_pos(enum omap_plane plane, u16 x, u16 y);
-void dispc_set_plane_size(enum omap_plane plane, u16 width, u16 height);
 void dispc_set_channel_out(enum omap_plane plane,
enum omap_channel channel_out);
 
-- 
1.7.4.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 08/10] OMAP: DSS2: DISPC: rename overlay related funcs

2011-08-22 Thread Tomi Valkeinen
Rename dispc's overlay related functions as follows:

- Remove prepending underscores, which were originally used to inform
  that the clocks needs to be enabled. This meaning is no longer valid.
- Prepend the functions with dispc_ovl_*
- Remove plane from the name, e.g. dispc_set_plane_ba0 -
  dispc_ovl_set_ba0

The idea is to group overlay related functions so that it can be deduced
from the function name that it writes to overlay spesific registers.

All dispc_ovl_* functions have enum omap_plane as the first parameter.

Signed-off-by: Tomi Valkeinen tomi.valkei...@ti.com
---
 drivers/video/omap2/dss/dispc.c   |  150 +++--
 drivers/video/omap2/dss/dss.h |   14 ++--
 drivers/video/omap2/dss/manager.c |   18 ++--
 drivers/video/omap2/dss/overlay.c |2 +-
 4 files changed, 94 insertions(+), 90 deletions(-)

diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 2cc6237..7ab3d58 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -480,43 +480,44 @@ void dispc_go(enum omap_channel channel)
REG_FLD_MOD(DISPC_CONTROL, 1, bit, bit);
 }
 
-static void _dispc_write_firh_reg(enum omap_plane plane, int reg, u32 value)
+static void dispc_ovl_write_firh_reg(enum omap_plane plane, int reg, u32 value)
 {
dispc_write_reg(DISPC_OVL_FIR_COEF_H(plane, reg), value);
 }
 
-static void _dispc_write_firhv_reg(enum omap_plane plane, int reg, u32 value)
+static void dispc_ovl_write_firhv_reg(enum omap_plane plane, int reg, u32 
value)
 {
dispc_write_reg(DISPC_OVL_FIR_COEF_HV(plane, reg), value);
 }
 
-static void _dispc_write_firv_reg(enum omap_plane plane, int reg, u32 value)
+static void dispc_ovl_write_firv_reg(enum omap_plane plane, int reg, u32 value)
 {
dispc_write_reg(DISPC_OVL_FIR_COEF_V(plane, reg), value);
 }
 
-static void _dispc_write_firh2_reg(enum omap_plane plane, int reg, u32 value)
+static void dispc_ovl_write_firh2_reg(enum omap_plane plane, int reg, u32 
value)
 {
BUG_ON(plane == OMAP_DSS_GFX);
 
dispc_write_reg(DISPC_OVL_FIR_COEF_H2(plane, reg), value);
 }
 
-static void _dispc_write_firhv2_reg(enum omap_plane plane, int reg, u32 value)
+static void dispc_ovl_write_firhv2_reg(enum omap_plane plane, int reg,
+   u32 value)
 {
BUG_ON(plane == OMAP_DSS_GFX);
 
dispc_write_reg(DISPC_OVL_FIR_COEF_HV2(plane, reg), value);
 }
 
-static void _dispc_write_firv2_reg(enum omap_plane plane, int reg, u32 value)
+static void dispc_ovl_write_firv2_reg(enum omap_plane plane, int reg, u32 
value)
 {
BUG_ON(plane == OMAP_DSS_GFX);
 
dispc_write_reg(DISPC_OVL_FIR_COEF_V2(plane, reg), value);
 }
 
-static void _dispc_set_scale_coef(enum omap_plane plane, int hscaleup,
+static void dispc_ovl_set_scale_coef(enum omap_plane plane, int hscaleup,
  int vscaleup, int five_taps,
  enum omap_color_component color_comp)
 {
@@ -617,11 +618,11 @@ static void _dispc_set_scale_coef(enum omap_plane plane, 
int hscaleup,
| FLD_VAL(v_coef[i].vc2, 31, 24);
 
if (color_comp == DISPC_COLOR_COMPONENT_RGB_Y) {
-   _dispc_write_firh_reg(plane, i, h);
-   _dispc_write_firhv_reg(plane, i, hv);
+   dispc_ovl_write_firh_reg(plane, i, h);
+   dispc_ovl_write_firhv_reg(plane, i, hv);
} else {
-   _dispc_write_firh2_reg(plane, i, h);
-   _dispc_write_firhv2_reg(plane, i, hv);
+   dispc_ovl_write_firh2_reg(plane, i, h);
+   dispc_ovl_write_firhv2_reg(plane, i, hv);
}
 
}
@@ -632,9 +633,9 @@ static void _dispc_set_scale_coef(enum omap_plane plane, 
int hscaleup,
v = FLD_VAL(v_coef[i].vc00, 7, 0)
| FLD_VAL(v_coef[i].vc22, 15, 8);
if (color_comp == DISPC_COLOR_COMPONENT_RGB_Y)
-   _dispc_write_firv_reg(plane, i, v);
+   dispc_ovl_write_firv_reg(plane, i, v);
else
-   _dispc_write_firv2_reg(plane, i, v);
+   dispc_ovl_write_firv2_reg(plane, i, v);
}
}
 }
@@ -675,34 +676,34 @@ static void _dispc_setup_color_conv_coef(void)
 }
 
 
-static void _dispc_set_plane_ba0(enum omap_plane plane, u32 paddr)
+static void dispc_ovl_set_ba0(enum omap_plane plane, u32 paddr)
 {
dispc_write_reg(DISPC_OVL_BA0(plane), paddr);
 }
 
-static void _dispc_set_plane_ba1(enum omap_plane plane, u32 paddr)
+static void dispc_ovl_set_ba1(enum omap_plane plane, u32 paddr)
 {
dispc_write_reg(DISPC_OVL_BA1(plane), paddr);
 }
 
-static void _dispc_set_plane_ba0_uv(enum omap_plane plane, u32 paddr)
+static void dispc_ovl_set_ba0_uv(enum 

[PATCH 10/10] OMAP: DSS2: reorganize functions in dss.h

2011-08-22 Thread Tomi Valkeinen
Group dispc's overlay and manager related functions.

Signed-off-by: Tomi Valkeinen tomi.valkei...@ti.com
---
 drivers/video/omap2/dss/dss.h |   47 +++-
 1 files changed, 22 insertions(+), 25 deletions(-)

diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index 0e95418..3de71c0 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -383,22 +383,24 @@ void dispc_disable_sidle(void);
 void dispc_lcd_enable_signal_polarity(bool act_high);
 void dispc_lcd_enable_signal(bool enable);
 void dispc_pck_free_enable(bool enable);
-void dispc_mgr_enable_fifohandcheck(enum omap_channel channel, bool enable);
-
-void dispc_mgr_set_lcd_size(enum omap_channel channel, u16 width, u16 height);
 void dispc_set_digit_size(u16 width, u16 height);
+void dispc_enable_fifomerge(bool enable);
+void dispc_enable_gamma_table(bool enable);
+void dispc_set_loadmode(enum omap_dss_load_mode mode);
+
+bool dispc_lcd_timings_ok(struct omap_video_timings *timings);
+unsigned long dispc_fclk_rate(void);
+void dispc_find_clk_divs(bool is_tft, unsigned long req_pck, unsigned long fck,
+   struct dispc_clock_info *cinfo);
+int dispc_calc_clock_rates(unsigned long dispc_fclk_rate,
+   struct dispc_clock_info *cinfo);
+
+
 u32 dispc_ovl_get_fifo_size(enum omap_plane plane);
 void dispc_ovl_set_fifo_threshold(enum omap_plane plane, u32 low, u32 high);
-void dispc_enable_fifomerge(bool enable);
 u32 dispc_ovl_get_burst_size(enum omap_plane plane);
-void dispc_mgr_enable_cpr(enum omap_channel channel, bool enable);
-void dispc_mgr_set_cpr_coef(enum omap_channel channel,
-   struct omap_dss_cpr_coefs *coefs);
-
 void dispc_ovl_set_channel_out(enum omap_plane plane,
enum omap_channel channel_out);
-
-void dispc_enable_gamma_table(bool enable);
 int dispc_ovl_setup(enum omap_plane plane,
  u32 paddr, u16 screen_width,
  u16 pos_x, u16 pos_y,
@@ -411,21 +413,24 @@ int dispc_ovl_setup(enum omap_plane plane,
  u8 global_alpha, u8 pre_mult_alpha,
  enum omap_channel channel,
  u32 puv_addr);
+int dispc_ovl_enable(enum omap_plane plane, bool enable);
+void dispc_ovl_enable_replication(enum omap_plane plane, bool enable);
 
+
+void dispc_mgr_enable_fifohandcheck(enum omap_channel channel, bool enable);
+void dispc_mgr_set_lcd_size(enum omap_channel channel, u16 width, u16 height);
+void dispc_mgr_enable_cpr(enum omap_channel channel, bool enable);
+void dispc_mgr_set_cpr_coef(enum omap_channel channel,
+   struct omap_dss_cpr_coefs *coefs);
 bool dispc_mgr_go_busy(enum omap_channel channel);
 void dispc_mgr_go(enum omap_channel channel);
 void dispc_mgr_enable(enum omap_channel channel, bool enable);
 bool dispc_mgr_is_channel_enabled(enum omap_channel channel);
-int dispc_ovl_enable(enum omap_plane plane, bool enable);
-void dispc_ovl_enable_replication(enum omap_plane plane, bool enable);
-
 void dispc_mgr_set_parallel_interface_mode(enum omap_channel channel,
enum omap_parallel_interface_mode mode);
 void dispc_mgr_set_tft_data_lines(enum omap_channel channel, u8 data_lines);
 void dispc_mgr_set_lcd_display_type(enum omap_channel channel,
enum omap_lcd_display_type type);
-void dispc_set_loadmode(enum omap_dss_load_mode mode);
-
 void dispc_mgr_set_default_color(enum omap_channel channel, u32 color);
 u32 dispc_mgr_get_default_color(enum omap_channel channel);
 void dispc_mgr_set_trans_key(enum omap_channel ch,
@@ -438,25 +443,17 @@ void dispc_mgr_enable_trans_key(enum omap_channel ch, 
bool enable);
 void dispc_mgr_enable_alpha_blending(enum omap_channel ch, bool enable);
 bool dispc_mgr_trans_key_enabled(enum omap_channel ch);
 bool dispc_mgr_alpha_blending_enabled(enum omap_channel ch);
-
-bool dispc_lcd_timings_ok(struct omap_video_timings *timings);
 void dispc_mgr_set_lcd_timings(enum omap_channel channel,
struct omap_video_timings *timings);
-unsigned long dispc_fclk_rate(void);
-unsigned long dispc_mgr_lclk_rate(enum omap_channel channel);
-unsigned long dispc_mgr_pclk_rate(enum omap_channel channel);
 void dispc_mgr_set_pol_freq(enum omap_channel channel,
enum omap_panel_config config, u8 acbi, u8 acb);
-void dispc_find_clk_divs(bool is_tft, unsigned long req_pck, unsigned long fck,
-   struct dispc_clock_info *cinfo);
-int dispc_calc_clock_rates(unsigned long dispc_fclk_rate,
-   struct dispc_clock_info *cinfo);
+unsigned long dispc_mgr_lclk_rate(enum omap_channel channel);
+unsigned long dispc_mgr_pclk_rate(enum omap_channel channel);
 int dispc_mgr_set_clock_div(enum omap_channel channel,
struct dispc_clock_info *cinfo);
 int dispc_mgr_get_clock_div(enum omap_channel channel,
struct dispc_clock_info *cinfo);
 
-
 /* VENC */
 #ifdef CONFIG_OMAP2_DSS_VENC
 int 

[PATCH 09/10] OMAP: DSS2: DISPC: rename manager related funcs

2011-08-22 Thread Tomi Valkeinen
Rename dispc's manager related functions as follows:

- Remove prepending underscores, which were originally used to inform
  that the clocks needs to be enabled. This meaning is no longer valid.
- Prepend the functions with dispc_mgr_*
- Remove channel from the name, e.g. dispc_enable_channel -
  dispc_mgr_enable

The idea is to group manager related functions so that it can be deduced
from the function name that it writes to manager spesific registers.

All dispc_mgr_* functions have enum omap_channel as the first parameter.

Signed-off-by: Tomi Valkeinen tomi.valkei...@ti.com
---
 drivers/video/omap2/dss/dispc.c   |   99 +++--
 drivers/video/omap2/dss/dpi.c |   16 +++---
 drivers/video/omap2/dss/dsi.c |   17 +++---
 drivers/video/omap2/dss/dss.h |   50 +-
 drivers/video/omap2/dss/hdmi.c|6 +-
 drivers/video/omap2/dss/manager.c |   24 +-
 drivers/video/omap2/dss/rfbi.c|   12 ++--
 drivers/video/omap2/dss/sdi.c |   12 ++--
 8 files changed, 119 insertions(+), 117 deletions(-)

diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 7ab3d58..73b1478 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -419,7 +419,7 @@ void dispc_runtime_put(void)
 }
 
 
-bool dispc_go_busy(enum omap_channel channel)
+bool dispc_mgr_go_busy(enum omap_channel channel)
 {
int bit;
 
@@ -435,7 +435,7 @@ bool dispc_go_busy(enum omap_channel channel)
return REG_GET(DISPC_CONTROL, bit, bit) == 1;
 }
 
-void dispc_go(enum omap_channel channel)
+void dispc_mgr_go(enum omap_channel channel)
 {
int bit;
bool enable_bit, go_bit;
@@ -926,7 +926,7 @@ void dispc_enable_gamma_table(bool enable)
REG_FLD_MOD(DISPC_CONFIG, enable, 9, 9);
 }
 
-void dispc_enable_cpr(enum omap_channel channel, bool enable)
+void dispc_mgr_enable_cpr(enum omap_channel channel, bool enable)
 {
u16 reg;
 
@@ -940,7 +940,7 @@ void dispc_enable_cpr(enum omap_channel channel, bool 
enable)
REG_FLD_MOD(reg, enable, 15, 15);
 }
 
-void dispc_set_cpr_coef(enum omap_channel channel,
+void dispc_mgr_set_cpr_coef(enum omap_channel channel,
struct omap_dss_cpr_coefs *coefs)
 {
u32 coef_r, coef_g, coef_b;
@@ -980,7 +980,7 @@ void dispc_ovl_enable_replication(enum omap_plane plane, 
bool enable)
REG_FLD_MOD(DISPC_OVL_ATTRIBUTES(plane), enable, shift, shift);
 }
 
-void dispc_set_lcd_size(enum omap_channel channel, u16 width, u16 height)
+void dispc_mgr_set_lcd_size(enum omap_channel channel, u16 width, u16 height)
 {
u32 val;
BUG_ON((width  (1  11)) || (height  (1  11)));
@@ -1614,7 +1614,7 @@ static unsigned long calc_fclk_five_taps(enum 
omap_channel channel, u16 width,
 {
u32 fclk = 0;
/* FIXME venc pclk? */
-   u64 tmp, pclk = dispc_pclk_rate(channel);
+   u64 tmp, pclk = dispc_mgr_pclk_rate(channel);
 
if (height  out_height) {
/* FIXME get real display PPL */
@@ -1671,7 +1671,7 @@ static unsigned long calc_fclk(enum omap_channel channel, 
u16 width,
vf = 1;
 
/* FIXME venc pclk? */
-   return dispc_pclk_rate(channel) * vf * hf;
+   return dispc_mgr_pclk_rate(channel) * vf * hf;
 }
 
 int dispc_ovl_setup(enum omap_plane plane,
@@ -1872,7 +1872,7 @@ static void _enable_lcd_out(enum omap_channel channel, 
bool enable)
REG_FLD_MOD(DISPC_CONTROL, enable ? 1 : 0, 0, 0);
 }
 
-static void dispc_enable_lcd_out(enum omap_channel channel, bool enable)
+static void dispc_mgr_enable_lcd_out(enum omap_channel channel, bool enable)
 {
struct completion frame_done_completion;
bool is_on;
@@ -1919,7 +1919,7 @@ static void _enable_digit_out(bool enable)
REG_FLD_MOD(DISPC_CONTROL, enable ? 1 : 0, 1, 1);
 }
 
-static void dispc_enable_digit_out(bool enable)
+static void dispc_mgr_enable_digit_out(bool enable)
 {
struct completion frame_done_completion;
int r;
@@ -1979,7 +1979,7 @@ static void dispc_enable_digit_out(bool enable)
}
 }
 
-bool dispc_is_channel_enabled(enum omap_channel channel)
+bool dispc_mgr_is_enabled(enum omap_channel channel)
 {
if (channel == OMAP_DSS_CHANNEL_LCD)
return !!REG_GET(DISPC_CONTROL, 0, 0);
@@ -1991,13 +1991,13 @@ bool dispc_is_channel_enabled(enum omap_channel channel)
BUG();
 }
 
-void dispc_enable_channel(enum omap_channel channel, bool enable)
+void dispc_mgr_enable(enum omap_channel channel, bool enable)
 {
if (channel == OMAP_DSS_CHANNEL_LCD ||
channel == OMAP_DSS_CHANNEL_LCD2)
-   dispc_enable_lcd_out(channel, enable);
+   dispc_mgr_enable_lcd_out(channel, enable);
else if (channel == OMAP_DSS_CHANNEL_DIGIT)
-   dispc_enable_digit_out(enable);
+   dispc_mgr_enable_digit_out(enable);
else
BUG();
 }
@@ 

Re: [PATCH 00/10] OMAPDSS: code cleanups

2011-08-22 Thread Tomi Valkeinen
On Mon, 2011-08-22 at 11:27 +0300, Tomi Valkeinen wrote:
 Cleanups for DSS driver, no functionality changed.
 
  Tomi
 
 Tomi Valkeinen (10):
   OMAP: DSS2: Remove support for non-DISPC overlays
   OMAP: DSS2: DISPC: use lookup tables for bit shifts
   OMAP: DSS2: Add overlay caps to DSS features
   OMAP: DSS2: Add GLOBAL_ALPHA  PRE_MULT_ALPHA to ovl caps
   OMAP: DSS2: string parsing cleanups
   OMAP: OMAPFB: string parsing cleanups
   OMAP: DSS2: DISPC: remove non-existing func prototypes
   OMAP: DSS2: DISPC: rename overlay related funcs
   OMAP: DSS2: DISPC: rename manager related funcs
   OMAP: DSS2: reorganize functions in dss.h

This patch set had some minor conflicts with the patch OMAP: DSS2:
Handle manager change in apply. The dss master branch has all the
patches with conflicts resolved.

 Tomi


--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: when to submit new board support

2011-08-22 Thread Michael Jones
Hi Tony,

Thanks for the reply.

On 08/10/2011 12:33 PM, Tony Lindgren wrote:
 
 * Michael Jones michael.jo...@matrix-vision.de [110810 03:14]:
 I would like to submit some patches to add support for a new OMAP board...

 Is there a right or wrong time to post such patches to this list? How
 does the kernel merge window effect what kind of patches are expected
 here on the OMAP list?
 
 Well this is the right time, however we're moving things to device tree
 and coalescing code. So you may need to be prepared to update the patches
 a few times before we get them to mainline.

Unfortunately I am not ready to pull the trigger on submitting my code
right _now_, so I was hoping to get a better understanding of the
system- when the right time would be AND when the wrong time would be.
I.e. what makes this the right time?

Also, I'm uncertain whether my submission will generally be welcome. Are
there criteria for which boards are desirable to merge upstream? In
April [1] you said in response to the inquiry about submitting support
for the Nook Color that usually supporting a new machine adds a few
tens of lines. My machine is not even on the market yet, and its board
file is currently 384 lines long, which is more than a few tens. I don't
want to submit unwanted bloat.

I'm not familiar yet with Device Tree, so I don't understand what the
implications are for existing supported boards and their board files,
but I would of course be prepared to make necessary changes after review.

-Michael

[1] http://www.mail-archive.com/linux-omap%40vger.kernel.org/msg48348.html

  
 What should I use as the base for my patches? At
 http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git,
 at the moment 'master' hasn't been updated for 4 weeks. Should I base it
 on v3.1-rc1 instead (as an example, since I won't manage to submit it
 while v3.1-rc1 is the most recent tag)?
 
 Yes v3.1-rc1 should be used as the base. I've been on vacation and
 have not updated the omap tree for a while, will updated it soonish,
 but will be just v3.1-rc1 + bug fixes.
 
 Tony


MATRIX VISION GmbH, Talstrasse 16, DE-71570 Oppenweiler
Registergericht: Amtsgericht Stuttgart, HRB 271090
Geschaeftsfuehrer: Gerhard Thullner, Werner Armingeon, Uwe Furtner, Erhard Meier
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC PATCH 6/6 V2] hwmon: OMAP4: On die temperature sensor driver

2011-08-22 Thread Felipe Balbi
Hi,

On Mon, Aug 22, 2011 at 09:59:46AM +0530, J, KEERTHY wrote:
  +static const struct dev_pm_ops omap_temp_sensor_dev_pm_ops = {
  +     .suspend = omap_temp_sensor_suspend,
  +     .resume = omap_temp_sensor_resume,
  +     .runtime_suspend = omap_temp_sensor_runtime_suspend,
  +     .runtime_resume = omap_temp_sensor_runtime_resume,
  +};
 
  this is not enough... you need to populate the other fields. You might
  want to use something like:
 
  static const struct dev_pm_ops omap_temp_sensor_dev_pm_ops = {
         SET_SYSTEM_SLEEP_PM_OPS(omap_temp_sensor_suspend,
                 omap_temp_sensor_resume)
         SET_RUNTIME_PM_OPS(omap_temp_sensor_runtime_suspend,
                 omap_temp_sensor_runtime_resume, omap_temp_sensor_idle)
  };
 
 omap_temp_sensor_idle is undefined for temperature sensor as of now. So i will
 populate these fields once the idle function is defined.

make a nop idle function. Those other fields _must_ be populated. Use
something like:

static int omap_temp_sensor_idle(struct device *dev)
{
/* nothing to do here */
return 0;
}

-- 
balbi


signature.asc
Description: Digital signature


Re: DSS : DSI checksum error

2011-08-22 Thread Sudipta GHOSH
Moi Tomi,

Have you ever encounter this error.

Looking some pointer what can cause checksum error.

Regards,
Sudipta

On 18 August 2011 17:35, Sudipta GHOSH sudipta...@gmail.com wrote:
 Hi,

 Working DSS  Panel driver.

 Sometime I am getting checksum error from DSI when framebuffers are
 sent to panel via DSI.

 omapdss DSI error:       ACK with ERROR (0x400):

 Wanted to know if some one has encounter similar error.

 When / what can cause this error?

 Regards,
 Sudipta

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: DSS : DSI checksum error

2011-08-22 Thread Tomi Valkeinen
Hi,

Most likely it is caused by electrical interference with the transfer.
Or, while very unlikely if it happens only rarely, a HW bug in the panel
(or even in OMAP).

 Tomi

On Mon, 2011-08-22 at 13:05 +0300, Sudipta GHOSH wrote:
 Moi Tomi,
 
 Have you ever encounter this error.
 
 Looking some pointer what can cause checksum error.
 
 Regards,
 Sudipta
 
 On 18 August 2011 17:35, Sudipta GHOSH sudipta...@gmail.com wrote:
  Hi,
 
  Working DSS  Panel driver.
 
  Sometime I am getting checksum error from DSI when framebuffers are
  sent to panel via DSI.
 
  omapdss DSI error:   ACK with ERROR (0x400):
 
  Wanted to know if some one has encounter similar error.
 
  When / what can cause this error?
 
  Regards,
  Sudipta
 


--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 05/10] OMAP: DSS2: string parsing cleanups

2011-08-22 Thread Tomi Valkeinen
On Mon, 2011-08-22 at 11:27 +0300, Tomi Valkeinen wrote:
 Use strtobool and kstrto* functions when parsing sysfs inputs.
 
 Signed-off-by: Tomi Valkeinen tomi.valkei...@ti.com
 ---
  drivers/video/omap2/dss/display.c |   21 +
  drivers/video/omap2/dss/manager.c |   37 
 +++--
  drivers/video/omap2/dss/overlay.c |7 +++
  3 files changed, 31 insertions(+), 34 deletions(-)

snip

 diff --git a/drivers/video/omap2/dss/overlay.c 
 b/drivers/video/omap2/dss/overlay.c
 index a95f25e..b2a5685 100644
 --- a/drivers/video/omap2/dss/overlay.c
 +++ b/drivers/video/omap2/dss/overlay.c
 @@ -211,17 +211,16 @@ static ssize_t overlay_enabled_show(struct omap_overlay 
 *ovl, char *buf)
  static ssize_t overlay_enabled_store(struct omap_overlay *ovl, const char 
 *buf,
   size_t size)
  {
 - int r, enable;
 + int r;
 + bool enable;
   struct omap_overlay_info info;
  
   ovl-get_overlay_info(ovl, info);
  
 - r = kstrtoint(buf, 0, enable);
 + r = strtobool(buf, enable);
   if (r)
   return r;
  
 - info.enabled = !!enable;
 -
   r = ovl-set_overlay_info(ovl, info);
   if (r)
   return r;

Oops. This removes the lines that write the new value to overlay_info,
thus making it impossible to change the enable-status. I'll fix this.

 Tomi


--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 0/4] Fixes to twl4030-madc and add BeagleBoard support

2011-08-22 Thread Samuel Ortiz
Hi Kyle,

On Thu, Aug 11, 2011 at 10:33:11PM -0500, Kyle Manna wrote:
 These patches add basic functionality to the twl4030-madc driver to make
 it work on the BeagleBoard xM.
 
 Version 2 adds fixes per Grazvydas Ignotas and the check for NULL pointer 
 patch.
 
 Kyle Manna (4):
   mfd: twl4030-madc: copy the device pointer
   mfd: twl4030-madc: turn on the MADC clock
   mfd: twl4030-madc: check for NULL pointer
   arm: BeagleBoard: add support for the twl4030-madc
Tony, are you ok with the BeagleBoard changes ?
The MFD ones look fine to me, I'd like to apply them.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/4] drivers/usb/host/ohci-omap3.c: test the just-initialized value

2011-08-22 Thread Julia Lawall
From: Julia Lawall ju...@diku.dk

Test the just-initialized value rather than some other one.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// smpl
@r@
identifier x,y,f!={PTR_ERR,ERR_PTR,ERR_CAST};
statement S;
@@

x = f(...);
(
if (\(x == NULL\|IS_ERR(x)\)) S
|
*if (\(y == NULL\|IS_ERR(y)\))
 { ... when != x
   return ...; }
)
// /smpl

Signed-off-by: Julia Lawall ju...@diku.dk

---
 drivers/usb/host/ohci-omap3.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/ohci-omap3.c b/drivers/usb/host/ohci-omap3.c
index 6048f2f..853ad8d 100644
--- a/drivers/usb/host/ohci-omap3.c
+++ b/drivers/usb/host/ohci-omap3.c
@@ -149,7 +149,7 @@ static int __devinit ohci_hcd_omap3_probe(struct 
platform_device *pdev)
 
res = platform_get_resource_byname(pdev,
IORESOURCE_MEM, ohci);
-   if (!ret) {
+   if (!res) {
dev_err(dev, UHH OHCI get resource failed\n);
return -ENOMEM;
}

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] mfd: omap-usb-host: Make TLL mode work again

2011-08-22 Thread Samuel Ortiz
Hi Anand,

On Thu, Aug 18, 2011 at 04:14:31PM +0530, Anand Gadiyar wrote:
 This code section seems to have been accidentally copy pasted.
 It causes incorrect bits to be set up in the TLL_CHANNEL_CONF
 register and prevents the TLL mode from working correctly.
Patch applied, with Felipe's ACK and sta...@kernel.org Cc'ed.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/7] twl4030: finish threaded IRQ conversion

2011-08-22 Thread Samuel Ortiz
Hi Felipe,

On Fri, Aug 19, 2011 at 12:36:15AM +0300, Felipe Balbi wrote:
 Hi,
 
 On Sat, Jul 09, 2011 at 05:09:00AM +0100, Mark Brown wrote:
  On Thu, Jun 30, 2011 at 12:51:03PM +0300, Felipe Balbi wrote:
  
   the following patches where boot-tested on beagle xM
   and everything seems fine. MMC root filesystem still
   mounts, /proc/interrupts looks like ps aux | grep irq
   shows our threads, etc.
  
  Reviewed-by: Mark Brown broo...@opensource.wolfsonmicro.com
 
 It has been a long time and nobody complained. Samuel, can you take
 these patches in for 3.2 merge window ?
Yes, that sounds like the right time now.
All 7 patches applied, many thanks.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] mfd: omap-usb-host: fix build failure

2011-08-22 Thread Samuel Ortiz
Hi Tom,

On Fri, Aug 19, 2011 at 04:57:54PM +0800, tom.leim...@gmail.com wrote:
 From: Ming Lei tom.leim...@gmail.com
 
 The patch fixes the build failure:
Patch applied, thanks.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/3] OMAP3: Remove auto-selection of PMICs

2011-08-22 Thread Samuel Ortiz
Hi Anhilash,

On Fri, Aug 19, 2011 at 05:19:33PM +0530, Abhilash K V wrote:
 The current implementation almost assumes that only
 TWL4030/TWL5030/TWl6030 are (or can be) used with the
 OMAP processors. This is, however, not true.

I don't like the mfd/Kconfig change. Why would those drivers be only buildable
on OMAP processors ?
Unless there is a real reason for this, you should fix the drivers instead.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/7] OMAP: omap_device cleanup before device-tree integration

2011-08-22 Thread Benoit Cousson
Hi Kevin,

Here are a couple of cleanups on top of your for_3.2/omap_device series
rebased on top of 3.1-rc2 to get your pm-fixes.
The goal is to help building core devices using device-tree by removing
direct reference to the device inside PM.
For that, I took and rebased the two patches done by Nishanth to use hwmod
to identify the device from the generic IP name.
The currently unused omap_device_pm_latency is moved inside the
omap_device core code to avoid the duplication.

patches are available here:
git://gitorious.org/omap-pm/linux.git for_3.2/omap_device_cleanup

It is tested on OMAP4 SDP and Panda only. I don't even have the Beagle
to test the beagle patch :-(

Regards,
Benoit


Benoit Cousson (5):
  OMAP3: beagle-board: Use the omap_hwmod_name_get_dev API
  OMAP2+: pm: Use hwmod name instead of dev pointer
  OMAP2+: pm: Remove static devices variable for mpu, dsp, iva and l3 PM
  OMAP: omap_device: Create a default omap_device_pm_latency
  OMAP2+: devices: Remove all omap_device_pm_latency structures

Nishanth Menon (2):
  OMAP: PM: omap_device: add omap_hwmod_name_get_odev
  OMAP: PM: omap_device: add few quick access functions

 arch/arm/mach-omap2/board-omap3beagle.c   |4 +-
 arch/arm/mach-omap2/devices.c |   46 ++---
 arch/arm/mach-omap2/display.c |   11 +
 arch/arm/mach-omap2/dma.c |   11 +
 arch/arm/mach-omap2/gpio.c|   12 +
 arch/arm/mach-omap2/hsmmc.c   |   18 +--
 arch/arm/mach-omap2/hwspinlock.c  |   12 +
 arch/arm/mach-omap2/mcbsp.c   |   11 +
 arch/arm/mach-omap2/pm.c  |   69 -
 arch/arm/mach-omap2/serial.c  |   25 +-
 arch/arm/mach-omap2/sr_device.c   |   11 +
 arch/arm/mach-omap2/usb-musb.c|   11 +
 arch/arm/plat-omap/i2c.c  |   10 +---
 arch/arm/plat-omap/include/plat/omap_device.h |   16 ++
 arch/arm/plat-omap/omap_device.c  |   49 +-
 15 files changed, 101 insertions(+), 215 deletions(-)

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/7] OMAP: PM: omap_device: add omap_hwmod_name_get_odev

2011-08-22 Thread Benoit Cousson
From: Nishanth Menon n...@ti.com

An API which translates a standard hwmod name to corresponding
omap_device is useful for drivers when they need to look up the
device associated with a hwmod name to map back into the device
structure pointers. These ideally should be used by drivers in
mach directory. Using a generic hwmod name like gpu instead of
the actual device name which could change in the future, allows
us to:
a) Could in effect help replace apis such as omap2_get_mpuss_device,
omap2_get_iva_device, omap2_get_l3_device, omap4_get_dsp_device,
etc..
b) Scale to more devices rather than be restricted to named functions
c) Simplify driver's platform_data from passing additional fields
all doing the same thing with different function pointer names
just for accessing a different device name.

Signed-off-by: Nishanth Menon n...@ti.com
[b-cous...@ti.com: rebased on top of Kevin's changes]
Signed-off-by: Benoit Cousson b-cous...@ti.com
---
 arch/arm/plat-omap/include/plat/omap_device.h |1 +
 arch/arm/plat-omap/omap_device.c  |   32 +
 2 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-omap/include/plat/omap_device.h 
b/arch/arm/plat-omap/include/plat/omap_device.h
index d4d9b96..bdc2804 100644
--- a/arch/arm/plat-omap/include/plat/omap_device.h
+++ b/arch/arm/plat-omap/include/plat/omap_device.h
@@ -101,6 +101,7 @@ struct platform_device *omap_device_build_ss(const char 
*pdev_name, int pdev_id,
 int pm_lats_cnt, int is_early_device);
 
 void __iomem *omap_device_get_rt_va(struct omap_device *od);
+struct omap_device *omap_hwmod_name_get_odev(const char *oh_name);
 
 /* OMAP PM interface */
 int omap_device_align_pm_lat(struct platform_device *pdev,
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
index d8f2299..455594a 100644
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/plat-omap/omap_device.c
@@ -840,6 +840,38 @@ void __iomem *omap_device_get_rt_va(struct omap_device *od)
return omap_hwmod_get_mpu_rt_va(od-hwmods[0]);
 }
 
+/**
+ * omap_hwmod_name_get_odev() - convert a hwmod name to omap_device pointer
+ * @oh_name: name of the hwmod device
+ *
+ * returns back a struct omap_device * pointer associated with a hwmod
+ * device represented by a hwmod_name
+ */
+struct omap_device *omap_hwmod_name_get_odev(const char *oh_name)
+{
+   struct omap_hwmod *oh;
+
+   if (!oh_name) {
+   WARN(1, %s: no hwmod name!\n, __func__);
+   return ERR_PTR(-EINVAL);
+   }
+
+   oh = omap_hwmod_lookup(oh_name);
+   if (IS_ERR_OR_NULL(oh)) {
+   WARN(1, %s: no hwmod for %s\n, __func__,
+   oh_name);
+   return ERR_PTR(oh ? PTR_ERR(oh) : -ENODEV);
+   }
+   if (IS_ERR_OR_NULL(oh-od)) {
+   WARN(1, %s: no omap_device for %s\n, __func__,
+   oh_name);
+   return ERR_PTR(oh-od ? PTR_ERR(oh-od) : -ENODEV);
+   }
+
+   return oh-od;
+}
+EXPORT_SYMBOL(omap_hwmod_name_get_odev);
+
 /*
  * Public functions intended for use in omap_device_pm_latency
  * .activate_func and .deactivate_func function pointers
-- 
1.7.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/7] OMAP2+: pm: Use hwmod name instead of dev pointer

2011-08-22 Thread Benoit Cousson
Replace the struct device parameter of omap2_set_init_voltage
by the hwmod name. It will avoid having to store explicitely
the device pointer into a static variable.
Moreover, it will be a little bit more scalable if we introduce
new DVFS devices.

Signed-off-by: Benoit Cousson b-cous...@ti.com
Cc: Kevin Hilman khil...@ti.com
---
 arch/arm/mach-omap2/pm.c |   22 +++---
 1 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
index 54281e5..17725d2 100644
--- a/arch/arm/mach-omap2/pm.c
+++ b/arch/arm/mach-omap2/pm.c
@@ -171,18 +171,26 @@ err:
  * in the opp entry
  */
 static int __init omap2_set_init_voltage(char *vdd_name, char *clk_name,
-   struct device *dev)
+const char *oh_name)
 {
struct voltagedomain *voltdm;
struct clk *clk;
struct opp *opp;
unsigned long freq, bootup_volt;
+   struct device *dev;
 
-   if (!vdd_name || !clk_name || !dev) {
+   if (!vdd_name || !clk_name || !oh_name) {
printk(KERN_ERR %s: Invalid parameters!\n, __func__);
goto exit;
}
 
+   dev = omap_hwmod_name_get_dev(oh_name);
+   if (IS_ERR(dev)) {
+   pr_err(%s: Unable to get dev pointer for hwmod %s\n,
+   __func__, oh_name);
+   goto exit;
+   }
+
voltdm = omap_voltage_domain_lookup(vdd_name);
if (IS_ERR(voltdm)) {
printk(KERN_ERR %s: Unable to get vdd pointer for vdd_%s\n,
@@ -228,8 +236,8 @@ static void __init omap3_init_voltages(void)
if (!cpu_is_omap34xx())
return;
 
-   omap2_set_init_voltage(mpu, dpll1_ck, mpu_dev);
-   omap2_set_init_voltage(core, l3_ick, l3_dev);
+   omap2_set_init_voltage(mpu, dpll1_ck, mpu);
+   omap2_set_init_voltage(core, l3_ick, l3_main);
 }
 
 static void __init omap4_init_voltages(void)
@@ -237,9 +245,9 @@ static void __init omap4_init_voltages(void)
if (!cpu_is_omap44xx())
return;
 
-   omap2_set_init_voltage(mpu, dpll_mpu_ck, mpu_dev);
-   omap2_set_init_voltage(core, l3_div_ck, l3_dev);
-   omap2_set_init_voltage(iva, dpll_iva_m5x2_ck, iva_dev);
+   omap2_set_init_voltage(mpu, dpll_mpu_ck, mpu);
+   omap2_set_init_voltage(core, l3_div_ck, l3_main_1);
+   omap2_set_init_voltage(iva, dpll_iva_m5x2_ck, iva);
 }
 
 static int __init omap2_common_pm_init(void)
-- 
1.7.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/7] OMAP: PM: omap_device: add few quick access functions

2011-08-22 Thread Benoit Cousson
From: Nishanth Menon n...@ti.com

Provide a quick set of access functions:
a) Convert omap_device to platform_device - This is the flip of
   to_omap_device for equivalent usage
b) Convert omap_device to device pointer - This is useful for
   most devices that need to go through standard linux functions that
   take device pointer.
c) Convert hwmod to device pointer - This wrapper provides ability for
   drivers to convert directly from hwmod name back to device pointer
   without having to handle this on a driver by driver basis

Signed-off-by: Nishanth Menon n...@ti.com
[b-cous...@ti.com: Adapt it to the new pdev pointer inside od]
Signed-off-by: Benoit Cousson b-cous...@ti.com
---
 arch/arm/plat-omap/include/plat/omap_device.h |   15 +++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-omap/include/plat/omap_device.h 
b/arch/arm/plat-omap/include/plat/omap_device.h
index bdc2804..903f329 100644
--- a/arch/arm/plat-omap/include/plat/omap_device.h
+++ b/arch/arm/plat-omap/include/plat/omap_device.h
@@ -152,6 +152,21 @@ static inline struct omap_device *to_omap_device(struct 
platform_device *pdev)
return pdev ? pdev-archdata.od : NULL;
 }
 
+/* Convert omap_device to platform device pointer */
+#define omap_device_get_pdev(x) ((x)-pdev)
+/* Convert omap_device to device pointer */
+#define omap_device_get_dev(x) (omap_device_get_pdev(x)-dev)
+
+/* Convert omap_hwmod name to device pointer */
+static inline struct device *omap_hwmod_name_get_dev(const char *oh_name)
+{
+   struct omap_device *od;
+   od = omap_hwmod_name_get_odev(oh_name);
+   if (IS_ERR_OR_NULL(od))
+   return ERR_PTR(od ? PTR_ERR(od) : -ENODEV);
+   return omap_device_get_dev(od);
+}
+
 static inline
 void omap_device_disable_idle_on_suspend(struct platform_device *pdev)
 {
-- 
1.7.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 5/7] OMAP2+: pm: Remove static devices variable for mpu, dsp, iva and l3 PM

2011-08-22 Thread Benoit Cousson
Since the device pointer is now retrieved using the hwmod name, remove
the static variables used to store the device pointers for DSP, MPU, IVA
and L3 devices for PM/DVFS usage.

Signed-off-by: Benoit Cousson b-cous...@ti.com
Cc: Kevin Hilman khil...@ti.com
---
 arch/arm/mach-omap2/pm.c |   47 ++---
 1 files changed, 7 insertions(+), 40 deletions(-)

diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
index 17725d2..832577a 100644
--- a/arch/arm/mach-omap2/pm.c
+++ b/arch/arm/mach-omap2/pm.c
@@ -26,38 +26,7 @@
 
 static struct omap_device_pm_latency *pm_lats;
 
-static struct device *mpu_dev;
-static struct device *iva_dev;
-static struct device *l3_dev;
-static struct device *dsp_dev;
-
-struct device *omap2_get_mpuss_device(void)
-{
-   WARN_ON_ONCE(!mpu_dev);
-   return mpu_dev;
-}
-
-struct device *omap2_get_iva_device(void)
-{
-   WARN_ON_ONCE(!iva_dev);
-   return iva_dev;
-}
-
-struct device *omap2_get_l3_device(void)
-{
-   WARN_ON_ONCE(!l3_dev);
-   return l3_dev;
-}
-
-struct device *omap4_get_dsp_device(void)
-{
-   WARN_ON_ONCE(!dsp_dev);
-   return dsp_dev;
-}
-EXPORT_SYMBOL(omap4_get_dsp_device);
-
-/* static int _init_omap_device(struct omap_hwmod *oh, void *user) */
-static int _init_omap_device(char *name, struct device **new_dev)
+static int _init_omap_device(char *name)
 {
struct omap_hwmod *oh;
struct platform_device *pdev;
@@ -72,8 +41,6 @@ static int _init_omap_device(char *name, struct device 
**new_dev)
 __func__, name))
return -ENODEV;
 
-   *new_dev = pdev-dev;
-
return 0;
 }
 
@@ -82,16 +49,16 @@ static int _init_omap_device(char *name, struct device 
**new_dev)
  */
 static void omap2_init_processor_devices(void)
 {
-   _init_omap_device(mpu, mpu_dev);
+   _init_omap_device(mpu);
if (omap3_has_iva())
-   _init_omap_device(iva, iva_dev);
+   _init_omap_device(iva);
 
if (cpu_is_omap44xx()) {
-   _init_omap_device(l3_main_1, l3_dev);
-   _init_omap_device(dsp, dsp_dev);
-   _init_omap_device(iva, iva_dev);
+   _init_omap_device(l3_main_1);
+   _init_omap_device(dsp);
+   _init_omap_device(iva);
} else {
-   _init_omap_device(l3_main, l3_dev);
+   _init_omap_device(l3_main);
}
 }
 
-- 
1.7.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/7] OMAP3: beagle-board: Use the omap_hwmod_name_get_dev API

2011-08-22 Thread Benoit Cousson
Replace the multiple omap2_get_XXX_device APIs with the new
omap_hwmod_name_get_dev that uses the hwmod name to get the proper
device.

Signed-off-by: Benoit Cousson b-cous...@ti.com
Cc: Nishanth Menon n...@ti.com
---
 arch/arm/mach-omap2/board-omap3beagle.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap3beagle.c 
b/arch/arm/mach-omap2/board-omap3beagle.c
index 3ae16b4..dab16e0 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -493,8 +493,8 @@ static void __init beagle_opp_init(void)
if (cpu_is_omap3630()) {
struct device *mpu_dev, *iva_dev;
 
-   mpu_dev = omap2_get_mpuss_device();
-   iva_dev = omap2_get_iva_device();
+   mpu_dev = omap_hwmod_name_get_dev(mpu);
+   iva_dev = omap_hwmod_name_get_dev(iva);
 
if (!mpu_dev || !iva_dev) {
pr_err(%s: Aiee.. no mpu/dsp devices? %p %p\n,
-- 
1.7.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 6/7] OMAP: omap_device: Create a default omap_device_pm_latency

2011-08-22 Thread Benoit Cousson
Most devices are using the same default omap_device_pm_latency structure
during device built. In order to avoid the duplication of the same
structure everywhere, add a default structure that will be used if
the device does not have an explicit one.

Next patches will clean the duplicated structures.

Signed-off-by: Benoit Cousson b-cous...@ti.com
Cc: Kevin Hilman khil...@ti.com
Cc: Paul Walmsley p...@pwsan.com
---
 arch/arm/plat-omap/omap_device.c |   17 +++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
index 455594a..f2149be 100644
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/plat-omap/omap_device.c
@@ -97,6 +97,14 @@
 static int omap_device_register(struct platform_device *pdev);
 static int omap_early_device_register(struct platform_device *pdev);
 
+static struct omap_device_pm_latency omap_default_latency[] = {
+   {
+   .deactivate_func = omap_device_idle_hwmods,
+   .activate_func   = omap_device_enable_hwmods,
+   .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
+   }
+};
+
 /* Private functions */
 
 /**
@@ -510,8 +518,13 @@ struct platform_device *omap_device_build_ss(const char 
*pdev_name, int pdev_id,
if (ret)
goto odbs_exit3;
 
-   od-pm_lats = pm_lats;
-   od-pm_lats_cnt = pm_lats_cnt;
+   if (pm_lats) {
+   od-pm_lats = pm_lats;
+   od-pm_lats_cnt = pm_lats_cnt;
+   } else {
+   od-pm_lats = omap_default_latency;
+   od-pm_lats_cnt = ARRAY_SIZE(omap_default_latency);
+   }
 
for (i = 0; i  oh_cnt; i++) {
hwmods[i]-od = od;
-- 
1.7.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 7/7] OMAP2+: devices: Remove all omap_device_pm_latency structures

2011-08-22 Thread Benoit Cousson
Remove all these duplicated structures since a default one is now
available.

Signed-off-by: Benoit Cousson b-cous...@ti.com
Cc: Kevin Hilman khil...@ti.com
---
 arch/arm/mach-omap2/devices.c|   46 +++--
 arch/arm/mach-omap2/display.c|   11 +
 arch/arm/mach-omap2/dma.c|   11 +
 arch/arm/mach-omap2/gpio.c   |   12 +-
 arch/arm/mach-omap2/hsmmc.c  |   18 +--
 arch/arm/mach-omap2/hwspinlock.c |   12 +-
 arch/arm/mach-omap2/mcbsp.c  |   11 +
 arch/arm/mach-omap2/serial.c |   25 +---
 arch/arm/mach-omap2/sr_device.c  |   11 +
 arch/arm/mach-omap2/usb-musb.c   |   11 +
 arch/arm/plat-omap/i2c.c |   10 +---
 11 files changed, 14 insertions(+), 164 deletions(-)

diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 10adf66..2d4a199 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -221,14 +221,6 @@ static inline void omap_init_camera(void)
 #endif
 }
 
-struct omap_device_pm_latency omap_keyboard_latency[] = {
-   {
-   .deactivate_func = omap_device_idle_hwmods,
-   .activate_func   = omap_device_enable_hwmods,
-   .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
-   },
-};
-
 int __init omap4_keyboard_init(struct omap4_keypad_platform_data
*sdp4430_keypad_data, struct omap_board_data *bdata)
 {
@@ -248,9 +240,7 @@ int __init omap4_keyboard_init(struct 
omap4_keypad_platform_data
keypad_data = sdp4430_keypad_data;
 
pdev = omap_device_build(name, id, oh, keypad_data,
-   sizeof(struct omap4_keypad_platform_data),
-   omap_keyboard_latency,
-   ARRAY_SIZE(omap_keyboard_latency), 0);
+   sizeof(struct omap4_keypad_platform_data), NULL, 0, 0);
 
if (IS_ERR(pdev)) {
WARN(1, Can't build omap_device for %s:%s.\n,
@@ -263,14 +253,6 @@ int __init omap4_keyboard_init(struct 
omap4_keypad_platform_data
 }
 
 #if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE)
-static struct omap_device_pm_latency mbox_latencies[] = {
-   [0] = {
-   .activate_func = omap_device_enable_hwmods,
-   .deactivate_func = omap_device_idle_hwmods,
-   .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
-   },
-};
-
 static inline void omap_init_mbox(void)
 {
struct omap_hwmod *oh;
@@ -282,8 +264,7 @@ static inline void omap_init_mbox(void)
return;
}
 
-   pdev = omap_device_build(omap-mailbox, -1, oh, NULL, 0,
-   mbox_latencies, ARRAY_SIZE(mbox_latencies), 0);
+   pdev = omap_device_build(omap-mailbox, -1, oh, NULL, 0, NULL, 0, 0);
WARN(IS_ERR(pdev), %s: could not build device, err %ld\n,
__func__, PTR_ERR(pdev));
 }
@@ -334,14 +315,6 @@ static inline void omap_init_audio(void) {}
 
 #include plat/mcspi.h
 
-struct omap_device_pm_latency omap_mcspi_latency[] = {
-   [0] = {
-   .deactivate_func = omap_device_idle_hwmods,
-   .activate_func   = omap_device_enable_hwmods,
-   .flags   = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
-   },
-};
-
 static int omap_mcspi_init(struct omap_hwmod *oh, void *unused)
 {
struct platform_device *pdev;
@@ -372,8 +345,7 @@ static int omap_mcspi_init(struct omap_hwmod *oh, void 
*unused)
 
spi_num++;
pdev = omap_device_build(name, spi_num, oh, pdata,
-   sizeof(*pdata), omap_mcspi_latency,
-   ARRAY_SIZE(omap_mcspi_latency), 0);
+   sizeof(*pdata), NULL, 0, 0);
WARN(IS_ERR(pdev), Can't build omap_device for %s:%s\n,
name, oh-name);
kfree(pdata);
@@ -698,14 +670,6 @@ static int __init omap2_init_devices(void)
 arch_initcall(omap2_init_devices);
 
 #if defined(CONFIG_OMAP_WATCHDOG) || defined(CONFIG_OMAP_WATCHDOG_MODULE)
-static struct omap_device_pm_latency omap_wdt_latency[] = {
-   [0] = {
-   .deactivate_func = omap_device_idle_hwmods,
-   .activate_func   = omap_device_enable_hwmods,
-   .flags   = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
-   },
-};
-
 static int __init omap_init_wdt(void)
 {
int id = -1;
@@ -723,9 +687,7 @@ static int __init omap_init_wdt(void)
return -EINVAL;
}
 
-   pdev = omap_device_build(dev_name, id, oh, NULL, 0,
-   omap_wdt_latency,
-   ARRAY_SIZE(omap_wdt_latency), 0);
+   pdev = omap_device_build(dev_name, id, oh, NULL, 0, NULL, 0, 0);
WARN(IS_ERR(pdev), Can't build omap_device for %s:%s.\n,
dev_name, oh-name);
return 0;
diff --git 

RE: [PATCH 3/3] OMAP3: Remove auto-selection of PMICs

2011-08-22 Thread Premi, Sanjeev
 From: Samuel Ortiz [sa...@linux.intel.com]
 Sent: Monday, August 22, 2011 8:33 PM
 To: Koyamangalath, Abhilash
 Cc: linux-omap@vger.kernel.org; linux-arm-ker...@lists.infradead.org; 
 linux-ker...@vger.kernel.org;
  t...@atomide.com; li...@arm.linux.org.uk; Hilman, Kevin; Shilimkar, Santosh; 
 Premi, Sanjeev;
  david.woodho...@intel.com
 Subject: Re: [PATCH 3/3] OMAP3: Remove auto-selection of PMICs
 
 Hi Anhilash,
 
 On Fri, Aug 19, 2011 at 05:19:33PM +0530, Abhilash K V wrote:
  The current implementation almost assumes that only
  TWL4030/TWL5030/TWl6030 are (or can be) used with the
  OMAP processors. This is, however, not true.
 
 I don't like the mfd/Kconfig change. Why would those drivers be only buildable
 on OMAP processors ?
 Unless there is a real reason for this, you should fix the drivers instead.

You are right. The change for config item TWL4030_CORE should be removed.
 - depends on I2C=y  GENERIC_HARDIRQS
 + depends on I2C=y  GENERIC_HARDIRQS  (ARCH_OMAP3 || ARCH_OMAP4)

In fact, change for TWL4030_POWER should be 
-   depends on TWL4030_CORE  ARM
+   depends on TWL4030_CORE

This would allow these PMICs to be used with other processors as well. There may
be issues run-time issues; but they would most likely surface only when there is
a combination without any of the OMAPs. (We would try a dummy build for another
processor with TWL4030 selected.)

The original idea was to ensure that nothing else breaks when the auto selection
of the PMICs is removed.

~sanjeev

 
 Cheers,
 Samuel.
 
 --
 Intel Open Source Technology Centre
 http://oss.intel.com/
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Passing camera module type using camera argument.

2011-08-22 Thread Koen Kooi

Op 22 aug. 2011, om 08:42 heeft javier Martin het volgende geschreven:

 
 Hi Koen,
 
 On 19 August 2011 17:07, Koen Kooi k...@beagleboard.org wrote:
 
 
 Op 19 aug. 2011 om 14:39 heeft javier Martin 
 javier.mar...@vista-silicon.com het volgende geschreven:
 
 Hi,
 I've been digging into the code of linux-omap kernel in Angstrom for 
 Beagleboard and I've noticed there is an argument called camera which can 
 be passed to the kernel. This allows telling the linux kernel what camera 
 module is actually connected to the platform.
 
 However, when I look the mainline kernel 3.0 I see those changed have not 
 yet made into it. Is this mechanism accepted by the community?
 
 When I asked a few months ago the consensus was that there currently is no 
 better way. DT might solve it, but that's still some time away
 
 So, as I understand, using a command line argument for this purpose is the 
 preferred way by the community but, at the same time, they won't accept 
 patches that implement this approach.

From what I understood a patch doing that wouldn't be rejected, but 
Laurent/Tony would have to chime in to confirm that.--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v6 0/7] PM QoS: add a per-device latency constraints framework

2011-08-22 Thread Kevin Hilman
jean.pi...@newoldbits.com writes:

 From: Jean Pihet j-pi...@ti.com

 High level implementation:

 1. Preparation of the PM QoS for the addition of a device PM QoS constraints
framework:
   . rename and move of the PM QoS implementation files to kernel/power/qos.c
 and include/linux/pm_qos.h
   . rename of API parameters and internal fields names
   . Move around the PM QoS misc devices management code for better readability
   . re-organize the internal data structs
   . generalize and export the constraints management core code

 2. Implementation of the per-device PM QoS constraints:
   . create drivers/base/power/qos.c for the implementation
   . create a device PM QoS API, which calls the PM QoS constraints management
 core code
   . the per-device latency constraints data strctures are stored in the device
 dev_pm_info struct
   . the device PM code calls the init and destroy of the per-device 
 constraints
 data struct in order to support the dynamic insertion and removal of the
 devices in the system.
   . to minimize the data usage by the per-device constraints, the data struct
 is only allocated at the first call to dev_pm_qos_add_request. The data
 is later free'd when the device is removed from the system
   . per-device notification callbacks can be registered and called upon a
 change to the aggregated constraint value
   . a global mutex protects the constraints users from the data being
 allocated and free'd.

 3. add a global notification mechanism for the device constraints
   . add a global notification chain that gets called upon changes to the
 aggregated constraint value for any device.
   . the notification callbacks are passing the full constraint request data
 in order for the callees to have access to it. The current use is for the
 platform low-level code to access the target device of the constraint

Reviewed-by: Kevin Hilman khil...@ti.com

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/7] twl4030: finish threaded IRQ conversion

2011-08-22 Thread Felipe Balbi
Hi,

On Mon, Aug 22, 2011 at 04:54:36PM +0200, Samuel Ortiz wrote:
 On Fri, Aug 19, 2011 at 12:36:15AM +0300, Felipe Balbi wrote:
  Hi,
  
  On Sat, Jul 09, 2011 at 05:09:00AM +0100, Mark Brown wrote:
   On Thu, Jun 30, 2011 at 12:51:03PM +0300, Felipe Balbi wrote:
   
the following patches where boot-tested on beagle xM
and everything seems fine. MMC root filesystem still
mounts, /proc/interrupts looks like ps aux | grep irq
shows our threads, etc.
   
   Reviewed-by: Mark Brown broo...@opensource.wolfsonmicro.com
  
  It has been a long time and nobody complained. Samuel, can you take
  these patches in for 3.2 merge window ?
 Yes, that sounds like the right time now.
 All 7 patches applied, many thanks.

thanks ;-)

-- 
balbi


signature.asc
Description: Digital signature


[RFC PATCH 0/3] OMAP: omap_device: Add a method to build an omap_device from a DT node

2011-08-22 Thread Benoit Cousson
Hi Kevin,

This is an initial attempt to use a notifier in order to create an
omap_device from a platform_device bound to DT node as suggested by Grant.
For the moment, the informations are all extracted from the hwmod data.
The idea is to focus first on the devices / board static init removal.
The other issue is that some bindings, like dma, are still not present
in the DT core code. The reg and irq bindings are there, but cannot
be used by some drivers due to the lack of named ressources in DT.
Since the DT core cannot change, the drivers will have to be modified
first.
In a second phase these informations will be moved from hwmod to DT.

Patches are based on my for_3.2/1_omap_device_cleanup branch and are
available here:
git://gitorious.org/omap-pm/linux.git for_3.2/2_omap_device_dt

It is tested on OMAP4 SDP and Panda.

Regards,
Benoit


Benoit Cousson (3):
  OMAP: omap_device: Add omap_device_[alloc|delete] for DT integration
  OMAP: omap_device: Add a DT parser for multiple strings
  OMAP: omap_device: Add a method to build an omap_device from a DT node

 arch/arm/plat-omap/omap_device.c |  309 +++---
 1 files changed, 255 insertions(+), 54 deletions(-)

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC PATCH 0/3] OMAP: omap_device: Add a method to build an omap_device from a DT node

2011-08-22 Thread Benoit Cousson
Hi Kevin,

This is an initial attempt to use a notifier in order to create an
omap_device from a platform_device bound to DT node as suggested by Grant.
For the moment, the informations are all extracted from the hwmod data.
The idea is to focus first on the devices / board static init removal.
The other issue is that some bindings, like dma, are still not present
in the DT core code. The reg and irq bindings are there, but cannot
be used by some drivers due to the lack of named ressources in DT.
Since the DT core cannot change, the drivers will have to be modified
first.
In a second phase these informations will be moved from hwmod to DT.

Patches are based on my for_3.2/1_omap_device_cleanup branch and are
available here:
git://gitorious.org/omap-pm/linux.git for_3.2/2_omap_device_dt

It is tested on OMAP4 SDP and Panda.

Regards,
Benoit


Benoit Cousson (3):
  OMAP: omap_device: Add omap_device_[alloc|delete] for DT integration
  OMAP: omap_device: Add a DT parser for multiple strings
  OMAP: omap_device: Add a method to build an omap_device from a DT node

 arch/arm/plat-omap/omap_device.c |  309 +++---
 1 files changed, 255 insertions(+), 54 deletions(-)

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC PATCH 2/3] OMAP: omap_device: Add a DT parser for multiple strings

2011-08-22 Thread Benoit Cousson
Add two helpers function to parse a property that contains multiple
strings.

These functions might be exported and moved to a common place if they
can to be useful elsewhere.

Signed-off-by: Benoit Cousson b-cous...@ti.com
Cc: Kevin Hilman khil...@ti.com
---
 arch/arm/plat-omap/omap_device.c |   39 ++
 1 files changed, 39 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
index 752d72a..70361f8 100644
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/plat-omap/omap_device.c
@@ -315,6 +315,45 @@ static void _add_hwmod_clocks_clkdev(struct omap_device 
*od,
_add_clkdev(od, oh-opt_clks[i].role, oh-opt_clks[i].clk);
 }
 
+/*
+ * XXX: DT helper functions that should probably move elsewhere if
+ * they become usefull for other needs.
+ */
+static int _dt_count_property_string(const char *prop, int len)
+{
+   int i = 0;
+   size_t l = 0, total = 0;
+
+   if (!prop || !len)
+   return -EINVAL;
+
+   for (i = 0; len = total; total += l, prop += l) {
+   l = strlen(prop) + 1;
+   if (*prop != 0)
+   i++;
+   }
+   return i;
+}
+
+static int _dt_get_property(const char *prop, int len, int index, char *output,
+   int size)
+{
+   int i = 0;
+   size_t l = 0, total = 0;
+
+   if (!prop || !len)
+   return -EINVAL;
+
+   for (i = 0; len = total; total += l, prop += l) {
+   l = strlcpy(output, prop, size) + 1;
+   if (*prop != 0) {
+   if (i++ == index)
+   return 0;
+   }
+   }
+   return -ENODEV;
+}
+
 
 /* Public functions for use by core code */
 
-- 
1.7.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC PATCH 1/3] OMAP: omap_device: Add omap_device_[alloc|delete] for DT integration

2011-08-22 Thread Benoit Cousson
Split the omap_device_build_ss into two smaller functions
that will allow to populate a platform_device already alocated by
device-tree.
The functionality of the omap_device_build_ss is still the same, but
the omap_device_alloc will be usable with devices already built by
device-tree.

Signed-off-by: Benoit Cousson b-cous...@ti.com
Cc: Kevin Hilman khil...@ti.com
---
 arch/arm/plat-omap/omap_device.c |  168 ++
 1 files changed, 114 insertions(+), 54 deletions(-)

diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
index f2149be..752d72a 100644
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/plat-omap/omap_device.c
@@ -96,6 +96,11 @@
 
 static int omap_device_register(struct platform_device *pdev);
 static int omap_early_device_register(struct platform_device *pdev);
+static struct omap_device *omap_device_alloc(struct platform_device *pdev,
+ struct omap_hwmod **ohs, int oh_cnt,
+ struct omap_device_pm_latency *pm_lats,
+ int pm_lats_cnt);
+
 
 static struct omap_device_pm_latency omap_default_latency[] = {
{
@@ -397,6 +402,105 @@ static int omap_device_fill_resources(struct omap_device 
*od,
 }
 
 /**
+ * omap_device_alloc - allocate an omap_device
+ * @pdev: platform_device that will be represent this omap_device
+ * @oh: ptr to the single omap_hwmod that backs this omap_device
+ * @pdata: platform_data ptr to associate with the platform_device
+ * @pdata_len: amount of memory pointed to by @pdata
+ * @pm_lats: pointer to a omap_device_pm_latency array for this device
+ * @pm_lats_cnt: ARRAY_SIZE() of @pm_lats
+ *
+ * Convenience function for allocating an omap_device structure and filling
+ * hwmods, resources and pm_latency attributes.
+ *
+ * Returns an struct omap_device pointer or ERR_PTR() on error;
+ */
+static struct omap_device *omap_device_alloc(struct platform_device *pdev,
+   struct omap_hwmod **ohs, int oh_cnt,
+   struct omap_device_pm_latency *pm_lats,
+   int pm_lats_cnt)
+{
+   int ret = -ENOMEM;
+   struct omap_device *od;
+   struct resource *res = NULL;
+   int i, res_count;
+   struct omap_hwmod **hwmods;
+
+   od = kzalloc(sizeof(struct omap_device), GFP_KERNEL);
+   if (!od) {
+   ret = -ENOMEM;
+   goto oda_exit1;
+   }
+   od-hwmods_cnt = oh_cnt;
+
+   hwmods = kzalloc(sizeof(struct omap_hwmod *) * oh_cnt,
+GFP_KERNEL);
+   if (!hwmods)
+   goto oda_exit2;
+
+   memcpy(hwmods, ohs, sizeof(struct omap_hwmod *) * oh_cnt);
+   od-hwmods = hwmods;
+   od-pdev = pdev;
+
+   if (pdev-num_resources  pdev-resource)
+   dev_warn(pdev-dev, %s(): ressources already allocated %d\n,
+   __func__, pdev-num_resources);
+   /*
+* HACK: Idealy the resources from DT should match, and hwmod
+* should just add the missing ones. Since the name is not
+* properly populated by DT, stick to hwmod resources only.
+*/
+   res_count = omap_device_count_resources(od);
+   if (res_count  0) {
+   dev_dbg(pdev-dev, %s(): ressources allocated from hwmod 
%d\n,
+   __func__, res_count);
+   res = kzalloc(sizeof(struct resource) * res_count, GFP_KERNEL);
+   if (!res)
+   goto oda_exit3;
+
+   omap_device_fill_resources(od, res);
+
+   ret = platform_device_add_resources(pdev, res, res_count);
+   kfree(res);
+
+   if (ret)
+   goto oda_exit3;
+   }
+
+   if (pm_lats) {
+   od-pm_lats = pm_lats;
+   od-pm_lats_cnt = pm_lats_cnt;
+   } else {
+   od-pm_lats = omap_default_latency;
+   od-pm_lats_cnt = ARRAY_SIZE(omap_default_latency);
+   }
+
+   pdev-archdata.od = od;
+
+   for (i = 0; i  oh_cnt; i++) {
+   hwmods[i]-od = od;
+   _add_hwmod_clocks_clkdev(od, hwmods[i]);
+   }
+
+   return od;
+
+oda_exit3:
+   kfree(hwmods);
+oda_exit2:
+   kfree(od);
+oda_exit1:
+   dev_err(pdev-dev, omap_device: build failed (%d)\n, ret);
+
+   return ERR_PTR(ret);
+}
+
+void omap_device_delete(struct omap_device *od)
+{
+   kfree(od-hwmods);
+   kfree(od);
+}
+
+/**
  * omap_device_build - build and register an omap_device with one omap_hwmod
  * @pdev_name: name of the platform_device driver to use
  * @pdev_id: this platform_device's connection ID
@@ -455,9 +559,6 @@ struct platform_device *omap_device_build_ss(const char 
*pdev_name, int pdev_id,
int ret = -ENOMEM;
struct platform_device *pdev;
struct omap_device *od;
-   struct resource *res = 

[RFC PATCH 3/3] OMAP: omap_device: Add a method to build an omap_device from a DT node

2011-08-22 Thread Benoit Cousson
Add a notifier called during device_add phase. If a of_node is present,
retrieve the hwmod entry in order to populate propely the omap_device
structure.
For the moment the resource from the device-tree are overloaded.
DT does not support named resource yet, and thus, most driver
will not work without that information.

Signed-off-by: Benoit Cousson b-cous...@ti.com
Cc: Kevin Hilman khil...@ti.com
---
 arch/arm/plat-omap/omap_device.c |  102 ++
 1 files changed, 102 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
index 70361f8..0ae9e7f 100644
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/plat-omap/omap_device.c
@@ -85,6 +85,8 @@
 #include linux/clk.h
 #include linux/clkdev.h
 #include linux/pm_runtime.h
+#include linux/of_platform.h
+#include linux/notifier.h
 
 #include plat/omap_device.h
 #include plat/omap_hwmod.h
@@ -94,6 +96,8 @@
 #define USE_WAKEUP_LAT 0
 #define IGNORE_WAKEUP_LAT  1
 
+#define MAX_HWMOD_NAME_SIZE32
+
 static int omap_device_register(struct platform_device *pdev);
 static int omap_early_device_register(struct platform_device *pdev);
 static struct omap_device *omap_device_alloc(struct platform_device *pdev,
@@ -354,6 +358,100 @@ static int _dt_get_property(const char *prop, int len, 
int index, char *output,
return -ENODEV;
 }
 
+static struct dev_pm_domain omap_device_pm_domain;
+
+/**
+ * omap_device_build_from_dt - build an omap_device with multiple hwmods
+ * @pdev_name: name of the platform_device driver to use
+ * @pdev_id: this platform_device's connection ID
+ * @oh: ptr to the single omap_hwmod that backs this omap_device
+ * @pdata: platform_data ptr to associate with the platform_device
+ * @pdata_len: amount of memory pointed to by @pdata
+ * @pm_lats: pointer to a omap_device_pm_latency array for this device
+ * @pm_lats_cnt: ARRAY_SIZE() of @pm_lats
+ * @is_early_device: should the device be registered as an early device or not
+ *
+ * Function for building an omap_device already registered from device-tree
+ *
+ * Returns 0 or PTR_ERR() on error.
+ */
+static int omap_device_build_from_dt(struct platform_device *pdev)
+{
+   struct omap_hwmod **hwmods;
+   struct omap_device *od;
+   struct omap_hwmod *oh;
+   char oh_name[MAX_HWMOD_NAME_SIZE];
+   const char *prop;
+   int oh_cnt, i, prop_len;
+   int ret = 0;
+
+   prop = of_get_property(pdev-dev.of_node, hwmods, prop_len);
+   oh_cnt = _dt_count_property_string(prop, prop_len);
+   if (!oh_cnt || IS_ERR_VALUE(oh_cnt)) {
+   dev_warn(pdev-dev, No 'hwmods' to build omap_device\n);
+   return -ENODEV;
+   }
+
+   hwmods = kzalloc(sizeof(struct omap_hwmod *) * oh_cnt, GFP_KERNEL);
+   if (!hwmods) {
+   ret = -ENOMEM;
+   goto odbfd_exit;
+   }
+
+   for (i = 0; i  oh_cnt; i++) {
+   _dt_get_property(prop, prop_len, i, oh_name,
+MAX_HWMOD_NAME_SIZE);
+
+   oh = omap_hwmod_lookup(oh_name);
+   if (!oh) {
+   dev_err(pdev-dev, Cannot lookup hwmod '%s'\n,
+   oh_name);
+   ret = -EINVAL;
+   goto odbfd_exit1;
+   }
+   hwmods[i] = oh;
+   }
+
+   od = omap_device_alloc(pdev, hwmods, oh_cnt, NULL, 0);
+   if (!od) {
+   dev_err(pdev-dev, Cannot allocate omap_device for :%s\n,
+   oh_name);
+   ret = PTR_ERR(od);
+   goto odbfd_exit1;
+   }
+
+   if (of_get_property(pdev-dev.of_node, no_idle_on_suspend, NULL))
+   omap_device_disable_idle_on_suspend(pdev);
+
+   pdev-dev.pm_domain = omap_device_pm_domain;
+
+odbfd_exit1:
+   kfree(hwmods);
+odbfd_exit:
+   return ret;
+}
+
+static int _omap_device_notifier_call(struct notifier_block *nb,
+ unsigned long event, void *dev)
+{
+   struct platform_device *pdev = to_platform_device(dev);
+
+   switch (event) {
+   case BUS_NOTIFY_ADD_DEVICE:
+   if (pdev-dev.of_node) {
+   dev_dbg(pdev-dev, add_device with DT bindings\n);
+   omap_device_build_from_dt(pdev);
+   }
+   break;
+
+   case BUS_NOTIFY_DEL_DEVICE:
+   dev_dbg(pdev-dev, del_device\n);
+   break;
+   }
+
+   return NOTIFY_DONE;
+}
+
 
 /* Public functions for use by core code */
 
@@ -1064,8 +1162,12 @@ struct device omap_device_parent = {
.parent = platform_bus,
 };
 
+static struct notifier_block platform_nb;
+
 static int __init omap_device_init(void)
 {
+   platform_nb.notifier_call = _omap_device_notifier_call;
+   bus_register_notifier(platform_bus_type, platform_nb);
return 

Re: [PATCH v6 0/7] PM QoS: add a per-device latency constraints framework

2011-08-22 Thread Rafael J. Wysocki
On Monday, August 22, 2011, Kevin Hilman wrote:
 jean.pi...@newoldbits.com writes:
 
  From: Jean Pihet j-pi...@ti.com
 
  High level implementation:
 
  1. Preparation of the PM QoS for the addition of a device PM QoS constraints
 framework:
. rename and move of the PM QoS implementation files to kernel/power/qos.c
  and include/linux/pm_qos.h
. rename of API parameters and internal fields names
. Move around the PM QoS misc devices management code for better 
  readability
. re-organize the internal data structs
. generalize and export the constraints management core code
 
  2. Implementation of the per-device PM QoS constraints:
. create drivers/base/power/qos.c for the implementation
. create a device PM QoS API, which calls the PM QoS constraints 
  management
  core code
. the per-device latency constraints data strctures are stored in the 
  device
  dev_pm_info struct
. the device PM code calls the init and destroy of the per-device 
  constraints
  data struct in order to support the dynamic insertion and removal of the
  devices in the system.
. to minimize the data usage by the per-device constraints, the data 
  struct
  is only allocated at the first call to dev_pm_qos_add_request. The data
  is later free'd when the device is removed from the system
. per-device notification callbacks can be registered and called upon a
  change to the aggregated constraint value
. a global mutex protects the constraints users from the data being
  allocated and free'd.
 
  3. add a global notification mechanism for the device constraints
. add a global notification chain that gets called upon changes to the
  aggregated constraint value for any device.
. the notification callbacks are passing the full constraint request data
  in order for the callees to have access to it. The current use is for 
  the
  platform low-level code to access the target device of the constraint
 
 Reviewed-by: Kevin Hilman khil...@ti.com

I guess that applies to the entire patchset?

Rafael
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCHv2 5/5] OMAP: HWMOD: Unify DSS resets for all OMAPs

2011-08-22 Thread Paul Walmsley
Hello Tomi,

On Mon, 22 Aug 2011, Tomi Valkeinen wrote:

 On Sat, 2011-08-20 at 00:26 -0600, Paul Walmsley wrote:
  On Fri, 19 Aug 2011, Paul Walmsley wrote:
  
   This one doesn't build when !CONFIG_OMAP2_DSS - the following is the 
   updated patch.
  
  Looks like my previous update missed a warning.  This also moves the 
  omap_dss_reset() prototype from arch/arm/mach-omap2/common-board-devices.h 
  to arch/arm/plat-omap/include/plat/common.h.
 
 Related to this, there's also omap_display_init() function in display.c,
 called by the board files, which I would like to move elsewhere from
 include/video/omapdss.h.
 
 I was thinking of moving it to
 arch/arm/mach-omap2/common-board-devices.h but should I move it to
 arch/arm/plat-omap/include/plat/common.h so that it's in the same place
 with omap_dss_reset() (also from display.c)?

In the long run, it seems good to get rid of 
arch/arm/plat-omap/include/plat/common.h.  What I'd suggest is to move all 
of the OMAP2+-specific integration structures and macros into 
arch/arm/mach-omap2/omapdss.h or something similar.  I would have done 
this in the 3.1-rc patch, but the change seemed too intrusive for the -rc 
series.


- Paul
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] OMAP3: clock: indicate that gpt12_fck and wdt1_fck are in the WKUP clockdomain

2011-08-22 Thread Paul Walmsley

The oscillator that supplies GPT12_FCLK and WDT1_FCLK exists in the
WKUP powerdomain[1].  This resolves at least one boot-time warning:

omap_hwmod: gpt12_fck: missing clockdomain for gpt12_fck.

1. _OMAP34xx Multimedia High Security (HS) Device Silicon Revision 3.1.x
   Security Addendum Version K (SWPU119K)_  Figure 3-29.  August 2010.
---
Intended for 3.1-rc.

 arch/arm/mach-omap2/clock3xxx_data.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/clock3xxx_data.c 
b/arch/arm/mach-omap2/clock3xxx_data.c
index ffd55b1..b9b8446 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -3078,6 +3078,7 @@ static struct clk gpt12_fck = {
.name   = gpt12_fck,
.ops= clkops_null,
.parent = secure_32k_fck,
+   .clkdm_name = wkup_clkdm,
.recalc = followparent_recalc,
 };
 
@@ -3085,6 +3086,7 @@ static struct clk wdt1_fck = {
.name   = wdt1_fck,
.ops= clkops_null,
.parent = secure_32k_fck,
+   .clkdm_name = wkup_clkdm,
.recalc = followparent_recalc,
 };
 
-- 
1.7.5.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCHv4 2/4] regulator: omap smps regulator driver

2011-08-22 Thread Kevin Hilman
Liam Girdwood l...@ti.com writes:

 On 05/08/11 20:33, Hilman, Kevin wrote:
 Mark Brown broo...@opensource.wolfsonmicro.com writes:
 
 On Thu, Jul 28, 2011 at 02:48:57PM +0300, Tero Kristo wrote:
 OMAP SMPS regulator driver provides access to OMAP voltage processor
 controlled regulators. These include VDD_MPU and VDD_CORE for OMAP3 and
 additionally VDD_IVA for OMAP4. SMPS regulators use the OMAP voltage
 layer for the actual voltage regulation operations.

 Signed-off-by: Tero Kristo t-kri...@ti.com

 Acked-by: Mark Brown broo...@opensource.wolfsonmicro.com
 
 Do you prefer we merge this via OMAP trees (along with the
 infrastructure) or would you like to merge it.
 
 At this point, it's probably best to merge it along with the voltage
 infrastructure, which still might change slightly at the API level.
 

 Ok, lets merge with the voltage infrastructure.


OK, shall I take this is an Ack from you then?

Kevin
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/2] omap_twl: Prevent SR to enable for am3517/am3505 devices

2011-08-22 Thread Kevin Hilman
Koyamangalath, Abhilash abhilash...@ti.com writes:

 Kevin Hilman wrote:
Abhilash K V abhilash...@ti.com writes:
 
  From: Vaibhav Hiremath hvaib...@ti.com
 
  In case of AM3517  AM3505, Smart Reflex is not applicable so
  we must not enable it. So add check for am3517/05 cpu revision
  in omap3_twl_init() and return -ENODEV if true, else continue.
 
  Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
  Signed-off-by: Abhilash K V abhilash...@ti.com
  ---
   arch/arm/mach-omap2/omap_twl.c |8 
   1 files changed, 8 insertions(+), 0 deletions(-)
 
  diff --git a/arch/arm/mach-omap2/omap_twl.c
 b/arch/arm/mach-omap2/omap_twl.c
  index 07d6140..92fadcb 100644
  --- a/arch/arm/mach-omap2/omap_twl.c
  +++ b/arch/arm/mach-omap2/omap_twl.c
  @@ -269,6 +269,14 @@ int __init omap3_twl_init(void)
 if (!cpu_is_omap34xx())
 return -ENODEV;
  
  + /*
  +  * In case of AM3517/AM3505 we should not be going down
  +  * further, since SR is not applicable there.
  +  */
  + if (cpu_is_omap3505() || cpu_is_omap3517()) {
  + return -ENODEV;
  + }
  +
 
 Rather than using cpu_is_*, you should add a new feature flag for
 SmartReflex.  We already have this for things like SGX, IVA, NEON, etc.
 See plat/feature.h
 I did not find a feature.h; 

sorry, I meant plat/cpu.yh

 did you mean OMAP3_CHECK_FEATURE macro which is used by
 omap3_check_features(), which gleans for presence of L2CACHE, IVA, SGX, NEON, 
 ISP features
 from the Control Device Status Register (0x4800 244C) ?

yes, OMAP3_HAS_FEATURE()

 There is no such bit-field to indicate the presence of smart-reflex feature 
 in this register.
 AFAIK, there is no such global register as well which could indicate this.

There doesn't have to be a register read to indicate this.  See for
example the HAS_IO_WAKEUP feature.

Kevin


 - Abhilash

 Kevin
 
 
 if (cpu_is_omap3630()) {
 omap3_mpu_volt_info.vp_vddmin =
 OMAP3630_VP1_VLIMITTO_VDDMIN;
 omap3_mpu_volt_info.vp_vddmax =
 OMAP3630_VP1_VLIMITTO_VDDMAX; 
 
 
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] irq: always set IRQF_ONESHOT if no primary handler is specified

2011-08-22 Thread Paul Walmsley
On Thu, 18 Aug 2011, Pantelis Antoniou wrote:

 Let me report that with this change Beagle board fails to boot,
 hangs right on rootfs mount.

Confirmed here.

Commit f3637a5f2e2eb391ff5757bc83fb5de8f9726464 (irq: Always set 
IRQF_ONESHOT if no primary handler is specified), merged as part of 
v3.1-rc3, won't boot into userspace via MMC on either OMAP4 Panda or 
OMAP3530 BeagleBoard.  v3.1-rc2 works.


- Paul

 Users of BB should revert this until the offending driver(s) are fixed.
 
 Regards
 
 -- Pantelis
 
 On Jul 7, 2011, at 11:32 PM, Sebastian Andrzej Siewior wrote:
 
  If no primary handler is specified then a default one is assigned which
  always returns IRQ_WAKE_THREAD. This handler requires the IRQF_ONESHOT
  flag on LEVEL / EIO typed irqs because the source of interrupt is not
  disabled.
  Since it is required for those users and there is no difference for others
  it makes sense to add this flag unconditionally.
  
  Signed-off-by: Sebastian Andrzej Siewior bige...@linutronix.de
  ---
  A quick grep shows that drivers/staging/iio/adc/ad7816.c is the only
  driver in tree doing it wrong i.e. request_threaded_irq with
  IRQF_TRIGGER_{LOW|HIGH} but without ONEHOST.
  
  There are 59 users in tree which request an edge typed interrupt. 24 of
  them specify the ONEHOST flag the others don't. Both variants are valid
  and identical but a consistent behavior would be nice.
  
  There is a total of 134 users and 87 specify the irq type directly. For
  the remaining 47 the type depends on initial configuration of the irq chip
  or it might be specified via the device tree, dunno. 
  Should that patch be accepted I suggest to remove the ONESHOT flag from
  every request_th.* which uses NULL as the primary handler so we have a
  consistent behavior here.
  
  kernel/irq/manage.c |1 +
  1 files changed, 1 insertions(+), 0 deletions(-)
  
  diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
  index 0a7840ae..3f9cd47 100644
  --- a/kernel/irq/manage.c
  +++ b/kernel/irq/manage.c
  @@ -1322,6 +1322,7 @@ int request_threaded_irq(unsigned int irq, 
  irq_handler_t handler,
  if (!thread_fn)
  return -EINVAL;
  handler = irq_default_primary_handler;
  +   irqflags |= IRQF_ONESHOT;
  }
  
  action = kzalloc(sizeof(struct irqaction), GFP_KERNEL);
  -- 
  1.7.4.4
  
  --
  To unsubscribe from this list: send the line unsubscribe linux-kernel in
  the body of a message to majord...@vger.kernel.org
  More majordomo info at  http://vger.kernel.org/majordomo-info.html
  Please read the FAQ at  http://www.tux.org/lkml/
 
 --
 To unsubscribe from this list: send the line unsubscribe linux-kernel in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] irq: always set IRQF_ONESHOT if no primary handler is specified

2011-08-22 Thread Paul Walmsley
On Fri, 19 Aug 2011, Felipe Balbi wrote:

 On Thu, Aug 18, 2011 at 07:22:39PM +0200, Sebastian Andrzej Siewior wrote:
  Pantelis Antoniou wrote:
  
  Let me report that with this change Beagle board fails to boot,
  hangs right on rootfs mount.
  
  Can you provide some more information about the kind of the failure and
  used drivers?
  
  Users of BB should revert this until the offending driver(s) are fixed.
  Which is the offending driver?
 
 I would guess it's the lack of threaded IRQ conversion on the
 twl4030 driver. I have converted it but noone actually picked the series
 [1].
 
 http://marc.info/?i=1309427470-605-1-git-send-email-ba...@ti.com

Just a data point: applying this series doesn't seem to fix the hang.

Sebastian, Thomas, does commit f3637a5f2e2eb391ff5757bc83fb5de8f9726464 
(irq: Always set IRQF_ONESHOT if no primary handler is specified) fix 
anything, aside from a driver in staging?


- Paul
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC PATCH 6/6] hwmon: OMAP4: On die temperature sensor driver

2011-08-22 Thread Kevin Hilman
Rajendra Nayak rna...@ti.com writes:

[...]

 FWIK, its a one time requirement to set the clock rate to the
 right rate the device can operate in based on what a platform
 supports. 

Except $SUBJECT patch hard-codes the clock rate for all platforms in the
driver.

If the clock rate is to be platform-specific, it should be done in
platform-specific code.

Kevin
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC PATCH 6/6] hwmon: OMAP4: On die temperature sensor driver

2011-08-22 Thread Rajendra Nayak

On 8/23/2011 5:28 AM, Kevin Hilman wrote:

Rajendra Nayakrna...@ti.com  writes:

[...]


FWIK, its a one time requirement to set the clock rate to the
right rate the device can operate in based on what a platform
supports.


Except $SUBJECT patch hard-codes the clock rate for all platforms in the
driver.


The device has a requirement to operate in a 1Mhz to 2Mhz range. So the
driver is using a clk_round_rate() to get the closest rate supported and
sets it using a clk_set_rate().



If the clock rate is to be platform-specific, it should be done in
platform-specific code.


I am fine if this needs to be moved to platform-specific code, but I
wasn't quite sure this needs to be done in clock framework as was
suggested.



Kevin


--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC/PATCH v2 00/13] dt: omap: dt binding with omap_device and support for i2c1

2011-08-22 Thread G, Manjunath Kondaiah

Patch series reworked from:
http://permalink.gmane.org/gmane.linux.ports.arm.omap/61674
Also added support for i2c1 controller on omap4 based panda
board.

Baseline:
=
git://git.secretlab.ca/git/linux-2.6.git
Branch: devicetree/test
The above branch is rebased with v3.1-rc2 mainline.
+
pdev decoupling patches from kevin hilman
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg53534.html

The patch series is also available at:
https://gitorious.org/devicetree/dt_omap/commits/devicetree/dt_rfcv2

Testing:

Build : dt and not dt build for omap2plus_defconfig
Boot: OMAP3530 Beagle Board and OMAP4430 Panda board

Limitation:
===
The current implementation of omap-device build through
device tree supports only single instance of hwmod and 
multiple instances are not supported.

G, Manjunath Kondaiah (13):
  OMAP: omap_device: Add device tree node pointer
  dt: Add pd_size to AUXDATA structure
  dt: omap3: add soc file for handling i2c controllers
  dt: omap3: beagle board: set clock freq for i2c devices
  dt: omap3: add generic board file for dt support
  dt: omap3: add omap-device compatible property
  dt: omap: create platform bus for omap devices
  dt: omap: i2c: add dt support for i2c1 controller
  dt: omap4: add soc file for handling i2c controllers
  dt: omap4: panda board: set clock freq for i2c devices
  dt: omap4: add generic board file for dt support
  dt: omap4: enable dt support for i2c1 controller
  dt: omap: i2c: dt usage model documentation

 Documentation/devicetree/bindings/i2c/omap-i2c.txt |   57 +
 arch/arm/boot/dts/omap3-beagle-nunchuck.dts|   13 +---
 arch/arm/boot/dts/omap3-beagle.dts |   18 -
 arch/arm/boot/dts/omap3.dtsi   |   62 ++
 arch/arm/boot/dts/omap4-panda.dts  |   25 --
 arch/arm/boot/dts/omap4.dtsi   |   68 
 arch/arm/mach-omap2/Kconfig|   22 +
 arch/arm/mach-omap2/Makefile   |2 +
 arch/arm/mach-omap2/board-omap3-dt.c   |   84 
 arch/arm/mach-omap2/board-omap3beagle.c|   13 ---
 arch/arm/mach-omap2/board-omap4-dt.c   |   75 +
 arch/arm/mach-omap2/board-omap4panda.c |6 --
 arch/arm/mach-omap2/devices.c  |2 +-
 arch/arm/mach-omap2/mcbsp.c|2 +-
 arch/arm/plat-omap/include/plat/omap_device.h  |   11 +++-
 arch/arm/plat-omap/omap_device.c   |   46 ++-
 drivers/i2c/busses/i2c-omap.c  |   23 +-
 drivers/of/platform.c  |   41 ++
 include/linux/of_platform.h|5 +
 19 files changed, 526 insertions(+), 49 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/i2c/omap-i2c.txt
 create mode 100644 arch/arm/boot/dts/omap3.dtsi
 create mode 100644 arch/arm/boot/dts/omap4.dtsi
 create mode 100644 arch/arm/mach-omap2/board-omap3-dt.c
 create mode 100644 arch/arm/mach-omap2/board-omap4-dt.c

-- 
1.7.4.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC/PATCH v2 01/13] OMAP: omap_device: Add device tree node pointer

2011-08-22 Thread G, Manjunath Kondaiah

The omap_device requires new omap_device api to be added in order
to support omap dt.

The new api is added and new parameter device node pointer np is added
to existing api. The users of omap_device api is changed accordingly.

Build and boot tested on omap3 beagle for both dt and not dt build.

Signed-off-by: G, Manjunath Kondaiah manj...@ti.com
---
 arch/arm/mach-omap2/devices.c |2 +-
 arch/arm/mach-omap2/mcbsp.c   |2 +-
 arch/arm/plat-omap/include/plat/omap_device.h |   11 +-
 arch/arm/plat-omap/omap_device.c  |   46 +++--
 4 files changed, 55 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 10adf66..d23e4bc 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -92,7 +92,7 @@ static int __init omap4_l3_init(void)
pr_err(could not look up %s\n, oh_name);
}
 
-   pdev = omap_device_build_ss(omap_l3_noc, 0, oh, 3, NULL,
+   pdev = omap_device_build_ss(NULL, omap_l3_noc, 0, oh, 3, NULL,
 0, NULL, 0, 0);
 
WARN(IS_ERR(pdev), could not build omap_device for %s\n, oh_name);
diff --git a/arch/arm/mach-omap2/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c
index 7a42f32..98eb95d 100644
--- a/arch/arm/mach-omap2/mcbsp.c
+++ b/arch/arm/mach-omap2/mcbsp.c
@@ -144,7 +144,7 @@ static int omap_init_mcbsp(struct omap_hwmod *oh, void 
*unused)
(struct omap_mcbsp_dev_attr *)(oh-dev_attr))-sidetone);
count++;
}
-   pdev = omap_device_build_ss(name, id, oh_device, count, pdata,
+   pdev = omap_device_build_ss(NULL, name, id, oh_device, count, pdata,
sizeof(*pdata), omap2_mcbsp_latency,
ARRAY_SIZE(omap2_mcbsp_latency), false);
kfree(pdata);
diff --git a/arch/arm/plat-omap/include/plat/omap_device.h 
b/arch/arm/plat-omap/include/plat/omap_device.h
index d4d9b96..37c231d 100644
--- a/arch/arm/plat-omap/include/plat/omap_device.h
+++ b/arch/arm/plat-omap/include/plat/omap_device.h
@@ -33,6 +33,7 @@
 
 #include linux/kernel.h
 #include linux/platform_device.h
+#include linux/of.h
 
 #include plat/omap_hwmod.h
 
@@ -94,12 +95,20 @@ struct platform_device *omap_device_build(const char 
*pdev_name, int pdev_id,
  struct omap_device_pm_latency *pm_lats,
  int pm_lats_cnt, int is_early_device);
 
-struct platform_device *omap_device_build_ss(const char *pdev_name, int 
pdev_id,
+struct platform_device *omap_device_build_ss(struct device_node *np,
+const char *pdev_name, int pdev_id,
 struct omap_hwmod **oh, int oh_cnt,
 void *pdata, int pdata_len,
 struct omap_device_pm_latency *pm_lats,
 int pm_lats_cnt, int is_early_device);
 
+struct platform_device *omap_device_build_dt(struct device_node *np,
+ const char *pdev_name, int pdev_id,
+ struct omap_hwmod *oh, void *pdata,
+ int pdata_len,
+ struct omap_device_pm_latency *pm_lats,
+ int pm_lats_cnt, int is_early_device);
+
 void __iomem *omap_device_get_rt_va(struct omap_device *od);
 
 /* OMAP PM interface */
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
index d8f2299..3347115 100644
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/plat-omap/omap_device.c
@@ -85,6 +85,7 @@
 #include linux/clk.h
 #include linux/clkdev.h
 #include linux/pm_runtime.h
+#include linux/of_device.h
 
 #include plat/omap_device.h
 #include plat/omap_hwmod.h
@@ -391,6 +392,7 @@ static int omap_device_fill_resources(struct omap_device 
*od,
 /**
  * omap_device_build - build and register an omap_device with one omap_hwmod
  * @pdev_name: name of the platform_device driver to use
+ * @np: device node pointer for attaching it to of_node pointer
  * @pdev_id: this platform_device's connection ID
  * @oh: ptr to the single omap_hwmod that backs this omap_device
  * @pdata: platform_data ptr to associate with the platform_device
@@ -405,7 +407,8 @@ static int omap_device_fill_resources(struct omap_device 
*od,
  * information.  Returns ERR_PTR(-EINVAL) if @oh is NULL; otherwise,
  * passes along the return value of omap_device_build_ss().
  */
-struct platform_device *omap_device_build(const char *pdev_name, int pdev_id,
+struct platform_device *omap_device_build_dt(struct device_node *np,
+ const char *pdev_name, int pdev_id,
  struct omap_hwmod *oh, void *pdata,
  

[RFC/PATCH v2 02/13] dt: Add pd_size to AUXDATA structure

2011-08-22 Thread G, Manjunath Kondaiah

Add pd_size in the AUXDATA structure so that omap HWMOD which require
platform_data size can pass along with AUXDATA.

Signed-off-by: G, Manjunath Kondaiah manj...@ti.com
---
 drivers/of/platform.c   |2 ++
 include/linux/of_platform.h |5 +
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index b030fd5..e50ffcb 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -565,6 +565,7 @@ static int of_platform_bus_create(struct device_node *bus,
struct platform_device *dev;
const char *bus_id = NULL;
void *platform_data = NULL;
+   int pd_size;
int id = -1;
int rc = 0;
 
@@ -588,6 +589,7 @@ static int of_platform_bus_create(struct device_node *bus,
bus_id = auxdata-name;
id = auxdata-id;
platform_data = auxdata-platform_data;
+   pd_size = auxdata-pd_size;
}
 
if (of_device_is_compatible(bus, arm,primecell)) {
diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h
index 252246c..a3be980 100644
--- a/include/linux/of_platform.h
+++ b/include/linux/of_platform.h
@@ -47,6 +47,7 @@ struct of_dev_auxdata {
char *name;
int id;
void *platform_data;
+   int pd_size;
 };
 
 /* Macro to simplify populating a lookup table */
@@ -58,6 +59,10 @@ struct of_dev_auxdata {
{ .compatible = _compat, .phys_addr = _phys, .name = _name, \
  .id = _id, .platform_data = _pdata }
 
+#define OF_DEV_AUXDATA_ID_PDSIZE(_compat,_phys,_name,_id,_pdata,_pd_size) \
+   { .compatible = _compat, .phys_addr = _phys, .name = _name, \
+ .id = _id, .platform_data = _pdata, .pd_size = _pd_size }
+
 /**
  * of_platform_driver - Legacy of-aware driver for platform devices.
  *
-- 
1.7.4.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC/PATCH v2 03/13] dt: omap3: add soc file for handling i2c controllers

2011-08-22 Thread G, Manjunath Kondaiah

Add omap3 soc file for handling omap3 soc i2c controllers existing
on l4-core bus.

Signed-off-by: G, Manjunath Kondaiah manj...@ti.com
---
 arch/arm/boot/dts/omap3.dtsi |   62 ++
 1 files changed, 62 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/omap3.dtsi

diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
new file mode 100644
index 000..9ea8257
--- /dev/null
+++ b/arch/arm/boot/dts/omap3.dtsi
@@ -0,0 +1,62 @@
+/*
+ * Device Tree Source for OMAP3 SoC
+ *
+ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2.  This program is licensed as is without any warranty of any
+ * kind, whether express or implied.
+ */
+
+/dts-v1/;
+/include/ skeleton.dtsi
+
+/ {
+   #address-cells = 1;
+   #size-cells = 1;
+   model = ti,omap3;
+
+   aliases {
+   i2c1 = i2c1;
+   i2c2 = i2c2;
+   i2c3 = i2c3;
+   };
+
+   l4-core {
+   compatible = ti,omap3-l4-core, sonics,s3220;
+   #address-cells = 1;
+   #size-cells = 1;
+   ranges = 0 0x4800 0x100;
+
+   i2c1: i2c@7 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = ti,omap-i2c;
+   reg = 0x7 0x100;
+   interrupts =  88 ;
+   };
+
+   i2c2: i2c@72000 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = ti,omap-i2c;
+   reg = 0x72000 0x100;
+   interrupts =  89 ;
+   };
+
+   i2c3: i2c@6 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = ti,omap-i2c;
+   reg = 0x6 0x100;
+   interrupts =  93 ;
+   };
+   };
+
+   l4-per {
+   compatible = ti,l4-per;
+   #address-cells = 1;
+   #size-cells = 1;
+   ranges = 0 0x4900 0x10;
+   };
+};
-- 
1.7.4.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC/PATCH v2 04/13] dt: omap3: beagle board: set clock freq for i2c devices

2011-08-22 Thread G, Manjunath Kondaiah

Update omap3 beagle dts file with required clock frequencies for the i2c
client devices existing on beagle board.

Beagle custom board dts file is cleaned up so that it can coexist with omap3
soc dts file.

Signed-off-by: G, Manjunath Kondaiah manj...@ti.com
---
 arch/arm/boot/dts/omap3-beagle-nunchuck.dts |   13 ++---
 arch/arm/boot/dts/omap3-beagle.dts  |   18 +++---
 2 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/arch/arm/boot/dts/omap3-beagle-nunchuck.dts 
b/arch/arm/boot/dts/omap3-beagle-nunchuck.dts
index 2607be5..c693163 100644
--- a/arch/arm/boot/dts/omap3-beagle-nunchuck.dts
+++ b/arch/arm/boot/dts/omap3-beagle-nunchuck.dts
@@ -1,16 +1,7 @@
-/include/ omap3-beagle.dts
+/include/ omap3.dtsi
 
 / {
-   i2c@48072000 {
-   compatible = ti,omap3-i2c;
-   reg = 0x48072000 0x80;
-   #address-cells = 1;
-   #size-cells = 0;
-
-   eeprom@50 {
-   compatible = at,at24c01;
-   reg =  0x50 ;
-   };
+   i2c@2 {
joystick@52 {
compatible = sparkfun,wiichuck;
reg =  0x52 ;
diff --git a/arch/arm/boot/dts/omap3-beagle.dts 
b/arch/arm/boot/dts/omap3-beagle.dts
index 4439466..c232c52 100644
--- a/arch/arm/boot/dts/omap3-beagle.dts
+++ b/arch/arm/boot/dts/omap3-beagle.dts
@@ -1,7 +1,19 @@
-/dts-v1/;
-/include/ skeleton.dtsi
+/include/ omap3.dtsi
 
 / {
model = TI OMAP3 BeagleBoard;
-   compatible = ti,omap3-beagle;
+   compatible = ti,omap3-beagle, ti,omap3;
+
+
+   i2c1 {
+   clock-frequency = 260;
+   };
+
+   i2c2 {
+   clock-frequency = 40;
+   };
+
+   i2c3 {
+   clock-frequency = 40;
+   };
 };
-- 
1.7.4.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC/PATCH v2 05/13] dt: omap3: add generic board file for dt support

2011-08-22 Thread G, Manjunath Kondaiah

The generic board file is created and derived from beagle board file.
The beagle board file is migrated to boot from flattened device tree and
the cleanup of board specific file will happen in different stages.

The changes here focus on minimal configuration to boot beagle board with
dt enabled which provides basic platform for converting device drivers for
using dt.

Signed-off-by: G, Manjunath Kondaiah manj...@ti.com
---
 arch/arm/mach-omap2/Kconfig |   11 
 arch/arm/mach-omap2/Makefile|1 +
 arch/arm/mach-omap2/board-omap3-dt.c|   84 +++
 arch/arm/mach-omap2/board-omap3beagle.c |   13 -
 4 files changed, 96 insertions(+), 13 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-omap3-dt.c

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 57b66d5..4fbb54d 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -305,6 +305,17 @@ config MACH_OMAP_3630SDP
default y
select OMAP_PACKAGE_CBP
 
+config MACH_OMAP3_DT
+   bool Generic OMAP3 board(FDT support)
+   depends on ARCH_OMAP3
+   select OMAP_PACKAGE_CBB
+   select USE_OF
+
+   help
+ Support for generic TI OMAP3 boards using Flattened Device Tree.
+ Say Y here to enable OMAP3 device tree support
+ More information at Documentation/devicetree
+
 config MACH_TI8168EVM
bool TI8168 Evaluation Module
depends on SOC_OMAPTI816X
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index b1501bd..e702e47 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -197,6 +197,7 @@ obj-$(CONFIG_MACH_OVERO)+= board-overo.o
 obj-$(CONFIG_MACH_OMAP3EVM)+= board-omap3evm.o
 obj-$(CONFIG_MACH_OMAP3_PANDORA)   += board-omap3pandora.o
 obj-$(CONFIG_MACH_OMAP_3430SDP)+= board-3430sdp.o
+obj-$(CONFIG_MACH_OMAP3_DT)+= board-omap3-dt.o
 obj-$(CONFIG_MACH_NOKIA_N8X0)  += board-n8x0.o
 obj-$(CONFIG_MACH_NOKIA_RM680) += board-rm680.o \
   sdram-nokia.o
diff --git a/arch/arm/mach-omap2/board-omap3-dt.c 
b/arch/arm/mach-omap2/board-omap3-dt.c
new file mode 100644
index 000..72c59a4
--- /dev/null
+++ b/arch/arm/mach-omap2/board-omap3-dt.c
@@ -0,0 +1,84 @@
+/*
+ * TI OMAP3 device tree board support
+ *
+ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include linux/platform_device.h
+#include linux/err.h
+#include linux/gpio.h
+#include linux/of_platform.h
+#include linux/of_address.h
+
+#include linux/regulator/machine.h
+#include linux/i2c/twl.h
+
+#include asm/mach/arch.h
+
+#include plat/common.h
+#include plat/omap_device.h
+
+#include mux.h
+#include common-board-devices.h
+#include hsmmc.h
+
+#include sdram-micron-mt46h32m32lf-6.h
+
+static struct twl4030_platform_data beagle_twldata = {
+   .irq_base   = TWL4030_IRQ_BASE,
+   .irq_end= TWL4030_IRQ_END,
+
+   /* platform_data for children goes here */
+};
+
+static int __init omap3_beagle_i2c_init(void)
+{
+   omap3_pmic_init(twl4030, beagle_twldata);
+   return 0;
+}
+
+static void __init omap3_init_early(void)
+{
+   omap2_init_common_infrastructure();
+   omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
+ mt46h32m32lf6_sdrc_params);
+}
+
+#ifdef CONFIG_OMAP_MUX
+static struct omap_board_mux board_mux[] __initdata = {
+   { .reg_offset = OMAP_MUX_TERMINATOR },
+};
+#endif
+
+static struct of_device_id omap_dt_match_table[] __initdata = {
+   { .compatible = ti,omap3-l4-core, },
+   {}
+};
+
+static void __init omap3_init(void)
+{
+   omap3_beagle_i2c_init();
+   omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
+   omap_serial_init();
+
+   of_platform_populate(NULL, omap_dt_match_table, NULL, NULL);
+}
+
+static const char *omap3_dt_match[] __initdata = {
+   ti,omap3,
+   NULL
+};
+
+DT_MACHINE_START(OMAP3_DT, TI OMAP3 (Flattened Device Tree))
+   .reserve= omap_reserve,
+   .map_io = omap3_map_io,
+   .init_early = omap3_init_early,
+   .init_irq   = omap3_init_irq,
+   .init_machine   = omap3_init,
+   .timer  = omap3_timer,
+   .dt_compat  = omap3_dt_match,
+MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c 
b/arch/arm/mach-omap2/board-omap3beagle.c
index 268c826..a845e9e 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -19,7 +19,6 @@
 #include linux/err.h
 #include linux/clk.h
 #include linux/io.h
-#include linux/of_platform.h
 #include linux/leds.h
 #include linux/gpio.h
 #include linux/input.h
@@ -388,9 

[RFC/PATCH v2 06/13] dt: omap3: add omap-device compatible property

2011-08-22 Thread G, Manjunath Kondaiah

Add omap-device to the i2c controllers compatible property.

Signed-off-by: G, Manjunath Kondaiah manj...@ti.com
---
 arch/arm/boot/dts/omap3.dtsi |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
index 9ea8257..f64c63d 100644
--- a/arch/arm/boot/dts/omap3.dtsi
+++ b/arch/arm/boot/dts/omap3.dtsi
@@ -31,7 +31,7 @@
i2c1: i2c@7 {
#address-cells = 1;
#size-cells = 0;
-   compatible = ti,omap-i2c;
+   compatible = ti,omap-i2c, ti,omap-device;
reg = 0x7 0x100;
interrupts =  88 ;
};
@@ -39,7 +39,7 @@
i2c2: i2c@72000 {
#address-cells = 1;
#size-cells = 0;
-   compatible = ti,omap-i2c;
+   compatible = ti,omap-i2c, ti,omap-device;
reg = 0x72000 0x100;
interrupts =  89 ;
};
@@ -47,7 +47,7 @@
i2c3: i2c@6 {
#address-cells = 1;
#size-cells = 0;
-   compatible = ti,omap-i2c;
+   compatible = ti,omap-i2c, ti,omap-device;
reg = 0x6 0x100;
interrupts =  93 ;
};
-- 
1.7.4.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC/PATCH v2 07/13] dt: omap: create platform bus for omap devices

2011-08-22 Thread G, Manjunath Kondaiah

The omap devices will use HWMOD for fetching device information
hence it needs to be handled seperately during platform bus
creation during dt build.

Signed-off-by: G, Manjunath Kondaiah manj...@ti.com
---
 drivers/of/platform.c |   41 -
 1 files changed, 40 insertions(+), 1 deletions(-)

diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index e50ffcb..bd2c089 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -24,6 +24,10 @@
 #include linux/of_platform.h
 #include linux/platform_device.h
 
+#ifdef CONFIG_ARCH_OMAP2PLUS
+#include plat/omap_device.h
+#endif
+
 const struct of_device_id of_default_bus_match_table[] = {
{ .compatible = simple-bus, },
 #ifdef CONFIG_ARM_AMBA
@@ -544,6 +548,36 @@ static const struct of_dev_auxdata *of_dev_lookup(const 
struct of_dev_auxdata *l
return NULL;
 }
 
+static struct omap_device_pm_latency omap_device_latency[] = {
+   [0] = {
+   .deactivate_func= omap_device_idle_hwmods,
+   .activate_func  = omap_device_enable_hwmods,
+   .flags  = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
+   },
+};
+
+int of_omap_device_create(struct device_node *np, const char *name, int id,
+   void *platform_data,
+   int pd_size)
+{
+   struct omap_hwmod *oh;
+   struct platform_device *pdev;
+
+   oh = omap_hwmod_lookup(name);
+   if (!oh) {
+   pr_err(Could not look up %s\n, name);
+   return -EEXIST;
+   }
+
+   pdev = omap_device_build_dt(np, name, id, oh, platform_data,
+   sizeof(platform_data), omap_device_latency,
+   ARRAY_SIZE(omap_device_latency), 0);
+   WARN(IS_ERR(pdev), Could not build omap_device for %s\n, name);
+
+   pr_info(DT: omap_device build for %s is successful\n, name);
+   return PTR_ERR(pdev);
+}
+
 /**
  * of_platform_bus_create() - Create a device for a node and its children.
  * @bus: device node of the bus to instantiate
@@ -565,7 +599,7 @@ static int of_platform_bus_create(struct device_node *bus,
struct platform_device *dev;
const char *bus_id = NULL;
void *platform_data = NULL;
-   int pd_size;
+   int pd_size = 0;
int id = -1;
int rc = 0;
 
@@ -597,6 +631,11 @@ static int of_platform_bus_create(struct device_node *bus,
return 0;
}
 
+   if (of_device_is_compatible(bus, ti,omap-device)) {
+   of_omap_device_create(bus, bus_id, id, platform_data, pd_size);
+   return 0;
+   }
+
dev = of_platform_device_create_pdata(bus, bus_id, platform_data, 
parent);
 
/* override the id if auxdata gives an id */
-- 
1.7.4.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC/PATCH v2 08/13] dt: omap: i2c: add dt support for i2c1 controller

2011-08-22 Thread G, Manjunath Kondaiah

The device tree support has been added to i2c1 controller and
corresponding i2c initilization in generic board file is cleaned
up so that platfom device is registered through dt and omap device
and not through board i2c initilization.

These changes will not affect non dt builds and existing functionality
is retained.

Tested with dt and non dt builds and boot tested on beagle board.

Signed-off-by: G, Manjunath Kondaiah manj...@ti.com
---
 arch/arm/mach-omap2/board-omap3-dt.c |   14 +++---
 drivers/i2c/busses/i2c-omap.c|   23 ---
 2 files changed, 27 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap3-dt.c 
b/arch/arm/mach-omap2/board-omap3-dt.c
index 72c59a4..cd11224 100644
--- a/arch/arm/mach-omap2/board-omap3-dt.c
+++ b/arch/arm/mach-omap2/board-omap3-dt.c
@@ -35,11 +35,11 @@ static struct twl4030_platform_data beagle_twldata = {
/* platform_data for children goes here */
 };
 
-static int __init omap3_beagle_i2c_init(void)
-{
-   omap3_pmic_init(twl4030, beagle_twldata);
-   return 0;
-}
+struct of_dev_auxdata omap3_auxdata_lookup[] __initdata = {
+   OF_DEV_AUXDATA_ID_PDSIZE(ti,omap-i2c, 0x4807, i2c1, 1,\
+   beagle_twldata, sizeof(beagle_twldata)),
+   {}
+};
 
 static void __init omap3_init_early(void)
 {
@@ -61,11 +61,11 @@ static struct of_device_id omap_dt_match_table[] __initdata 
= {
 
 static void __init omap3_init(void)
 {
-   omap3_beagle_i2c_init();
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
omap_serial_init();
 
-   of_platform_populate(NULL, omap_dt_match_table, NULL, NULL);
+   of_platform_populate(NULL, omap_dt_match_table, omap3_auxdata_lookup,
+NULL);
 }
 
 static const char *omap3_dt_match[] __initdata = {
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index 2a072ff..9e98014 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -38,6 +38,7 @@
 #include linux/clk.h
 #include linux/io.h
 #include linux/of_i2c.h
+#include linux/of_device.h
 #include linux/slab.h
 #include linux/i2c-omap.h
 #include linux/pm_runtime.h
@@ -972,6 +973,16 @@ static const struct i2c_algorithm omap_i2c_algo = {
.functionality  = omap_i2c_func,
 };
 
+#if defined(CONFIG_OF)
+static const struct of_device_id omap_i2c_of_match[] = {
+   {.compatible = ti,omap-i2c, },
+   {},
+}
+MODULE_DEVICE_TABLE(of, omap_i2c_of_match);
+#else
+#define omap_i2c_of_match NULL
+#endif
+
 static int __devinit
 omap_i2c_probe(struct platform_device *pdev)
 {
@@ -1008,12 +1019,17 @@ omap_i2c_probe(struct platform_device *pdev)
goto err_release_region;
}
 
+   speed = 100;/* Default speed */
if (pdata != NULL) {
speed = pdata-clkrate;
dev-set_mpu_wkup_lat = pdata-set_mpu_wkup_lat;
-   } else {
-   speed = 100;/* Default speed */
-   dev-set_mpu_wkup_lat = NULL;
+#if defined(CONFIG_OF)
+   } else if (pdev-dev.of_node) {
+   u32 prop;
+   if (!of_property_read_u32(pdev-dev.of_node, clock-frequency,
+   prop))
+   speed = prop/100;
+#endif
}
 
dev-speed = speed;
@@ -1178,6 +1194,7 @@ static struct platform_driver omap_i2c_driver = {
.name   = omap_i2c,
.owner  = THIS_MODULE,
.pm = OMAP_I2C_PM_OPS,
+   .of_match_table = omap_i2c_of_match,
},
 };
 
-- 
1.7.4.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC/PATCH v2 09/13] dt: omap4: add soc file for handling i2c controllers

2011-08-22 Thread G, Manjunath Kondaiah

Add omap4 soc dts file for handling omap4 soc i2c
controllers existing on l4-core bus.

Signed-off-by: G, Manjunath Kondaiah manj...@ti.com
---
 arch/arm/boot/dts/omap4-panda.dts |7 +---
 arch/arm/boot/dts/omap4.dtsi  |   68 +
 2 files changed, 69 insertions(+), 6 deletions(-)
 create mode 100644 arch/arm/boot/dts/omap4.dtsi

diff --git a/arch/arm/boot/dts/omap4-panda.dts 
b/arch/arm/boot/dts/omap4-panda.dts
index 58909e9..c28aa95 100644
--- a/arch/arm/boot/dts/omap4-panda.dts
+++ b/arch/arm/boot/dts/omap4-panda.dts
@@ -1,9 +1,4 @@
-/dts-v1/;
-
-/memreserve/ 0x9D00 0x0300; /* Frame buffer */
-/memreserve/ 0xB000 0x1000; /* Top 256MB is unaccessable */
-
-/include/ skeleton.dtsi
+/include/ omap4.dtsi
 
 / {
model = TI OMAP4 PandaBoard;
diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
new file mode 100644
index 000..cb055f5
--- /dev/null
+++ b/arch/arm/boot/dts/omap4.dtsi
@@ -0,0 +1,68 @@
+/*
+ * Device Tree Source for OMAP4 SoC
+ *
+ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2.  This program is licensed as is without any warranty of any
+ * kind, whether express or implied.
+ */
+
+/dts-v1/;
+
+/memreserve/ 0x9D00 0x0300; /* Frame buffer */
+/memreserve/ 0xB000 0x1000; /* Top 256MB is unaccessable */
+
+/include/ skeleton.dtsi
+
+/ {
+   #address-cells = 1;
+   #size-cells = 1;
+   model = ti,omap4;
+
+   aliases {
+   i2c1 = i2c1;
+   i2c2 = i2c2;
+   i2c3 = i2c3;
+   i2c4 = i2c4;
+   };
+
+   l4-core {
+   compatible = ti,omap4-l4-core, sonics,s3220;
+   #address-cells = 1;
+   #size-cells = 1;
+   ranges = 0 0x4800 0x100;
+
+   i2c1: i2c@7 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = ti,omap-i2c, ti,omap-device;
+   reg = 0x7 0x100;
+   interrupts =  88 ;
+   };
+
+   i2c2: i2c@72000 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = ti,omap-i2c, ti,omap-device;
+   reg = 0x72000 0x100;
+   interrupts =  89 ;
+   };
+
+   i2c3: i2c@6 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = ti,omap-i2c, ti,omap-device;
+   reg = 0x6 0x100;
+   interrupts =  93 ;
+   };
+
+   i2c4: i2c@35 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = ti,omap-i2c, ti,omap-device;
+   reg = 0x35 0x100;
+   interrupts =  94 ;
+   };
+   };
+};
-- 
1.7.4.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC/PATCH v2 10/13] dt: omap4: panda board: set clock freq for i2c devices

2011-08-22 Thread G, Manjunath Kondaiah

Update omap4 panda dts file with required clock frequencies
for the i2c client devices existing on panda board.

Signed-off-by: G, Manjunath Kondaiah manj...@ti.com
---
 arch/arm/boot/dts/omap4-panda.dts |   16 
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/omap4-panda.dts 
b/arch/arm/boot/dts/omap4-panda.dts
index c28aa95..6b831ca 100644
--- a/arch/arm/boot/dts/omap4-panda.dts
+++ b/arch/arm/boot/dts/omap4-panda.dts
@@ -3,4 +3,20 @@
 / {
model = TI OMAP4 PandaBoard;
compatible = ti,omap4-panda, ti,omap4430;
+
+   i2c1 {
+   clock-frequency = 40;
+   };
+
+   i2c2 {
+   clock-frequency = 40;
+   };
+
+   i2c3 {
+   clock-frequency = 40;
+   };
+
+   i2c4 {
+   clock-frequency = 40;
+   };
 };
-- 
1.7.4.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC/PATCH v2 11/13] dt: omap4: add generic board file for dt support

2011-08-22 Thread G, Manjunath Kondaiah

The generic board file is created and derived from omap4 panda board file.

The changes here focus on minimal configuration to boot panda board with
dt enabled which provides basic platform for converting device drivers for
using dt.

Signed-off-by: G, Manjunath Kondaiah manj...@ti.com
---
 arch/arm/boot/dts/omap4-panda.dts  |2 +-
 arch/arm/mach-omap2/Kconfig|   11 +
 arch/arm/mach-omap2/Makefile   |1 +
 arch/arm/mach-omap2/board-omap4-dt.c   |   66 
 arch/arm/mach-omap2/board-omap4panda.c |6 ---
 5 files changed, 79 insertions(+), 7 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-omap4-dt.c

diff --git a/arch/arm/boot/dts/omap4-panda.dts 
b/arch/arm/boot/dts/omap4-panda.dts
index 6b831ca..9d1b17c 100644
--- a/arch/arm/boot/dts/omap4-panda.dts
+++ b/arch/arm/boot/dts/omap4-panda.dts
@@ -2,7 +2,7 @@
 
 / {
model = TI OMAP4 PandaBoard;
-   compatible = ti,omap4-panda, ti,omap4430;
+   compatible = ti,omap4-panda, ti,omap4;
 
i2c1 {
clock-frequency = 40;
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 4fbb54d..853b14c 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -337,6 +337,17 @@ config MACH_OMAP4_PANDA
select OMAP_PACKAGE_CBS
select REGULATOR_FIXED_VOLTAGE
 
+config MACH_OMAP4_DT
+   bool Generic OMAP4 board(FDT support)
+   depends on ARCH_OMAP4
+   select OMAP_PACKAGE_CBB
+   select USE_OF
+
+   help
+ Support for generic TI OMAP4 boards using Flattened Device Tree.
+ Say Y here to enable OMAP3 device tree support
+ More information at Documentation/devicetree
+
 config OMAP3_EMU
bool OMAP3 debugging peripherals
depends on ARCH_OMAP3
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index e702e47..8b8c29c 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -198,6 +198,7 @@ obj-$(CONFIG_MACH_OMAP3EVM) += board-omap3evm.o
 obj-$(CONFIG_MACH_OMAP3_PANDORA)   += board-omap3pandora.o
 obj-$(CONFIG_MACH_OMAP_3430SDP)+= board-3430sdp.o
 obj-$(CONFIG_MACH_OMAP3_DT)+= board-omap3-dt.o
+obj-$(CONFIG_MACH_OMAP4_DT)+= board-omap4-dt.o
 obj-$(CONFIG_MACH_NOKIA_N8X0)  += board-n8x0.o
 obj-$(CONFIG_MACH_NOKIA_RM680) += board-rm680.o \
   sdram-nokia.o
diff --git a/arch/arm/mach-omap2/board-omap4-dt.c 
b/arch/arm/mach-omap2/board-omap4-dt.c
new file mode 100644
index 000..a4d296c
--- /dev/null
+++ b/arch/arm/mach-omap2/board-omap4-dt.c
@@ -0,0 +1,66 @@
+/*
+ * TI OMAP3 device tree board support
+ *
+ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include linux/kernel.h
+#include linux/init.h
+#include linux/i2c/twl.h
+
+#include mach/omap4-common.h
+#include asm/mach/arch.h
+#include asm/mach/map.h
+
+#include plat/common.h
+
+#include common-board-devices.h
+
+static void __init omap4_init_early(void)
+{
+   omap2_init_common_infrastructure();
+   omap2_init_common_devices(NULL, NULL);
+}
+
+static struct twl4030_platform_data omap4_twldata = {
+   .irq_base   = TWL6030_IRQ_BASE,
+   .irq_end= TWL6030_IRQ_END,
+};
+
+static int __init omap4_i2c_init(void)
+{
+   omap4_pmic_init(twl6030, omap4_twldata);
+   return 0;
+}
+
+static void __init omap4_init(void)
+{
+   omap4_i2c_init();
+   omap_serial_init();
+}
+
+static void __init omap4_map_io(void)
+{
+   omap2_set_globals_443x();
+   omap44xx_map_common_io();
+}
+
+static const char *omap4_match[] __initdata = {
+   ti,omap4,
+   NULL,
+};
+
+DT_MACHINE_START(OMAP4_DT, TI OMAP4 (Flattened Device Tree))
+   .boot_params= 0x8100,
+   .reserve= omap_reserve,
+   .map_io = omap4_map_io,
+   .init_early = omap4_init_early,
+   .init_irq   = gic_init_irq,
+   .init_machine   = omap4_init,
+   .timer  = omap4_timer,
+   .dt_compat  = omap4_match,
+MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap4panda.c 
b/arch/arm/mach-omap2/board-omap4panda.c
index 1c583c7..9aaa960 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -581,11 +581,6 @@ static void __init omap4_panda_map_io(void)
omap44xx_map_common_io();
 }
 
-static const char *omap4_panda_match[] __initdata = {
-   ti,omap4-panda,
-   NULL,
-};
-
 MACHINE_START(OMAP4_PANDA, OMAP4 Panda board)
/* Maintainer: David Anders - Texas Instruments Inc */
.boot_params= 0x8100,
@@ -595,5 +590,4 @@ MACHINE_START(OMAP4_PANDA, OMAP4 Panda board)
.init_irq   

[RFC/PATCH v2 12/13] dt: omap4: enable dt support for i2c1 controller

2011-08-22 Thread G, Manjunath Kondaiah

Enable dt support for omap4 i2c1 controller and cleanup
legacy i2c device registration in omap4 generic board file.

Signed-off-by: G, Manjunath Kondaiah manj...@ti.com
---
 arch/arm/mach-omap2/board-omap4-dt.c |   21 +++--
 1 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap4-dt.c 
b/arch/arm/mach-omap2/board-omap4-dt.c
index a4d296c..9ade238 100644
--- a/arch/arm/mach-omap2/board-omap4-dt.c
+++ b/arch/arm/mach-omap2/board-omap4-dt.c
@@ -11,6 +11,8 @@
 #include linux/kernel.h
 #include linux/init.h
 #include linux/i2c/twl.h
+#include linux/of_platform.h
+#include linux/of_address.h
 
 #include mach/omap4-common.h
 #include asm/mach/arch.h
@@ -31,16 +33,23 @@ static struct twl4030_platform_data omap4_twldata = {
.irq_end= TWL6030_IRQ_END,
 };
 
-static int __init omap4_i2c_init(void)
-{
-   omap4_pmic_init(twl6030, omap4_twldata);
-   return 0;
-}
+struct of_dev_auxdata omap4_auxdata_lookup[] __initdata = {
+   OF_DEV_AUXDATA_ID_PDSIZE(ti,omap-i2c, 0x4807, i2c1, 1,\
+   omap4_twldata, sizeof(omap4_twldata)),
+   {}
+};
+
+static struct of_device_id omap_dt_match_table[] __initdata = {
+   { .compatible = ti,omap4-l4-core, },
+   {}
+};
 
 static void __init omap4_init(void)
 {
-   omap4_i2c_init();
omap_serial_init();
+
+   of_platform_populate(NULL, omap_dt_match_table, omap4_auxdata_lookup,
+NULL);
 }
 
 static void __init omap4_map_io(void)
-- 
1.7.4.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC/PATCH v2 13/13] dt: omap: i2c: dt usage model documentation

2011-08-22 Thread G, Manjunath Kondaiah

Add documentation for using omap i2c controller with device
tree support enabled.

Signed-off-by: G, Manjunath Kondaiah manj...@ti.com
---
 Documentation/devicetree/bindings/i2c/omap-i2c.txt |   57 
 1 files changed, 57 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/i2c/omap-i2c.txt

diff --git a/Documentation/devicetree/bindings/i2c/omap-i2c.txt 
b/Documentation/devicetree/bindings/i2c/omap-i2c.txt
new file mode 100644
index 000..f427445
--- /dev/null
+++ b/Documentation/devicetree/bindings/i2c/omap-i2c.txt
@@ -0,0 +1,57 @@
+* OMAP I2C
+--
+
+The OMAP SoC's has multiple I2C controllers and each controller can
+have I2C child devices.
+
+Required properties :
+
+ - clock-frequency : desired I2C bus clock frequency in Hz.
+ - compatible : should be ti,omap-i2c
+
+Recommended properties :
+
+ - reg : Offset and length of the register set for the device
+ - interrupts : a b where a is the interrupt number and b is a
+   field that represents an encoding of the sense and level
+   information for the interrupt.  This should be encoded based on
+   the information in section 2) depending on the type of interrupt
+   controller you have.
+ - interrupt-parent : the phandle for the interrupt controller that
+   services interrupts for this device.
+
+Optional:
+The driver platform data can not be passed through device tree as of
+now hence aux data structure can be used in board files. The aux data
+is temparory solution and plan is to move it to device tree dts file.
+
+Note: Current implementation uses only clock-frequency field from
+device tree blob and all other data will be fetched from omap hwmod
+data base during device registration. Future plan is to migrate hwmod
+data base contents into device tree blob so that, all the required
+data will be used from device tree dts file.
+
+Examples :
+
+   /* OMAP4 based board */
+   #address-cells = 1;
+   #size-cells = 1;
+   ranges = 0 0x4800 0x100;
+
+   i2c1: i2c@7 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = ti,omap-i2c, ti,omap-device;
+   reg = 0x7 0x100;
+   interrupts =  88 ;
+   clock-frequency = 40;
+   };
+
+   i2c2: i2c@72000 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = ti,omap-i2c, ti,omap-device;
+   reg = 0x72000 0x100;
+   interrupts =  89 ;
+   clock-frequency = 40;
+   };
-- 
1.7.4.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] tty: omap-serial: fix boot hang by converting to use a threaded IRQ handler (was Re: [PATCH] irq: always set IRQF_ONESHOT if no primary handler is specified)

2011-08-22 Thread Paul Walmsley

Convert the omap-serial hardirq handler to a threaded IRQ handler. Without 
this patch, OMAP boards which use the on-board OMAP UARTs and the 
omap-serial driver will not boot to userspace after commit 
f3637a5f2e2eb391ff5757bc83fb5de8f9726464 (irq: Always set IRQF_ONESHOT if 
no primary handler is specified).  Enabling CONFIG_DEBUG_SHIRQ reveals 
'IRQ handler type mismatch' errors:

IRQ handler type mismatch for IRQ 74
current handler: serial idle
[c001b124] (unwind_backtrace+0x0/0xf0) from [c009c900] 
(__setup_irq+0x42c/0x464)
[c009c900] (__setup_irq+0x42c/0x464) from [c009ca08] 
(request_threaded_irq+0xd0/0x148)
[c009ca08] (request_threaded_irq+0xd0/0x148) from [c029d398] 
(serial_omap_startup+0x30/0x2dc)
[c029d398] (serial_omap_startup+0x30/0x2dc) from [c0295a38] 
(uart_startup+0x5c/0x1ac)

(etc.)

It turns out that the omap-serial code used one threaded IRQ
handler[1][2] and one non-threaded IRQ handler[3] that shared the same
IRQ.  During the 3.1-rc series, a patch was merged[4] that caused
IRQF_ONESHOT to be set on the threaded handler, but the non-threaded
handler did not have IRQF_ONESHOT set.  Since interrupt handlers
that share the same IRQ must also share the presence or absence of
IRQF_ONESHOT[5], this new commit caused a mismatch that prevented the
non-threaded IRQ from registering.

Fix by converting the non-threaded IRQ handler in omap-serial.c to a
threaded IRQ handler.  Ideally we would not have to make this type of
change during the -rc series, but the commit that caused this behavior
was itself merged between v3.1-rc2 and v3.1-rc3.  In the long term, it
would be good to get rid of the shared IRQ handler hack in
arch/arm/mach-omap2/serial.c.

This change has been boot-tested on OMAP3530 BeagleBoard and
OMAP4430ES2 PandaBoard, and static suspend has been lightly tested on
the BeagleBoard.

Pantelis Antoniou pantelis.anton...@gmail.com originally reported
the boot failure.

1. arch/arm/mach-omap2/serial.c line 550, as of Linux v3.1-rc3.  
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=arch/arm/mach-omap2/serial.c;h=466fc722fa0f39f03b8d93cf84e4dae4f57fd029;hb=fcb8ce5cfe30ca9ca5c9a79cdfe26d1993e65e0c#l550

2. arch/arm/mach-omap2/serial.c line 563, as of Linux v3.1-rc3.  
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=arch/arm/mach-omap2/serial.c;h=466fc722fa0f39f03b8d93cf84e4dae4f57fd029;hb=fcb8ce5cfe30ca9ca5c9a79cdfe26d1993e65e0c#l563

3. drivers/tty/serial/omap-serial.c line 464, as of Linux v3.1-rc3.  
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=drivers/tty/serial/omap-serial.c;h=c37df8d0fa2819261dffccc5bc4d0180b9531f49;hb=fcb8ce5cfe30ca9ca5c9a79cdfe26d1993e65e0c#l464

4. Commit f3637a5f2e2eb391ff5757bc83fb5de8f9726464 (irq: Always set
   IRQF_ONESHOT if no primary handler is specified)

5. Gleixner, Thomas. _[patch 2/5] genirq: Allow shared oneshot
   interrupts_.  http://lkml.org/lkml/2011/2/23/511

Signed-off-by: Paul Walmsley p...@pwsan.com
Cc: Pantelis Antoniou pantelis.anton...@gmail.com
Cc: Govindraj.R govindraj.r...@ti.com
Cc: Kevin Hilman khil...@ti.com
Cc: Thomas Gleixner t...@linutronix.de
Cc: Sebastian Andrzej Siewior bige...@linutronix.de
---
 drivers/tty/serial/omap-serial.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index c37df8d..e83a769 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -461,8 +461,8 @@ static int serial_omap_startup(struct uart_port *port)
/*
 * Allocate the IRQ
 */
-   retval = request_irq(up-port.irq, serial_omap_irq, up-port.irqflags,
-   up-name, up);
+   retval = request_threaded_irq(up-port.irq, NULL, serial_omap_irq,
+ up-port.irqflags, up-name, up);
if (retval)
return retval;
 
-- 
1.7.5.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] OMAP3: clock: indicate that gpt12_fck and wdt1_fck are in the WKUP clockdomain

2011-08-22 Thread Paul Walmsley

The oscillator that supplies GPT12_FCLK and WDT1_FCLK exists in the
WKUP powerdomain[1].  This resolves at least one boot-time warning:

omap_hwmod: gpt12_fck: missing clockdomain for gpt12_fck.

1. _OMAP34xx Multimedia High Security (HS) Device Silicon Revision 3.1.x
   Security Addendum Version K (SWPU119K)_  Figure 3-29.  August 2010.
---
 arch/arm/mach-omap2/clock3xxx_data.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/clock3xxx_data.c 
b/arch/arm/mach-omap2/clock3xxx_data.c
index ffd55b1..b9b8446 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -3078,6 +3078,7 @@ static struct clk gpt12_fck = {
.name   = gpt12_fck,
.ops= clkops_null,
.parent = secure_32k_fck,
+   .clkdm_name = wkup_clkdm,
.recalc = followparent_recalc,
 };
 
@@ -3085,6 +3086,7 @@ static struct clk wdt1_fck = {
.name   = wdt1_fck,
.ops= clkops_null,
.parent = secure_32k_fck,
+   .clkdm_name = wkup_clkdm,
.recalc = followparent_recalc,
 };
 
-- 
1.7.5.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] OMAP: clock/powerdomain/clockdomain/hwmod: fixes for 3.1-rc

2011-08-22 Thread Paul Walmsley
Hi Tony,

The following changes since commit fcb8ce5cfe30ca9ca5c9a79cdfe26d1993e65e0c:

  Linux 3.1-rc3 (2011-08-22 11:42:53 -0700)

are available in the git repository at:
  git://git.pwsan.com/linux-2.6 prcm-fixes-a-3.1rc

Note that for these changes to boot successfully on 3.1-rc3, the following 
patch is needed:

  http://marc.info/?l=linux-omapm=131407622527432w=2

The changes have been boot-tested on N800, OMAP3530 Beagle, and 
OMAP4430ES2 Panda.  They've also passed compile tests with a few different 
configs here.

Paul Walmsley (4):
  OMAP4: clock: re-enable previous clockdomain enable/disable sequence
  OMAP4: clock: fix compile warning
  OMAP3: clock: indicate that gpt12_fck and wdt1_fck are in the WKUP 
clockdomain
  Merge branches 'pwrdm_clkdm_fixes_3.1rc', 
'omap2_3_hwmod_dss_fixes_3.1rc', 'non_hwmod_compliant_fix_3.1rc', 
'omap4_clock_fixes_3.1rc' and 'omap3_clock_fixes_3.1rc' into prcm-fixes-a-3.1rc

Rajendra Nayak (1):
  OMAP: powerdomains: Make all powerdomain target states as ON at init

Santosh Shilimkar (1):
  OMAP: clockdomain: Wait for powerdomain to be ON when using clockdomain 
force wakeup

Tomi Valkeinen (5):
  OMAP2xxx: HWMOD: fix DSS opt clocks
  OMAP3: HWMOD: fix DSS opt clocks
  OMAP4: HWMOD: fix DSS opt clocks
  OMAP2/3: HWMOD: Add SYSS_HAS_RESET_STATUS for dss
  OMAP: HWMOD: Unify DSS resets for all OMAPs

 arch/arm/mach-omap2/Makefile   |5 +--
 arch/arm/mach-omap2/clock3xxx_data.c   |2 +
 arch/arm/mach-omap2/clock44xx_data.c   |   10 +-
 arch/arm/mach-omap2/clockdomain.c  |2 +
 arch/arm/mach-omap2/display.c  |   35 
 arch/arm/mach-omap2/omap_hwmod_2420_data.c |   15 +++-
 arch/arm/mach-omap2/omap_hwmod_2430_data.c |   15 +++-
 .../mach-omap2/omap_hwmod_2xxx_3xxx_ipblock_data.c |5 ++-
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |   35 +--
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |   19 ---
 arch/arm/mach-omap2/pm.c   |2 -
 arch/arm/mach-omap2/powerdomain.c  |   25 +-
 arch/arm/plat-omap/include/plat/common.h   |3 ++
 include/video/omapdss.h|7 
 14 files changed, 136 insertions(+), 44 deletions(-)
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html