Re: [PATCH 2/2] ARM: Exynos4: Register clocks via common clock framework

2012-10-03 Thread Tomasz Figa
Hi Chander, Thomas,

I can see one more problem here.

Based on the fact that sdhci-s3c driver receives only the endpoint gate 
clock (hsmmc), doesn't the following setup make the driver unable to change 
the frequency of this clock?

On Monday 01 of October 2012 17:39:21 chander.kash...@linaro.org wrote:
 +static struct samsung_mux_clock exynos4_mux_clks[] = {
[snip]
 + MUXCLK(exynos4-sdhci.0, mout_mmc0, group1_parents, 0,
 + EXYNOS4_CLKSRC_FSYS, 0, 4, 0),
 + MUXCLK(exynos4-sdhci.1, mout_mmc1, group1_parents, 0,
 + EXYNOS4_CLKSRC_FSYS, 4, 4, 0),
 + MUXCLK(exynos4-sdhci.1, mout_mmc2, group1_parents, 0,
 + EXYNOS4_CLKSRC_FSYS, 8, 4, 0),
 + MUXCLK(exynos4-sdhci.1, mout_mmc3, group1_parents, 0,
 + EXYNOS4_CLKSRC_FSYS, 12, 4, 0),
[snip]
 +};
 +
 +static struct samsung_div_clock exynos4_div_clks[] = {
[snip]
 + DIVCLK(exynos4-sdhci.0, div_mmc0, mout_mmc0, 0,
 + EXYNOS4_CLKDIV_FSYS1, 0, 4, 0),
 + DIVCLK(exynos4-sdhci.0, div_mmc0_pre, div_mmc0, 0,
 + EXYNOS4_CLKDIV_FSYS1, 8, 8, 0),
 + DIVCLK(exynos4-sdhci.1, div_mmc1, mout_mmc1, 0,
 + EXYNOS4_CLKDIV_FSYS1, 16, 4, 0),
 + DIVCLK(exynos4-sdhci.1, div_mmc1_pre, div_mmc1, 0,
 + EXYNOS4_CLKDIV_FSYS1, 24, 8, 0),
 + DIVCLK(exynos4-sdhci.2, div_mmc2, mout_mmc2, 0,
 + EXYNOS4_CLKDIV_FSYS2, 0, 4, 0),
 + DIVCLK(exynos4-sdhci.2, div_mmc2_pre, div_mmc2, 0,
 + EXYNOS4_CLKDIV_FSYS2, 8, 8, 0),
 + DIVCLK(exynos4-sdhci.3, div_mmc3, mout_mmc3, 0,
 + EXYNOS4_CLKDIV_FSYS2, 16, 4, 0),
 + DIVCLK(exynos4-sdhci.3, div_mmc3_pre, div_mmc3, 0,
 + EXYNOS4_CLKDIV_FSYS2, 24, 8, 0),
[snip]
 +};
 +
 +struct samsung_gate_clock exynos4_gate_clks[] = {
[snip]
 + GATECLK(exynos4-sdhci.0, hsmmc0, aclk_133, 0,
 + EXYNOS4_CLKGATE_IP_FSYS, 5, hsmmc),
 + GATECLK(exynos4-sdhci.1, hsmmc1, aclk_133, 0,
 + EXYNOS4_CLKGATE_IP_FSYS, 6, hsmmc),
 + GATECLK(exynos4-sdhci.2, hsmmc2, aclk_133, 0,
 + EXYNOS4_CLKGATE_IP_FSYS, 7, hsmmc),
 + GATECLK(exynos4-sdhci.3, hsmmc3, aclk_133, 0,
 + EXYNOS4_CLKGATE_IP_FSYS, 8, hsmmc),
[snip]
 +};

Best regards,
-- 
Tomasz Figa
Samsung Poland RD Center

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc 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 2/2] video: drm: exynos: Add device tree support

2012-10-03 Thread Stephen Warren
On 10/02/2012 10:06 PM, Leela Krishna Amudala wrote:
 On Mon, Oct 1, 2012 at 9:50 PM, Stephen Warren swar...@wwwdotorg.org wrote:
 On 09/30/2012 11:29 PM, Leela Krishna Amudala wrote:
 Hello Stephen Warren,

 The binding names that I use in my dts file should match with the
 names given in 
 http://lists.freedesktop.org/archives/dri-devel/2012-July/024875.html
 right?

 I don't think so; the binding in that link is for example:

 + - xres, yres: Display resolution
 + - left-margin, right-margin, hsync-len: Horizontal Display timing 
 parameters
 +   in pixels
 +   upper-margin, lower-margin, vsync-len: Vertical display timing 
 parameters in
 +   lines
 + - clock: displayclock in Hz

 i.e. a bunch of separate properties, one for each value needed to
 describe the display timing. However, your patch contains:
 
 I mean to say that even I have to use separate properties for each one
 instead of grouping them.
 Also the names should match with the ones given in the example..?

Yes. The patch I pointed to isn't supposed to be just an example, but
/the/ standard way of representing display timings.

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


Re: [PATCH] input: touchscreen: mms114: Add device tree bindings

2012-10-03 Thread Joonyoung Shim

Hi, Tomasz.

On 10/02/2012 06:33 PM, Tomasz Figa wrote:

This patch adds device tree bindings for mms114 touchscreen.

Signed-off-by: Tomasz Figa t.f...@samsung.com

---
  .../bindings/input/touchscreen/mms114.txt  | 34 ++
  drivers/input/touchscreen/mms114.c | 52 +-
  2 files changed, 84 insertions(+), 2 deletions(-)
  create mode 100644 
Documentation/devicetree/bindings/input/touchscreen/mms114.txt

diff --git a/Documentation/devicetree/bindings/input/touchscreen/mms114.txt 
b/Documentation/devicetree/bindings/input/touchscreen/mms114.txt
new file mode 100644
index 000..f89d382
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/touchscreen/mms114.txt
@@ -0,0 +1,34 @@
+* MELFAS MMS114 touchscreen controller
+
+Required properties:
+- compatible: must be melfas,mms114
+- reg: I2C address of the chip
+- interrupts: interrupt to which the chip is connected
+- x-size: horizontal resolution of touchscreen
+- y-size: vertical resolution of touchscreen
+
+Optional properties:
+- contact-threshold:
+- moving-threshold:
+- x-invert: invert X axis
+- y-invert: invert Y axis
+
+Example:
+
+   i2c@ {
+   /* ... */
+
+   touchscreen@48 {
+   compatible = melfas,mms114;
+   reg = 0x48;
+   interrupts = 39 0;
+   x-size = 720;
+   y-size = 1280;
+   contact-threshold = 10;
+   moving-threshold = 10;
+   x-invert;
+   y-invert;
+   };
+
+   /* ... */
+   };
diff --git a/drivers/input/touchscreen/mms114.c 
b/drivers/input/touchscreen/mms114.c
index 49c44bb..fb66f7a 100644
--- a/drivers/input/touchscreen/mms114.c
+++ b/drivers/input/touchscreen/mms114.c
@@ -10,6 +10,7 @@
  #include linux/module.h
  #include linux/init.h
  #include linux/delay.h
+#include linux/of.h
  #include linux/i2c.h
  #include linux/i2c/mms114.h
  #include linux/input/mt.h
@@ -360,14 +361,55 @@ static void mms114_input_close(struct input_dev *dev)
mms114_stop(data);
  }
  
+static struct mms114_platform_data *mms114_parse_dt(struct device *dev)

+{
+   struct mms114_platform_data *pdata;
+   struct device_node *np = dev-of_node;
+
+   if (!np)
+   return NULL;
+
+   pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
+   if (!pdata) {
+   dev_err(dev, failed to allocate platform data\n);
+   return NULL;
+   }
+
+   if (of_property_read_u32(np, x-size, pdata-x_size)) {
+   dev_err(dev, failed to get x-size property\n);
+   return NULL;
+   };
+
+   if (of_property_read_u32(np, y-size, pdata-y_size)) {
+   dev_err(dev, failed to get y-size property\n);
+   return NULL;
+   };
+
+   of_property_read_u32(np, contact-threshold,
+   pdata-contact_threshold);
+   of_property_read_u32(np, moving-threshold,
+   pdata-moving_threshold);
+
+   if (of_find_property(np, x-invert, NULL))
+   pdata-x_invert = true;
+   if (of_find_property(np, y-invert, NULL))
+   pdata-y_invert = true;
+
+   return pdata;
+}


#ifdef CONFIG_OF needs.


+
  static int __devinit mms114_probe(struct i2c_client *client,
  const struct i2c_device_id *id)
  {
struct mms114_data *data;
struct input_dev *input_dev;
+   struct mms114_platform_data *pdata = client-dev.platform_data;
int error;
  
-	if (!client-dev.platform_data) {

+   if (!pdata)
+   pdata = mms114_parse_dt(client-dev);
+
+   if (!pdata) {
dev_err(client-dev, Need platform data\n);
return -EINVAL;
}
@@ -389,7 +431,7 @@ static int __devinit mms114_probe(struct i2c_client *client,
  
  	data-client = client;

data-input_dev = input_dev;
-   data-pdata = client-dev.platform_data;
+   data-pdata = pdata;
  
  	input_dev-name = MELPAS MMS114 Touchscreen;

input_dev-id.bustype = BUS_I2C;
@@ -525,11 +567,17 @@ static const struct i2c_device_id mms114_id[] = {
  };
  MODULE_DEVICE_TABLE(i2c, mms114_id);
  
+static struct of_device_id __devinitdata mms114_dt_match[] = {

+   { .compatible = melfas,mms114 },
+   { }
+};
+
  static struct i2c_driver mms114_driver = {
.driver = {
.name   = mms114,
.owner  = THIS_MODULE,
.pm = mms114_pm_ops,
+   .of_match_table = mms114_dt_match,
},
.probe  = mms114_probe,
.remove = __devexit_p(mms114_remove),


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

Re: [PATCH V3] video: exynos_dp: Add device tree support to DP driver

2012-10-03 Thread Jingoo Han
On Monday, October 01, 2012 2:40 PM Ajay kumar wrote
 
 On Fri, Sep 28, 2012 at 5:41 AM, Jingoo Han jg1@samsung.com wrote:
  On Thursday, September 27, 2012 10:45 PM Sylwester Nawrocki wrote
  On 09/24/2012 09:36 PM, Ajay Kumar wrote:

[...]

   +Example:
   +
   +SOC specific portion:
   +   dptx_phy: dptx_phy@0x10040720 {
   +   compatible = samsung,dp-phy;
   +   samsung,dptx_phy_reg =0x10040720;
   +   samsung,enable_bit =1;
   +   };
   +
   +   display-port-controller {
   +   compatible = samsung,exynos5-dp;
   +   reg =0x145B 0x1;
   +   interrupts =10 3;
   +   interrupt-parent =combiner;
   +   dp_phy =dptx_phy;
 
  Shouldn't it be samsung,dp_phy ?
 
  Do you mean this ? It is not working.
  +   dp_phy = samsung,dp_phy;
 I din't get this.
 What do I need to change here?

As Tomasz Figa mentioned, it means that

-+  dp_phy =dptx_phy;
++  samsung,dp_phy =dptx_phy;

It is because this is a Samsung-specific property.

Best regards,
Jingoo Han



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


RE: [PATCH] usb: ehci-s5p: use clk_prepare_enable and clk_disable_unprepare

2012-10-03 Thread Jingoo Han
On Wednesday, October 03, 2012 8:41 AM Thomas Abraham wrote
 
 Convert clk_enable/clk_disable to clk_prepare_enable/clk_disable_unprepare
 calls as required by common clock framework.
 
 Signed-off-by: Thomas Abraham thomas.abra...@linaro.org


It looks good. Also, I have tested this patch with Exynos4210.

Acked-by: Jingoo Han jg1@samsung.com


Best regards,
Jingoo Han

 ---
  drivers/usb/host/ehci-s5p.c |   10 +-
  1 files changed, 5 insertions(+), 5 deletions(-)
 
 diff --git a/drivers/usb/host/ehci-s5p.c b/drivers/usb/host/ehci-s5p.c
 index 85b74be..abc178d 100644
 --- a/drivers/usb/host/ehci-s5p.c
 +++ b/drivers/usb/host/ehci-s5p.c
 @@ -136,7 +136,7 @@ static int __devinit s5p_ehci_probe(struct 
 platform_device *pdev)
   goto fail_clk;
   }
 
 - err = clk_enable(s5p_ehci-clk);
 + err = clk_prepare_enable(s5p_ehci-clk);
   if (err)
   goto fail_clk;
 
 @@ -183,7 +183,7 @@ static int __devinit s5p_ehci_probe(struct 
 platform_device *pdev)
   return 0;
 
  fail_io:
 - clk_disable(s5p_ehci-clk);
 + clk_disable_unprepare(s5p_ehci-clk);
  fail_clk:
   usb_put_hcd(hcd);
   return err;
 @@ -200,7 +200,7 @@ static int __devexit s5p_ehci_remove(struct 
 platform_device *pdev)
   if (pdata  pdata-phy_exit)
   pdata-phy_exit(pdev, S5P_USB_PHY_HOST);
 
 - clk_disable(s5p_ehci-clk);
 + clk_disable_unprepare(s5p_ehci-clk);
 
   usb_put_hcd(hcd);
 
 @@ -231,7 +231,7 @@ static int s5p_ehci_suspend(struct device *dev)
   if (pdata  pdata-phy_exit)
   pdata-phy_exit(pdev, S5P_USB_PHY_HOST);
 
 - clk_disable(s5p_ehci-clk);
 + clk_disable_unprepare(s5p_ehci-clk);
 
   return rc;
  }
 @@ -243,7 +243,7 @@ static int s5p_ehci_resume(struct device *dev)
   struct platform_device *pdev = to_platform_device(dev);
   struct s5p_ehci_platdata *pdata = pdev-dev.platform_data;
 
 - clk_enable(s5p_ehci-clk);
 + clk_prepare_enable(s5p_ehci-clk);
 
   if (pdata  pdata-phy_init)
   pdata-phy_init(pdev, S5P_USB_PHY_HOST);
 --
 1.7.4.1

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