Re: OMAP_DSS: DSI driver with support for video mode?

2011-04-12 Thread Vladimir Pantelic

Archit Taneja wrote:

On Tuesday 12 April 2011 01:00 AM, Juha Kuikka wrote:

 Hello,

 I am wondering if anyone has implemented DSI video mode support in the
 DSS driver? I tried to trawl the web and the mailing list archives but
 no patches come up.

 I am using DM3730.


Video mode isn't supported yet. But there are lots of custom
implementations of it over the current DSS2. One I can think of is
motorola's droid 2 and droid X source code:

https://opensource.motorola.com/sf/sfmain/do/viewProject/projects.milestone


Another one is in Archos Gen8 source code:

http://www.archos.com/support/download/software/sources/gen8-gpl-froyo.tgz

--
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] OMAP: TI816X: Add SATA support

2011-04-12 Thread Basheer, Mansoor Ahamed
Hilman, Kevin wrote:
> "Cousson, Benoit"  writes:
> 
>> On 4/7/2011 1:23 PM, Balbi, Felipe wrote:
>>> Hi,
>>> 
>>> On Thu, Apr 07, 2011 at 03:54:47PM +0530, Basheer, Mansoor Ahamed
>>> wrote: 
 @@ -100,6 +102,129 @@ static int __init omap4_l3_init(void)   }
   postcore_initcall(omap4_l3_init);
 
 +#if defined(CONFIG_SATA_AHCI_PLATFORM) || \
 +  defined(CONFIG_SATA_AHCI_PLATFORM_MODULE)
 +
 +static struct ahci_platform_data omap_sata_pdata;
 +static u64 omap_sata_dmamask = DMA_BIT_MASK(32);
 +static struct clk *omap_sata_clk;
 +
 +/* SATA PHY control register offsets */
 +#define SATA_P0PHYCR_REG  0x178
 +#define SATA_P1PHYCR_REG  0x1F8
>>> 
>>> prepend all with TI816X_
>>> 
 +#define SATA_PHY_ENPLL(x) ((x)<<  0)
 +#define SATA_PHY_MPY(x)   ((x)<<  1)
 +#define SATA_PHY_LB(x)((x)<<  5)
 +#define SATA_PHY_CLKBYP(x)((x)<<  7)
 +#define SATA_PHY_RXINVPAIR(x) ((x)<<  9)
 +#define SATA_PHY_LBK(x)   ((x)<<  10)
 +#define SATA_PHY_RXLOS(x) ((x)<<  12)
 +#define SATA_PHY_RXCDR(x) ((x)<<  13)
 +#define SATA_PHY_RXEQ(x)  ((x)<<  16)
 +#define SATA_PHY_RXENOC(x)((x)<<  20)
 +#define SATA_PHY_TXINVPAIR(x) ((x)<<  21)
 +#define SATA_PHY_TXCM(x)  ((x)<<  22)
 +#define SATA_PHY_TXSWING(x)   ((x)<<  23)
>>> 
>>> the ones which are single bits, you define as:
>>> 
>>> #define TI816X_SATA_PHY_TXINVPAIR   (1<<  21)
>>> 
>>> or
>>> 
>>> #define TI816X_SATA_PHY_TXINVPAIR   BIT(21)
>>> 
 +#define SATA_PHY_TXDE(x)  ((x)<<  27)
 +
 +#define TI816X_SATA_BASE  0x4A14
>>> 
>>> you should probably define these on some header file. Also SATA_BASE
>>> should be an increment to the global base.
>> 
>> In fact, you should even use hwmod data for that.
>> 
 +
 +static int ti816x_ahci_plat_init(struct device *dev, void __iomem
 *base) +{ +unsigned int phy_val;
 +  int ret;
 +
 +  omap_sata_clk = clk_get(dev, NULL);
 +  if (IS_ERR(omap_sata_clk)) {
 +  pr_err("ahci : Failed to get SATA clock\n");
 +  return PTR_ERR(omap_sata_clk);
 +  }
>>> 
>>> can't you use pm_runtime do achieve this ?
>>> 
 +
 +  if (!base) {
 +  pr_err("ahci : SATA reg space not mapped, PHY enable
 failed\n"); +  ret = -ENOMEM; +goto err;
 +  }
 +
 +  ret = clk_enable(omap_sata_clk);
 +  if (ret) {
 +  pr_err("ahci : Clock enable failed\n");
 +  goto err;
 +  }
>> 
>> As Felipe suggested, pm_runtime is probably the right API for that.
>> It should even potentially be done in the driver directly since it is
>> a generic API and most platform should probably have to enable
>> "something" at that time.
> 
> Just to second what Felipe and Benoit already said:
> 
> Much of what this patch does duplicates what would happen
> "automatcially" if this was done using omap_hwmod/omap_device +
> runtime PM.  For example, platform_device creation is automatic with
> hwmod data + omap_device build, and clock management is done by
> runtime PM. 
> 
> Kevin

Thanks for your comments.
I will work on the hwmod patch and submit it again.

Mansoor--
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: OMAP4 DSS clock setup

2011-04-12 Thread Tomi Valkeinen
On Mon, 2011-04-11 at 12:20 -0600, Paul Walmsley wrote:
> Hi
> 
> On Mon, 11 Apr 2011, Tomi Valkeinen wrote:

> > However, I think there is one difference between the clock used just to
> > enable the DSS registers, and the one used to output pixels: we need to
> > be able to adjust the rate of the clock. Thus we need to have a common
> > (omap2/3/4) clock name for it to be able to clk_get() it.
> >
> > Should that clock name be just the "main" clock provided automatically,
> > or something else?
> 
> Are you referring here to the system DPLL and its output dividers, or are 
> you referring to the DSS module's internal dividers?

The system DPLL and its divider. If we are using the dss_dss_clk as
fclk, we need to adjust it depending on the required pixel clock and use
cases (e.g. some scaling factors may need higher fclk).

 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: OMAP4 DSS clock setup

2011-04-12 Thread Tomi Valkeinen
On Mon, 2011-04-11 at 10:05 -0600, Paul Walmsley wrote:
> Hi
> 
> On Mon, 11 Apr 2011, Tomi Valkeinen wrote:
> 
> > On Fri, 2011-04-08 at 10:28 -0600, Paul Walmsley wrote:
> > > On Fri, 8 Apr 2011, Tomi Valkeinen wrote:
> > > 
> > > > > Also, I hope you and the other DSS hackers can finish the PM runtime
> > > > > conversion of the DSS driver soon.  Ideally before any new DSS
> > > > > features are added.  We really need to be able to separate the OMAP
> > > > > integration details from the drivers, and right now, hwmod and PM
> > > > > runtime are the best way we have to do that.
> > > > 
> > > > I also started to look at the PM runtime, but it doesn't fix the issue
> > > > with the inconsistent clock name I described above.
> > > 
> > > After the hwmod/PM runtime conversion, I don't think any of the clock 
> > > aliases currently in clock*_data.c should be used by the DSS driver (or 
> > > by 
> > > anything else on the system, for that matter).  That's because the 
> > > omap_device code should set up the "main" alias for the DSS main 
> > 
> > When should "main" clock be used by the driver? Or never, and pm_runtime
> > handles that?
> 
> If the DSS needs to change the parent or the clock rate of the main clock, 
> then it will need to clk_get(dev, "main") and use the clock API.  My only 
> point here was that the "main" alias should be automatically added by the 
> omap_device code, not via the clock aliases in clock*_data.c.

Ok.

> > How about OMAP3? It also has an optional functional clock, but that
> > doesn't seem to be set in dss_opt_clocks in omap_hwmod_3xxx_data.c.
> > Should it be there?
> 
> Probably so.
> 
> > It seems dss1_alwon_fclk is currently the main clock for OMAP3 dss
> > hwmods. Does that mean it can never be turned off if DSS is in use?
> 
> If the DSS driver were using PM runtime, then yes, that would be true.

Ok. Then there's also room for improvement, as the dss1_alwon_fclk is an
optional clock on OMAP3.

> > Ok. Then we need omap_hwmod_opt_clk for at least for VENC and HDMI, I
> > believe.
> 
> In terms of the VENC, I'd agree with that -- based on OMAP4 Public TRM Rev 
> O Figure 10-177 "Video Encoder Overview," it looks like VENC uses 
> DSS_TV_FCLK.

On OMAP3 DSS_96M_FCLK goes to VENC's video DACs. I don't quite
understand how it goes in OMAP4, the clock tree figure shows something
going into VDAC, but it's unclear what. Well, anyway, the point was not
to dig out the clocks now, but just to point out that some extra clocks
are needed =).

> In terms of the HDMI IP block, based on OMAP4 Public TRM Rev O Figure 
> 10-159 "HDMI Overview," it looks like sys_clk should be one of the 
> optional clocks for HDMI?  Hard to tell from that diagram.

Yes, I think sys_clk is the input clock for the HDMI PLL. The output
from the PLL can then be used for DISPC fckl.

I believe HDMI_PHY_48M_FCLK ("dss_48mhz_clk") is also needed.

 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


[PATCH 0/4] OMAP2PLUS: DSS2: Clock configuration enhancements and fixes

2011-04-12 Thread Archit Taneja
Currently, the clock sources for internal DSS clocks are hardcoded in DSS2, this
causes issues when displays want to configure clocks differently, or when there
are multiple displays trying to configure the clock sources for the same clocks.

Move the clock sources to dssdev.clocks struct, and perform cleanup related to
this.

Note: Patches apply over:
https://gitorious.org/linux-omap-dss2/linux/commits/master

Archit Taneja (4):
  OMAP2PLUS: DSS2: Change enum "dss_clk_source" to
"omap_dss_clk_source"
  OMAP2PLUS: DSS2: Add clock sources to dss device clock configuration
  OMAP: DSS2: HDMI: Use dss_device clock configuration for HDMI PLL
parameters
  OMAP2PLUS: DSS2: Remove hack config "CONFIG_OMAP2_DSS_USE_DSI_PLL"

 arch/arm/mach-omap2/board-4430sdp.c   |   18 ++-
 arch/arm/plat-omap/include/plat/display.h |   24 -
 drivers/video/omap2/dss/Kconfig   |8 ---
 drivers/video/omap2/dss/dispc.c   |   12 ++--
 drivers/video/omap2/dss/dpi.c |   83 +++--
 drivers/video/omap2/dss/dsi.c |   49 +++--
 drivers/video/omap2/dss/dss.c |   50 +-
 drivers/video/omap2/dss/dss.h |   23 +++--
 drivers/video/omap2/dss/dss_features.c|   20 
 drivers/video/omap2/dss/dss_features.h|2 +-
 drivers/video/omap2/dss/hdmi.c|   27 +-
 11 files changed, 164 insertions(+), 152 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/4] OMAP2PLUS: DSS2: Change enum "dss_clk_source" to "omap_dss_clk_source"

2011-04-12 Thread Archit Taneja
Change enum dss_clk_source to omap_dss_clock_source and move it to
'plat/display.h'. Change the enum members to attach "OMAP_" in the beginning.
These changes are done in order to specify the clock sources for DSS in the
board file.

Signed-off-by: Archit Taneja 
---
 arch/arm/plat-omap/include/plat/display.h |9 +
 drivers/video/omap2/dss/dispc.c   |   12 +++---
 drivers/video/omap2/dss/dpi.c |4 +-
 drivers/video/omap2/dss/dsi.c |   38 +++---
 drivers/video/omap2/dss/dss.c |   50 ++--
 drivers/video/omap2/dss/dss.h |   23 -
 drivers/video/omap2/dss/dss_features.c|   20 ++--
 drivers/video/omap2/dss/dss_features.h|2 +-
 drivers/video/omap2/dss/hdmi.c|2 +-
 9 files changed, 80 insertions(+), 80 deletions(-)

diff --git a/arch/arm/plat-omap/include/plat/display.h 
b/arch/arm/plat-omap/include/plat/display.h
index f6e4b87..f28b446 100644
--- a/arch/arm/plat-omap/include/plat/display.h
+++ b/arch/arm/plat-omap/include/plat/display.h
@@ -174,6 +174,15 @@ enum omap_overlay_manager_caps {
OMAP_DSS_OVL_MGR_CAP_DISPC = 1 << 0,
 };
 
+enum omap_dss_clk_source {
+   OMAP_DSS_CLK_SRC_FCK = 0,   /* OMAP2/3: DSS1_ALWON_FCLK
+* OMAP4: DSS_FCLK */
+   OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC,   /* OMAP3: DSI1_PLL_FCLK
+* OMAP4: PLL1_CLK1 */
+   OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DSI, /* OMAP3: DSI2_PLL_FCLK
+* OMAP4: PLL1_CLK2 */
+};
+
 /* RFBI */
 
 struct rfbi_timings {
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 7804779..d728904 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -2356,10 +2356,10 @@ unsigned long dispc_fclk_rate(void)
unsigned long r = 0;
 
switch (dss_get_dispc_clk_source()) {
-   case DSS_CLK_SRC_FCK:
+   case OMAP_DSS_CLK_SRC_FCK:
r = dss_clk_get_rate(DSS_CLK_FCK);
break;
-   case DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC:
+   case OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC:
r = dsi_get_pll_hsdiv_dispc_rate();
break;
default:
@@ -2380,10 +2380,10 @@ unsigned long dispc_lclk_rate(enum omap_channel channel)
lcd = FLD_GET(l, 23, 16);
 
switch (dss_get_lcd_clk_source(channel)) {
-   case DSS_CLK_SRC_FCK:
+   case OMAP_DSS_CLK_SRC_FCK:
r = dss_clk_get_rate(DSS_CLK_FCK);
break;
-   case DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC:
+   case OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC:
r = dsi_get_pll_hsdiv_dispc_rate();
break;
default:
@@ -2412,8 +2412,8 @@ void dispc_dump_clocks(struct seq_file *s)
 {
int lcd, pcd;
u32 l;
-   enum dss_clk_source dispc_clk_src = dss_get_dispc_clk_source();
-   enum dss_clk_source lcd_clk_src;
+   enum omap_dss_clk_source dispc_clk_src = dss_get_dispc_clk_source();
+   enum omap_dss_clk_source lcd_clk_src;
 
enable_clocks(1);
 
diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c
index 2d3ca4c..9e8b061 100644
--- a/drivers/video/omap2/dss/dpi.c
+++ b/drivers/video/omap2/dss/dpi.c
@@ -57,7 +57,7 @@ static int dpi_set_dsi_clk(struct omap_dss_device *dssdev, 
bool is_tft,
if (r)
return r;
 
-   dss_select_dispc_clk_source(DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC);
+   dss_select_dispc_clk_source(OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC);
 
r = dispc_set_clock_div(dssdev->manager->id, &dispc_cinfo);
if (r)
@@ -217,7 +217,7 @@ void omapdss_dpi_display_disable(struct omap_dss_device 
*dssdev)
dssdev->manager->disable(dssdev->manager);
 
 #ifdef CONFIG_OMAP2_DSS_USE_DSI_PLL
-   dss_select_dispc_clk_source(DSS_CLK_SRC_FCK);
+   dss_select_dispc_clk_source(OMAP_DSS_CLK_SRC_FCK);
dsi_pll_uninit();
dss_clk_disable(DSS_CLK_SYSCK);
 #endif
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index d3b2ad1..546792b 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -1009,7 +1009,7 @@ static unsigned long dsi_fclk_rate(void)
 {
unsigned long r;
 
-   if (dss_get_dsi_clk_source() == DSS_CLK_SRC_FCK) {
+   if (dss_get_dsi_clk_source() == OMAP_DSS_CLK_SRC_FCK) {
/* DSI FCLK source is DSS_CLK_FCK */
r = dss_clk_get_rate(DSS_CLK_FCK);
} else {
@@ -1309,12 +1309,12 @@ int dsi_pll_set_clock_div(struct dsi_clock_info *cinfo)
DSSDBG("Clock lane freq %ld Hz\n", cinfo->clkin4ddr / 4);
 
DSSDBG("regm_dispc = %d, %s (%s) = %lu\n", cinfo->regm_dispc,
-   
dss_get_generic_clk_source_name(DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC),
-   dss_feat_get_clk_source_name(DSS_CLK_SRC_

[PATCH 2/4] OMAP2PLUS: DSS2: Add clock sources to dss device clock configuration

2011-04-12 Thread Archit Taneja
Add enum dss_clock_source in dssdev.clocks struct so that the clock sources can
be specified in the board file.
Replace hard coded clock sources in dsi.c, dpi.c and replace them with the new
clock source members in dssdev.clocks. Modify the sdp4430_lcd_device struct in
board-4430sdp.c to specify clock sources for DISPC_FCLK, LCD1_CLK and DSI1_FCLK.

Signed-off-by: Archit Taneja 
---
 arch/arm/mach-omap2/board-4430sdp.c   |9 +++--
 arch/arm/plat-omap/include/plat/display.h |   10 --
 drivers/video/omap2/dss/dpi.c |2 +-
 drivers/video/omap2/dss/dsi.c |   10 +-
 4 files changed, 21 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-omap2/board-4430sdp.c 
b/arch/arm/mach-omap2/board-4430sdp.c
index 626b16b..5639af8 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -770,8 +770,12 @@ static struct omap_dss_device sdp4430_lcd_device = {
 
.clocks = {
.dispc = {
-   .lck_div= 1,/* Logic Clock = 172.8 MHz */
-   .pck_div= 5,/* Pixel Clock = 34.56 MHz */
+   .channel = {
+   .lck_div= 1,/* Logic Clock = 172.8 
MHz */
+   .pck_div= 5,/* Pixel Clock = 34.56 
MHz */
+   .lcd_clk_src= 
OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC,
+   },
+   .dispc_fclk_src = OMAP_DSS_CLK_SRC_FCK,
},
 
.dsi = {
@@ -781,6 +785,7 @@ static struct omap_dss_device sdp4430_lcd_device = {
.regm_dsi   = 5,/* PLL1_CLK2 = 172.8 MHz */
 
.lp_clk_div = 10,   /* LP Clock = 8.64 MHz */
+   .dsi_fclk_src   = OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DSI,
},
},
.channel= OMAP_DSS_CHANNEL_LCD,
diff --git a/arch/arm/plat-omap/include/plat/display.h 
b/arch/arm/plat-omap/include/plat/display.h
index f28b446..91495b0 100644
--- a/arch/arm/plat-omap/include/plat/display.h
+++ b/arch/arm/plat-omap/include/plat/display.h
@@ -422,8 +422,13 @@ struct omap_dss_device {
 
struct {
struct {
-   u16 lck_div;
-   u16 pck_div;
+   struct {
+   u16 lck_div;
+   u16 pck_div;
+   enum omap_dss_clk_source lcd_clk_src;
+   } channel;
+
+   enum omap_dss_clk_source dispc_fclk_src;
} dispc;
 
struct {
@@ -433,6 +438,7 @@ struct omap_dss_device {
u16 regm_dsi;
 
u16 lp_clk_div;
+   enum omap_dss_clk_source dsi_fclk_src;
} dsi;
} clocks;
 
diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c
index 9e8b061..55d9157 100644
--- a/drivers/video/omap2/dss/dpi.c
+++ b/drivers/video/omap2/dss/dpi.c
@@ -57,7 +57,7 @@ static int dpi_set_dsi_clk(struct omap_dss_device *dssdev, 
bool is_tft,
if (r)
return r;
 
-   dss_select_dispc_clk_source(OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC);
+   dss_select_dispc_clk_source(dssdev->clocks.dispc.dispc_fclk_src);
 
r = dispc_set_clock_div(dssdev->manager->id, &dispc_cinfo);
if (r)
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 546792b..6a51c07 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -3411,8 +3411,8 @@ static int dsi_configure_dispc_clocks(struct 
omap_dss_device *dssdev)
 
fck = dsi_get_pll_hsdiv_dispc_rate();
 
-   dispc_cinfo.lck_div = dssdev->clocks.dispc.lck_div;
-   dispc_cinfo.pck_div = dssdev->clocks.dispc.pck_div;
+   dispc_cinfo.lck_div = dssdev->clocks.dispc.channel.lck_div;
+   dispc_cinfo.pck_div = dssdev->clocks.dispc.channel.pck_div;
 
r = dispc_calc_clock_rates(fck, &dispc_cinfo);
if (r) {
@@ -3447,10 +3447,10 @@ static int dsi_display_init_dsi(struct omap_dss_device 
*dssdev)
if (r)
goto err1;
 
-   dss_select_dispc_clk_source(OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC);
-   dss_select_dsi_clk_source(OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DSI);
+   dss_select_dispc_clk_source(dssdev->clocks.dispc.dispc_fclk_src);
+   dss_select_dsi_clk_source(dssdev->clocks.dsi.dsi_fclk_src);
dss_select_lcd_clk_source(dssdev->manager->id,
-   OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC);
+   dssdev->clocks.dispc.channel.lcd_clk_src);
 
DSSDBG("PLL OK\n");
 
-- 
1.7.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: HDMI: Use dss_device clock configuration for HDMI PLL parameters

2011-04-12 Thread Archit Taneja
Move some of the configurable HDMI PLL parameters to dssdev.clock struct.
Cleanup the function hdmi_compute_pll() by using the parameters defined in the
board file and do some cosmetic modifications.

Signed-off-by: Archit Taneja 
---
 arch/arm/mach-omap2/board-4430sdp.c   |9 +
 arch/arm/plat-omap/include/plat/display.h |5 +
 drivers/video/omap2/dss/hdmi.c|   27 +--
 3 files changed, 27 insertions(+), 14 deletions(-)

diff --git a/arch/arm/mach-omap2/board-4430sdp.c 
b/arch/arm/mach-omap2/board-4430sdp.c
index 5639af8..cadea7e 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -795,6 +795,15 @@ static struct omap_dss_device sdp4430_hdmi_device = {
.name = "hdmi",
.driver_name = "hdmi_panel",
.type = OMAP_DISPLAY_TYPE_HDMI,
+   .clocks = {
+   .dispc  = {
+   .dispc_fclk_src = OMAP_DSS_CLK_SRC_FCK,
+   },
+   .hdmi   = {
+   .regn   = 15,
+   .regm2  = 1,
+   },
+   },
.platform_enable = sdp4430_panel_enable_hdmi,
.platform_disable = sdp4430_panel_disable_hdmi,
.channel = OMAP_DSS_CHANNEL_DIGIT,
diff --git a/arch/arm/plat-omap/include/plat/display.h 
b/arch/arm/plat-omap/include/plat/display.h
index 91495b0..7613637 100644
--- a/arch/arm/plat-omap/include/plat/display.h
+++ b/arch/arm/plat-omap/include/plat/display.h
@@ -440,6 +440,11 @@ struct omap_dss_device {
u16 lp_clk_div;
enum omap_dss_clk_source dsi_fclk_src;
} dsi;
+
+   struct {
+   u16 regn;
+   u16 regm2;
+   } hdmi;
} clocks;
 
struct {
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
index aad7354..4b8a93b 100644
--- a/drivers/video/omap2/dss/hdmi.c
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -1052,25 +1052,26 @@ static void update_hdmi_timings(struct hdmi_config *cfg,
cfg->timings.hsync_pol = cea_vesa_timings[code].hsync_pol;
 }
 
-static void hdmi_compute_pll(unsigned long clkin, int phy,
-   int n, struct hdmi_pll_info *pi)
+static void hdmi_compute_pll(struct omap_dss_device *dssdev, int phy,
+   struct hdmi_pll_info *pi)
 {
-   unsigned long refclk;
+   unsigned long clkin, refclk;
u32 mf;
 
+   clkin = dss_clk_get_rate(DSS_CLK_SYSCK) / 1;
/*
 * Input clock is predivided by N + 1
 * out put of which is reference clk
 */
-   refclk = clkin / (n + 1);
-   pi->regn = n;
+   pi->regn = dssdev->clocks.hdmi.regn;
+   refclk = clkin / (pi->regn + 1);
 
/*
 * multiplier is pixel_clk/ref_clk
 * Multiplying by 100 to avoid fractional part removal
 */
-   pi->regm = (phy * 100/(refclk))/100;
-   pi->regm2 = 1;
+   pi->regm = (phy * 100 / (refclk)) / 100;
+   pi->regm2 = dssdev->clocks.hdmi.regm2;
 
/*
 * fractional multiplier is remainder of the difference between
@@ -1078,14 +1079,14 @@ static void hdmi_compute_pll(unsigned long clkin, int 
phy,
 * multiplied by 2^18(262144) divided by the reference clock
 */
mf = (phy - pi->regm * refclk) * 262144;
-   pi->regmf = mf/(refclk);
+   pi->regmf = mf / (refclk);
 
/*
 * Dcofreq should be set to 1 if required pixel clock
 * is greater than 1000MHz
 */
pi->dcofreq = phy > 1000 * 100;
-   pi->regsd = ((pi->regm * clkin / 10) / ((n + 1) * 250) + 5) / 10;
+   pi->regsd = ((pi->regm * clkin / 10) / ((pi->regn + 1) * 250) + 5) / 10;
 
DSSDBG("M = %d Mf = %d\n", pi->regm, pi->regmf);
DSSDBG("range = %d sd = %d\n", pi->dcofreq, pi->regsd);
@@ -1106,7 +1107,7 @@ static int hdmi_power_on(struct omap_dss_device *dssdev)
int r, code = 0;
struct hdmi_pll_info pll_data;
struct omap_video_timings *p;
-   int clkin, n, phy;
+   unsigned long phy;
 
hdmi_enable_clocks(1);
 
@@ -1126,11 +1127,9 @@ static int hdmi_power_on(struct omap_dss_device *dssdev)
dssdev->panel.timings = cea_vesa_timings[code].timings;
update_hdmi_timings(&hdmi.cfg, p, code);
 
-   clkin = 3840; /* 38.4 MHz */
-   n = 15; /* this is a constant for our math */
phy = p->pixel_clock;
 
-   hdmi_compute_pll(clkin, phy, n, &pll_data);
+   hdmi_compute_pll(dssdev, phy, &pll_data);
 
hdmi_wp_video_start(0);
 
@@ -1160,7 +1159,7 @@ static int hdmi_power_on(struct omap_dss_device *dssdev)
 * dynamically by user. This can be moved to single location , say
 * Boardfile.
 */
-   dss_select_dispc_clk_source(OMAP_DSS_CLK_SRC_FCK);
+   dss_select_dispc_clk_source(dssdev->clocks.dispc.dispc_fclk_src);
 
/* bypass TV gamma table */
dispc_enable_gamma_tabl

[PATCH 4/4] OMAP2PLUS: DSS2: Remove hack config "CONFIG_OMAP2_DSS_USE_DSI_PLL"

2011-04-12 Thread Archit Taneja
The clock sources for DISPC_FCLK and LCD1_CLK are now specified in the board 
file.
There is no need for the hack config "CONFIG_OMAP2_DSS_USE_DSI_PLL" anymore.
Introduce function dpi_use_dsi_pll() which checks for the clock sources to 
decide
whether DSI PLL is to be used or not.

Signed-off-by: Archit Taneja 
---
 drivers/video/omap2/dss/Kconfig |8 
 drivers/video/omap2/dss/dpi.c   |   81 ---
 drivers/video/omap2/dss/dsi.c   |7 ---
 3 files changed, 42 insertions(+), 54 deletions(-)

diff --git a/drivers/video/omap2/dss/Kconfig b/drivers/video/omap2/dss/Kconfig
index 5b45c0c..7a49a75 100644
--- a/drivers/video/omap2/dss/Kconfig
+++ b/drivers/video/omap2/dss/Kconfig
@@ -90,14 +90,6 @@ config OMAP2_DSS_DSI
 
  See http://www.mipi.org/ for DSI spesifications.
 
-config OMAP2_DSS_USE_DSI_PLL
-   bool "Use DSI PLL for PCLK (EXPERIMENTAL)"
-   default n
-   depends on OMAP2_DSS_DSI
-   help
- Use DSI PLL to generate pixel clock.  Currently only for DPI output.
- DSI PLL can be used to generate higher and more precise pixel clocks.
-
 config OMAP2_DSS_FAKE_VSYNC
bool "Fake VSYNC irq from manual update displays"
default n
diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c
index 55d9157..737c738 100644
--- a/drivers/video/omap2/dss/dpi.c
+++ b/drivers/video/omap2/dss/dpi.c
@@ -39,7 +39,17 @@ static struct {
struct regulator *vdds_dsi_reg;
 } dpi;
 
-#ifdef CONFIG_OMAP2_DSS_USE_DSI_PLL
+static bool dpi_use_dsi_pll(struct omap_dss_device *dssdev)
+{
+   if (dssdev->clocks.dispc.dispc_fclk_src ==
+   OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC ||
+   dssdev->clocks.dispc.channel.lcd_clk_src ==
+   OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC)
+   return true;
+   else
+   return false;
+}
+
 static int dpi_set_dsi_clk(struct omap_dss_device *dssdev, bool is_tft,
unsigned long pck_req, unsigned long *fck, int *lck_div,
int *pck_div)
@@ -69,7 +79,7 @@ static int dpi_set_dsi_clk(struct omap_dss_device *dssdev, 
bool is_tft,
 
return 0;
 }
-#else
+
 static int dpi_set_dispc_clk(struct omap_dss_device *dssdev, bool is_tft,
unsigned long pck_req, unsigned long *fck, int *lck_div,
int *pck_div)
@@ -96,13 +106,12 @@ static int dpi_set_dispc_clk(struct omap_dss_device 
*dssdev, bool is_tft,
 
return 0;
 }
-#endif
 
 static int dpi_set_mode(struct omap_dss_device *dssdev)
 {
struct omap_video_timings *t = &dssdev->panel.timings;
-   int lck_div, pck_div;
-   unsigned long fck;
+   int lck_div = 0, pck_div = 0;
+   unsigned long fck = 0;
unsigned long pck;
bool is_tft;
int r = 0;
@@ -114,13 +123,12 @@ static int dpi_set_mode(struct omap_dss_device *dssdev)
 
is_tft = (dssdev->panel.config & OMAP_DSS_LCD_TFT) != 0;
 
-#ifdef CONFIG_OMAP2_DSS_USE_DSI_PLL
-   r = dpi_set_dsi_clk(dssdev, is_tft, t->pixel_clock * 1000, &fck,
-   &lck_div, &pck_div);
-#else
-   r = dpi_set_dispc_clk(dssdev, is_tft, t->pixel_clock * 1000, &fck,
-   &lck_div, &pck_div);
-#endif
+   if (dpi_use_dsi_pll(dssdev))
+   r = dpi_set_dsi_clk(dssdev, is_tft, t->pixel_clock * 1000,
+   &fck, &lck_div, &pck_div);
+   else
+   r = dpi_set_dispc_clk(dssdev, is_tft, t->pixel_clock * 1000,
+   &fck, &lck_div, &pck_div);
if (r)
goto err0;
 
@@ -179,12 +187,13 @@ int omapdss_dpi_display_enable(struct omap_dss_device 
*dssdev)
if (r)
goto err2;
 
-#ifdef CONFIG_OMAP2_DSS_USE_DSI_PLL
-   dss_clk_enable(DSS_CLK_SYSCK);
-   r = dsi_pll_init(dssdev, 0, 1);
-   if (r)
-   goto err3;
-#endif
+   if (dpi_use_dsi_pll(dssdev)) {
+   dss_clk_enable(DSS_CLK_SYSCK);
+   r = dsi_pll_init(dssdev, 0, 1);
+   if (r)
+   goto err3;
+   }
+
r = dpi_set_mode(dssdev);
if (r)
goto err4;
@@ -196,11 +205,11 @@ int omapdss_dpi_display_enable(struct omap_dss_device 
*dssdev)
return 0;
 
 err4:
-#ifdef CONFIG_OMAP2_DSS_USE_DSI_PLL
-   dsi_pll_uninit();
+   if (dpi_use_dsi_pll(dssdev))
+   dsi_pll_uninit();
 err3:
-   dss_clk_disable(DSS_CLK_SYSCK);
-#endif
+   if (dpi_use_dsi_pll(dssdev))
+   dss_clk_disable(DSS_CLK_SYSCK);
 err2:
dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK);
if (cpu_is_omap34xx())
@@ -216,11 +225,11 @@ void omapdss_dpi_display_disable(struct omap_dss_device 
*dssdev)
 {
dssdev->manager->disable(dssdev->manager);
 
-#ifdef CONFIG_OMAP2_DSS_USE_DSI_PLL
-   dss_select_dispc_clk_source(OMAP_DSS_CLK_SRC_FCK);
-   dsi_pll_uninit();
-   dss_clk_disable(DSS_CLK_SY

Re: HELP:dspbridge:how to configure GPT timer

2011-04-12 Thread onlyfever
thanks a lot!
--
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: Linux-OMAP BoF at ELC: 7pm, Tuesday Apr 12

2011-04-12 Thread Paul Walmsley
by the way

On Mon, 11 Apr 2011, Paul Walmsley wrote:

> For all Linux OMAP hackers and friends, at or nearby the Embedded Linux 
> Conference, there will be an informal BoF tomorrow at Yoshi's San 
> Francisco at 7pm tomorrow.  Yoshi's SF is about a ten minute walk away 
> from the Hotel Kabuki at 1330 Fillmore.  Come and hang out :-)

Apparently there's some show tonight at Yoshi's with a cover charge, but 
the person I spoke to said that there was no charge to hang out in the 
"lounge".  So that's where we'll be.


- 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: [PATCH] pci: Add quirk for setting valid class for TI816X Endpoint

2011-04-12 Thread Jesse Barnes
On Tue,  5 Apr 2011 12:32:50 +0530
Hemant Pedanekar  wrote:

> TI816X (common name for DM816x/C6A816x/AM389x family) devices configured to 
> boot
> as PCIe Endpoint have class code = 0. This makes kernel PCI bus code to skip
> allocating BARs to these devices resulting into following type of error when
> trying to enable them:
> 
> "Device :01:00.0 not available because of resource collisions"
> 
> The device cannot be operated because of the above issue.
> 
> This patch adds a ID specific (TI VENDOR ID and 816X DEVICE ID based) 'early'
> fixup quirk to replace class code with PCI_CLASS_MULTIMEDIA_VIDEO as class.
> 
> Signed-off-by: Hemant Pedanekar 
> ---

Applied to my linux-next branch, thanks.

-- 
Jesse Barnes, Intel Open Source Technology Center
--
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: [Regression?] Removed regulator support in ehci-omap

2011-04-12 Thread Keshava Munegowda
> -Original Message-
> From: Dmitry Artamonow [mailto:mad_s...@inbox.ru]
> Sent: Tuesday, April 12, 2011 9:41 AM
> To: Keshava Munegowda
> Cc: Steve Sakoman; Steve Calfee; Felipe Balbi;
linux-...@vger.kernel.org; linux-omap@vger.kernel.org;
> linux-ker...@vger.kernel.org
> Subject: Re: [Regression?] Removed regulator support in ehci-omap
>
> On 02:18 Tue 12 Apr , Keshava Munegowda wrote:
> >
> > Sorry guys! I will work on it coming week; currently I am in travel.
> >
> > Well, regulator is not removed, its moved to usbhs core driver in
> > /driver/mfd/omap xx usb xxx host.c
>
> Ah, so EHCI/OHCI common code was moved into drivers/mfd... Good.
> But seems regulators support was lost somewhere during transition - the
> only mentioning about regulators in omap-usb-host.c is "#include" :
>
> mad@macmini:~/kernel-hack/linux-2.6(master)$ grep -i regulator
drivers/mfd/omap-usb-host.c
> #include 
> mad@macmini:~/kernel-hack/linux-2.6(master)$
>
> --
> Best regards,
> Dmitry "MAD" Artamonow

Thanks ! I will add some time next week!

Keshava Munegowda
--
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


[PATCHv3] omap3: alsa-soc: Remove restrictive checks for cpu type

2011-04-12 Thread Sanjeev Premi
Current checks for cpu type were too restrictive leading
to failures for other silicons in same family.

The problem was found while testing audio playback on
AM37x and AM35x processors. But should exist on OMAP36xx
as well.

Signed-off-by: Sanjeev Premi 
---
 Changes in v3::
   None. Reposting[1] after subscribing to alsa-devel list

 Changes in v2:
   1) Added one more check to the changes.
   2) Updated commit message to use plurals.


 [1] http://marc.info/?l=linux-omap&m=130026430110592&w=2

 sound/soc/omap/omap-mcbsp.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c
index 2175f09..a88a0bf 100644
--- a/sound/soc/omap/omap-mcbsp.c
+++ b/sound/soc/omap/omap-mcbsp.c
@@ -146,7 +146,7 @@ static int omap_mcbsp_dai_startup(struct snd_pcm_substream 
*substream,
 * 2 channels (stereo): size is 128 / 2 = 64 frames (2 * 64 words)
 * 4 channels: size is 128 / 4 = 32 frames (4 * 32 words)
 */
-   if (cpu_is_omap343x() || cpu_is_omap44xx()) {
+   if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
/*
* Rule for the buffer size. We should not allow
* smaller buffer than the FIFO size to avoid underruns
@@ -258,7 +258,7 @@ static int omap_mcbsp_dai_hw_params(struct 
snd_pcm_substream *substream,
default:
return -EINVAL;
}
-   if (cpu_is_omap343x()) {
+   if (cpu_is_omap34xx()) {
dma_data->set_threshold = omap_mcbsp_set_threshold;
/* TODO: Currently, MODE_ELEMENT == MODE_FRAME */
if (omap_mcbsp_get_dma_op_mode(bus_id) ==
-- 
1.7.2.2

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


FW:FW: Medvile rekomenduoja nera pulti i nevilti, taciau lengvai uzdirbti pinigus

2011-04-12 Thread Kastas
ivertink si portala ir pradek uzdirbti pinigus nedelsiant 

paslapti kaip uzsidirbti rasi cia http://d24ogddhl.blogspot.com/ 


Eisminte ir Lygedas jau perskaites pasismagink ir uzsidirbk daug pinigu!

--
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 v3 2/2] RX-51: Enable isp1704 power on/off

2011-04-12 Thread Heikki Krogerus
Hi,

On Wed, Mar 30, 2011 at 08:08:54AM +0300, ext Heikki Krogerus wrote:
> On Tue, Mar 29, 2011 at 04:28:00PM +0300, Kalle Jokiniemi wrote:
> > The isp1704 usb tranceiver is used for charging and can be
> > disabled when not in use. Provide the powering routine to
> > the driver via platform data.
> > 
> > Also changed the indent of ".name" variable in rx51_charger_device
> > definition to use tabs same way as the new ".dev" variable indent.
> > Put this in the same patch since the indent fix is only needed
> > when there are multiple members in the struct definition.
> > 
> > Loosely based on earlier patches from Heikki Krogerus in
> > Nokia N900 maemo kernel.
> > 
> > Signed-off-by: Kalle Jokiniemi 
> > Cc: Heikki Krogerus 
> 
> Acked-By: Heikki Krogerus 

Before Anton takes these, this one needs ack from Tony.

-- 
heikki
--
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: [PATCHv3] omap3: alsa-soc: Remove restrictive checks for cpu type

2011-04-12 Thread Jarkko Nikula
On Wed, 13 Apr 2011 02:03:13 +0530
Sanjeev Premi  wrote:

> Current checks for cpu type were too restrictive leading
> to failures for other silicons in same family.
> 
> The problem was found while testing audio playback on
> AM37x and AM35x processors. But should exist on OMAP36xx
> as well.
> 
> Signed-off-by: Sanjeev Premi 
> ---
>  Changes in v3::
>None. Reposting[1] after subscribing to alsa-devel list
> 
>  Changes in v2:
>1) Added one more check to the changes.
>2) Updated commit message to use plurals.
> 
> 
>  [1] http://marc.info/?l=linux-omap&m=130026430110592&w=2
> 
>  sound/soc/omap/omap-mcbsp.c |4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
Acked-by: Jarkko Nikula 
--
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 v3 2/2] RX-51: Enable isp1704 power on/off

2011-04-12 Thread Tony Lindgren
* Heikki Krogerus  [110413 08:07]:
> Hi,
> 
> On Wed, Mar 30, 2011 at 08:08:54AM +0300, ext Heikki Krogerus wrote:
> > On Tue, Mar 29, 2011 at 04:28:00PM +0300, Kalle Jokiniemi wrote:
> > > The isp1704 usb tranceiver is used for charging and can be
> > > disabled when not in use. Provide the powering routine to
> > > the driver via platform data.
> > > 
> > > Also changed the indent of ".name" variable in rx51_charger_device
> > > definition to use tabs same way as the new ".dev" variable indent.
> > > Put this in the same patch since the indent fix is only needed
> > > when there are multiple members in the struct definition.
> > > 
> > > Loosely based on earlier patches from Heikki Krogerus in
> > > Nokia N900 maemo kernel.
> > > 
> > > Signed-off-by: Kalle Jokiniemi 
> > > Cc: Heikki Krogerus 
> > 
> > Acked-By: Heikki Krogerus 
> 
> Before Anton takes these, this one needs ack from Tony.

Looks good to me:

Acked-by: Tony Lindgren 
--
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/5] OMAP: DSS2: miscellaneous patches

2011-04-12 Thread Tomi Valkeinen
Some small miscellaneous fixes/improvements for DSS2.

 Tomi

Tomi Valkeinen (5):
  OMAP: DSS2: Convert simple/strict_strto* to kstrto*
  OMAP: DSS2: DSI: fix dsi_dump_clocks()
  OMAP: DSS2: improve clock debugfs output
  OMAP: DSS2: DSI: fix use_sys_clk & highfreq
  OMAP: DSS2: fix panel Kconfig dependencies

 drivers/video/omap2/displays/Kconfig   |9 ++--
 .../video/omap2/displays/panel-tpo-td043mtea1.c|8 ++-
 drivers/video/omap2/dss/display.c  |   44 +---
 drivers/video/omap2/dss/dsi.c  |9 ++--
 drivers/video/omap2/dss/dss.c  |   13 +-
 drivers/video/omap2/dss/overlay.c  |   22 --
 drivers/video/omap2/omapfb/omapfb-sysfs.c  |   21 ++---
 7 files changed, 87 insertions(+), 39 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/5] OMAP: DSS2: Convert simple/strict_strto* to kstrto*

2011-04-12 Thread Tomi Valkeinen
Convert simple/strict_strto* functions to kstrto* functions. Only simple
cases are converted.

simple_strto* uses are still left to places where it is used to parse
numbers from a list of numbers. These need some other solution than
kstrto*.

Signed-off-by: Tomi Valkeinen 
---
 .../video/omap2/displays/panel-tpo-td043mtea1.c|8 ++-
 drivers/video/omap2/dss/display.c  |   44 +---
 drivers/video/omap2/dss/overlay.c  |   22 --
 drivers/video/omap2/omapfb/omapfb-sysfs.c  |   21 ++---
 4 files changed, 66 insertions(+), 29 deletions(-)

diff --git a/drivers/video/omap2/displays/panel-tpo-td043mtea1.c 
b/drivers/video/omap2/displays/panel-tpo-td043mtea1.c
index dbe9d43..7081784 100644
--- a/drivers/video/omap2/displays/panel-tpo-td043mtea1.c
+++ b/drivers/video/omap2/displays/panel-tpo-td043mtea1.c
@@ -144,13 +144,15 @@ static ssize_t tpo_td043_vmirror_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
 {
struct tpo_td043_device *tpo_td043 = dev_get_drvdata(dev);
-   long val;
+   int val;
int ret;
 
-   ret = strict_strtol(buf, 0, &val);
+   ret = kstrtoint(buf, 0, &val);
if (ret < 0)
return ret;
 
+   val = !!val;
+
ret = tpo_td043_write_mirror(tpo_td043->spi, tpo_td043->hmirror, val);
if (ret < 0)
return ret;
@@ -175,7 +177,7 @@ static ssize_t tpo_td043_mode_store(struct device *dev,
long val;
int ret;
 
-   ret = strict_strtol(buf, 0, &val);
+   ret = kstrtol(buf, 0, &val);
if (ret != 0 || val & ~7)
return -EINVAL;
 
diff --git a/drivers/video/omap2/dss/display.c 
b/drivers/video/omap2/dss/display.c
index a85a6f3..4c9eeba 100644
--- a/drivers/video/omap2/dss/display.c
+++ b/drivers/video/omap2/dss/display.c
@@ -44,9 +44,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);
-   bool enabled, r;
+   int r, enabled;
 
-   enabled = simple_strtoul(buf, NULL, 10);
+   r = kstrtoint(buf, 0, &enabled);
+   if (r)
+   return r;
+
+   enabled = !!enabled;
 
if (enabled != (dssdev->state != OMAP_DSS_DISPLAY_DISABLED)) {
if (enabled) {
@@ -82,7 +86,9 @@ static ssize_t display_upd_mode_store(struct device *dev,
if (!dssdev->driver->set_update_mode)
return -EINVAL;
 
-   val = simple_strtoul(buf, NULL, 10);
+   r = kstrtoint(buf, 0, &val);
+   if (r)
+   return r;
 
switch (val) {
case OMAP_DSS_UPDATE_DISABLED:
@@ -114,13 +120,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);
-   unsigned long te;
-   int r;
+   int te, r;
 
if (!dssdev->driver->enable_te || !dssdev->driver->get_te)
return -ENOENT;
 
-   te = simple_strtoul(buf, NULL, 0);
+   r = kstrtoint(buf, 0, &te);
+   if (r)
+   return r;
+
+   te = !!te;
 
r = dssdev->driver->enable_te(dssdev, te);
if (r)
@@ -196,13 +205,14 @@ static ssize_t display_rotate_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t size)
 {
struct omap_dss_device *dssdev = to_dss_device(dev);
-   unsigned long rot;
-   int r;
+   int rot, r;
 
if (!dssdev->driver->set_rotate || !dssdev->driver->get_rotate)
return -ENOENT;
 
-   rot = simple_strtoul(buf, NULL, 0);
+   r = kstrtoint(buf, 0, &rot);
+   if (r)
+   return r;
 
r = dssdev->driver->set_rotate(dssdev, rot);
if (r)
@@ -226,13 +236,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);
-   unsigned long mirror;
-   int r;
+   int mirror, r;
 
if (!dssdev->driver->set_mirror || !dssdev->driver->get_mirror)
return -ENOENT;
 
-   mirror = simple_strtoul(buf, NULL, 0);
+   r = kstrtoint(buf, 0, &mirror);
+   if (r)
+   return r;
+
+   mirror = !!mirror;
 
r = dssdev->driver->set_mirror(dssdev, mirror);
if (r)
@@ -259,14 +272,15 @@ static ssize_t display_wss_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t size)
 {
struct omap_dss_device *dssdev = to_dss_device(dev);
-   unsigned long wss;
+   u32 wss;
int r;
 
if (!dssdev->driver->get_wss || !dssdev->driver->set_wss)
return -ENOENT;
 
-   if (strict_strtoul(buf, 0, &wss))
-   return -EINVAL;
+   r = ks

[PATCH 2/5] OMAP: DSS2: DSI: fix dsi_dump_clocks()

2011-04-12 Thread Tomi Valkeinen
On OMAP4, reading DSI_PLL_CONFIGURATION2 register requires the L3 clock
(CIO_CLK_ICG) to PLL. Currently dsi_dump_clocks() tries to read that
register without enabling the L3 clock, leading to crash if DSI is not
in use.

The status of the bit being read from DSI_PLL_CONFIGURATION2 is
available from dsi_clock_info->use_sys_clk, so we can avoid the whole
problem by just using that.

Signed-off-by: Tomi Valkeinen 
---
 drivers/video/omap2/dss/dsi.c |6 +-
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 74334b5..1cc4f37 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -1481,7 +1481,6 @@ void dsi_pll_uninit(void)
 
 void dsi_dump_clocks(struct seq_file *s)
 {
-   int clksel;
struct dsi_clock_info *cinfo = &dsi.current_cinfo;
enum omap_dss_clk_source dispc_clk_src, dsi_clk_src;
 
@@ -1490,13 +1489,10 @@ void dsi_dump_clocks(struct seq_file *s)
 
enable_clocks(1);
 
-   clksel = REG_GET(DSI_PLL_CONFIGURATION2, 11, 11);
-
seq_printf(s,   "- DSI PLL -\n");
 
seq_printf(s,   "dsi pll source = %s\n",
-   clksel == 0 ?
-   "dss_sys_clk" : "pclkfree");
+   cinfo->use_sys_clk ? "dss_sys_clk" : "pclkfree");
 
seq_printf(s,   "Fint\t\t%-16luregn %u\n", cinfo->fint, cinfo->regn);
 
-- 
1.7.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/5] OMAP: DSS2: improve clock debugfs output

2011-04-12 Thread Tomi Valkeinen
OMAP4 has clocks set up in a bit interesting way, causing, for example,
the DSS's "ick" to be called "dss_fck".

This patch changes the debugfs output to show both the DSS's name for
the clock (ie. basically the clock alias), and the real name from the
clock struct.

Signed-off-by: Tomi Valkeinen 
---
 drivers/video/omap2/dss/dss.c |   13 -
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index a8d4402..118d320 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -1026,6 +1026,14 @@ static void core_dump_clocks(struct seq_file *s)
dss.dss_video_fck
};
 
+   const char *names[5] = {
+   "ick",
+   "fck",
+   "sys_clk",
+   "tv_fck",
+   "video_fck"
+   };
+
seq_printf(s, "- CORE -\n");
 
seq_printf(s, "internal clk count\t\t%u\n", dss.num_clks_enabled);
@@ -1033,8 +1041,11 @@ static void core_dump_clocks(struct seq_file *s)
for (i = 0; i < 5; i++) {
if (!clocks[i])
continue;
-   seq_printf(s, "%-15s\t%lu\t%d\n",
+   seq_printf(s, "%s (%s)%*s\t%lu\t%d\n",
+   names[i],
clocks[i]->name,
+   24 - strlen(names[i]) - strlen(clocks[i]->name),
+   "",
clk_get_rate(clocks[i]),
clocks[i]->usecount);
}
-- 
1.7.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/5] OMAP: DSS2: DSI: fix use_sys_clk & highfreq

2011-04-12 Thread Tomi Valkeinen
use_sys_clk and highfreq fields in dsi.current_cinfo were never set.
Luckily they weren't used anywhere so it didn't cause any problems.

This patch fixes those fields and they are now set at the same time as
the rest of the fields.

Signed-off-by: Tomi Valkeinen 
---
 drivers/video/omap2/dss/dsi.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 1cc4f37..9690bea 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -1276,6 +1276,9 @@ int dsi_pll_set_clock_div(struct dsi_clock_info *cinfo)
 
DSSDBGF();
 
+   dsi.current_cinfo.use_sys_clk = cinfo->use_sys_clk;
+   dsi.current_cinfo.highfreq = cinfo->highfreq;
+
dsi.current_cinfo.fint = cinfo->fint;
dsi.current_cinfo.clkin4ddr = cinfo->clkin4ddr;
dsi.current_cinfo.dsi_pll_hsdiv_dispc_clk =
-- 
1.7.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 5/5] OMAP: DSS2: fix panel Kconfig dependencies

2011-04-12 Thread Tomi Valkeinen
All DPI panels were missing dependency to OMAP2_DSS_DPI. Add the
dependency.

Signed-off-by: Tomi Valkeinen 
---
 drivers/video/omap2/displays/Kconfig |9 +
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/video/omap2/displays/Kconfig 
b/drivers/video/omap2/displays/Kconfig
index d18ad6b..609a280 100644
--- a/drivers/video/omap2/displays/Kconfig
+++ b/drivers/video/omap2/displays/Kconfig
@@ -3,6 +3,7 @@ menu "OMAP2/3 Display Device Drivers"
 
 config PANEL_GENERIC_DPI
 tristate "Generic DPI Panel"
+   depends on OMAP2_DSS_DPI
 help
  Generic DPI panel driver.
  Supports DVI output for Beagle and OMAP3 SDP.
@@ -11,20 +12,20 @@ config PANEL_GENERIC_DPI
 
 config PANEL_LGPHILIPS_LB035Q02
tristate "LG.Philips LB035Q02 LCD Panel"
-   depends on OMAP2_DSS && SPI
+   depends on OMAP2_DSS_DPI && SPI
help
  LCD Panel used on the Gumstix Overo Palo35
 
 config PANEL_SHARP_LS037V7DW01
 tristate "Sharp LS037V7DW01 LCD Panel"
-depends on OMAP2_DSS
+depends on OMAP2_DSS_DPI
 select BACKLIGHT_CLASS_DEVICE
 help
   LCD Panel used in TI's SDP3430 and EVM boards
 
 config PANEL_NEC_NL8048HL11_01B
tristate "NEC NL8048HL11-01B Panel"
-   depends on OMAP2_DSS
+   depends on OMAP2_DSS_DPI
help
This NEC NL8048HL11-01B panel is TFT LCD
used in the Zoom2/3/3630 sdp boards.
@@ -37,7 +38,7 @@ config PANEL_TAAL
 
 config PANEL_TPO_TD043MTEA1
 tristate "TPO TD043MTEA1 LCD Panel"
-depends on OMAP2_DSS && SPI
+depends on OMAP2_DSS_DPI && SPI
 help
   LCD Panel used in OMAP3 Pandora
 
-- 
1.7.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