[PATCH] video: exynos_dp: use clk_prepare_enable and clk_disable_unprepare

2012-10-03 Thread Jingoo Han
Convert clk_enable/clk_disable to clk_prepare_enable/clk_disable_unprepare
calls as required by common clock framework.

Signed-off-by: Jingoo Han 
---
 drivers/video/exynos/exynos_dp_core.c |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/video/exynos/exynos_dp_core.c 
b/drivers/video/exynos/exynos_dp_core.c
index cdc1398..d55470e 100644
--- a/drivers/video/exynos/exynos_dp_core.c
+++ b/drivers/video/exynos/exynos_dp_core.c
@@ -885,7 +885,7 @@ static int __devinit exynos_dp_probe(struct platform_device 
*pdev)
return PTR_ERR(dp->clock);
}
 
-   clk_enable(dp->clock);
+   clk_prepare_enable(dp->clock);
 
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 
@@ -956,7 +956,7 @@ static int __devexit exynos_dp_remove(struct 
platform_device *pdev)
if (pdata && pdata->phy_exit)
pdata->phy_exit();
 
-   clk_disable(dp->clock);
+   clk_disable_unprepare(dp->clock);
 
return 0;
 }
@@ -971,7 +971,7 @@ static int exynos_dp_suspend(struct device *dev)
if (pdata && pdata->phy_exit)
pdata->phy_exit();
 
-   clk_disable(dp->clock);
+   clk_disable_unprepare(dp->clock);
 
return 0;
 }
@@ -985,7 +985,7 @@ static int exynos_dp_resume(struct device *dev)
if (pdata && pdata->phy_init)
pdata->phy_init();
 
-   clk_enable(dp->clock);
+   clk_prepare_enable(dp->clock);
 
exynos_dp_init_dp(dp);
 
-- 
1.7.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


Re: [PATCH] video: s3c-fb: use clk_prepare_enable and clk_disable_unprepare

2012-10-03 Thread Jingoo Han
On Wednesday, October 03, 2012 8:58 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 


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

Acked-by: Jingoo Han 


Best regards,
Jingoo Han


> ---
>  drivers/video/s3c-fb.c |   28 ++--
>  1 files changed, 14 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
> index 52b744f..2ed7b63 100644
> --- a/drivers/video/s3c-fb.c
> +++ b/drivers/video/s3c-fb.c
> @@ -1404,7 +1404,7 @@ static int __devinit s3c_fb_probe(struct 
> platform_device *pdev)
>   return PTR_ERR(sfb->bus_clk);
>   }
> 
> - clk_enable(sfb->bus_clk);
> + clk_prepare_enable(sfb->bus_clk);
> 
>   if (!sfb->variant.has_clksel) {
>   sfb->lcd_clk = devm_clk_get(dev, "sclk_fimd");
> @@ -1414,7 +1414,7 @@ static int __devinit s3c_fb_probe(struct 
> platform_device *pdev)
>   goto err_bus_clk;
>   }
> 
> - clk_enable(sfb->lcd_clk);
> + clk_prepare_enable(sfb->lcd_clk);
>   }
> 
>   pm_runtime_enable(sfb->dev);
> @@ -1504,10 +1504,10 @@ err_lcd_clk:
>   pm_runtime_disable(sfb->dev);
> 
>   if (!sfb->variant.has_clksel)
> - clk_disable(sfb->lcd_clk);
> + clk_disable_unprepare(sfb->lcd_clk);
> 
>  err_bus_clk:
> - clk_disable(sfb->bus_clk);
> + clk_disable_unprepare(sfb->bus_clk);
> 
>   return ret;
>  }
> @@ -1531,9 +1531,9 @@ static int __devexit s3c_fb_remove(struct 
> platform_device *pdev)
>   s3c_fb_release_win(sfb, sfb->windows[win]);
> 
>   if (!sfb->variant.has_clksel)
> - clk_disable(sfb->lcd_clk);
> + clk_disable_unprepare(sfb->lcd_clk);
> 
> - clk_disable(sfb->bus_clk);
> + clk_disable_unprepare(sfb->bus_clk);
> 
>   pm_runtime_put_sync(sfb->dev);
>   pm_runtime_disable(sfb->dev);
> @@ -1561,9 +1561,9 @@ static int s3c_fb_suspend(struct device *dev)
>   }
> 
>   if (!sfb->variant.has_clksel)
> - clk_disable(sfb->lcd_clk);
> + clk_disable_unprepare(sfb->lcd_clk);
> 
> - clk_disable(sfb->bus_clk);
> + clk_disable_unprepare(sfb->bus_clk);
> 
>   pm_runtime_put_sync(sfb->dev);
> 
> @@ -1581,10 +1581,10 @@ static int s3c_fb_resume(struct device *dev)
> 
>   pm_runtime_get_sync(sfb->dev);
> 
> - clk_enable(sfb->bus_clk);
> + clk_prepare_enable(sfb->bus_clk);
> 
>   if (!sfb->variant.has_clksel)
> - clk_enable(sfb->lcd_clk);
> + clk_prepare_enable(sfb->lcd_clk);
> 
>   /* setup gpio and output polarity controls */
>   pd->setup_gpio();
> @@ -1640,9 +1640,9 @@ static int s3c_fb_runtime_suspend(struct device *dev)
>   struct s3c_fb *sfb = platform_get_drvdata(pdev);
> 
>   if (!sfb->variant.has_clksel)
> - clk_disable(sfb->lcd_clk);
> + clk_disable_unprepare(sfb->lcd_clk);
> 
> - clk_disable(sfb->bus_clk);
> + clk_disable_unprepare(sfb->bus_clk);
> 
>   return 0;
>  }
> @@ -1653,10 +1653,10 @@ static int s3c_fb_runtime_resume(struct device *dev)
>   struct s3c_fb *sfb = platform_get_drvdata(pdev);
>   struct s3c_fb_platdata *pd = sfb->pdata;
> 
> - clk_enable(sfb->bus_clk);
> + clk_prepare_enable(sfb->bus_clk);
> 
>   if (!sfb->variant.has_clksel)
> - clk_enable(sfb->lcd_clk);
> + clk_prepare_enable(sfb->lcd_clk);
> 
>   /* setup gpio and output polarity controls */
>   pd->setup_gpio();
> --
> 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


RE: [PATCH] usb: ohci-exynos: use clk_prepare_enable and clk_disable_unprepare

2012-10-03 Thread Jingoo Han
On Wednesday, October 03, 2012 8:42 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 


Acked-by: Jingoo Han 


Best regards,
Jingoo Han


> ---
>  drivers/usb/host/ohci-exynos.c |   10 +-
>  1 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c
> index 20a5008..7bca600 100644
> --- a/drivers/usb/host/ohci-exynos.c
> +++ b/drivers/usb/host/ohci-exynos.c
> @@ -123,7 +123,7 @@ static int __devinit exynos_ohci_probe(struct 
> platform_device *pdev)
>   goto fail_clk;
>   }
> 
> - err = clk_enable(exynos_ohci->clk);
> + err = clk_prepare_enable(exynos_ohci->clk);
>   if (err)
>   goto fail_clken;
> 
> @@ -167,7 +167,7 @@ static int __devinit exynos_ohci_probe(struct 
> platform_device *pdev)
>   return 0;
> 
>  fail_io:
> - clk_disable(exynos_ohci->clk);
> + clk_disable_unprepare(exynos_ohci->clk);
>  fail_clken:
>   clk_put(exynos_ohci->clk);
>  fail_clk:
> @@ -186,7 +186,7 @@ static int __devexit exynos_ohci_remove(struct 
> platform_device *pdev)
>   if (pdata && pdata->phy_exit)
>   pdata->phy_exit(pdev, S5P_USB_PHY_HOST);
> 
> - clk_disable(exynos_ohci->clk);
> + clk_disable_unprepare(exynos_ohci->clk);
>   clk_put(exynos_ohci->clk);
> 
>   usb_put_hcd(hcd);
> @@ -232,7 +232,7 @@ static int exynos_ohci_suspend(struct device *dev)
>   if (pdata && pdata->phy_exit)
>   pdata->phy_exit(pdev, S5P_USB_PHY_HOST);
> 
> - clk_disable(exynos_ohci->clk);
> + clk_disable_unprepare(exynos_ohci->clk);
> 
>  fail:
>   spin_unlock_irqrestore(&ohci->lock, flags);
> @@ -247,7 +247,7 @@ static int exynos_ohci_resume(struct device *dev)
>   struct platform_device *pdev = to_platform_device(dev);
>   struct exynos4_ohci_platdata *pdata = pdev->dev.platform_data;
> 
> - clk_enable(exynos_ohci->clk);
> + clk_prepare_enable(exynos_ohci->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


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 


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

Acked-by: Jingoo Han 


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


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

---
  .../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 
  #include 
  #include 
+#include 
  #include 
  #include 
  #include 
@@ -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  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  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


[PATCH] input: keyboard: gpio-keys: Try to parse IRQ from device tree

2012-10-03 Thread Tomasz Figa
On modern platforms using device tree and non-legacy IRQ domains there
is usually no way to perform direct translation between GPIO and IRQ,
because the IRQ of interest is not mapped yet into sparse IRQ namespace.

This patch modifies the gpio_keys driver to parse IRQ from device tree
and use gpio_to_irq only as a fallback.

Signed-off-by: Tomasz Figa 
---
 Documentation/devicetree/bindings/gpio/gpio_keys.txt | 2 ++
 drivers/input/keyboard/gpio_keys.c   | 4 +++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/gpio/gpio_keys.txt 
b/Documentation/devicetree/bindings/gpio/gpio_keys.txt
index 5c2c021..7f318a5 100644
--- a/Documentation/devicetree/bindings/gpio/gpio_keys.txt
+++ b/Documentation/devicetree/bindings/gpio/gpio_keys.txt
@@ -20,6 +20,8 @@ Optional subnode-properties:
- debounce-interval: Debouncing interval time in milliseconds.
  If not specified defaults to 5.
- gpio-key,wakeup: Boolean, button can wake-up the system.
+   - interrupt: Interrupt used for this key (required if no translation
+ between GPIO and IRQ is available).
 
 Example nodes:
 
diff --git a/drivers/input/keyboard/gpio_keys.c 
b/drivers/input/keyboard/gpio_keys.c
index 6a68041..a33660c 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 struct gpio_button_data {
@@ -464,7 +465,7 @@ static int __devinit gpio_keys_setup_key(struct 
platform_device *pdev,
button->debounce_interval;
}
 
-   irq = gpio_to_irq(button->gpio);
+   irq = (button->irq) ? : gpio_to_irq(button->gpio);
if (irq < 0) {
error = irq;
dev_err(dev,
@@ -597,6 +598,7 @@ gpio_keys_get_devtree_pdata(struct device *dev)
 
button = &pdata->buttons[i++];
 
+   button->irq = irq_of_parse_and_map(pp, 0);
button->gpio = of_get_gpio_flags(pp, 0, &flags);
button->active_low = flags & OF_GPIO_ACTIVE_LOW;
 
-- 
1.7.12

--
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 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 R&D 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] [media] s5p-jpeg: use clk_prepare_enable and clk_disable_unprepare

2012-10-03 Thread Sylwester Nawrocki
On 10/03/2012 01:55 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 

Applied, thanks.
--
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


[PATCH 1/5] usb: phy: samsung: Introducing usb phy driver for hsotg

2012-10-03 Thread Praveen Paneri
>From v6:
Added TODO for phy bindings with controller
Dropped platform_set_drvdata() from driver probe

This driver uses usb_phy interface to interact with s3c-hsotg. Supports
phy_init and phy_shutdown functions to enable/disable phy. Tested with
smdk6410 and smdkv310. More SoCs can be brought under later.

Signed-off-by: Praveen Paneri 
Acked-by: Heiko Stuebner 
---
 .../devicetree/bindings/usb/samsung-usbphy.txt |   11 +
 drivers/usb/phy/Kconfig|8 +
 drivers/usb/phy/Makefile   |1 +
 drivers/usb/phy/samsung-usbphy.c   |  355 
 include/linux/platform_data/samsung-usbphy.h   |   27 ++
 5 files changed, 402 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/usb/samsung-usbphy.txt
 create mode 100644 drivers/usb/phy/samsung-usbphy.c
 create mode 100644 include/linux/platform_data/samsung-usbphy.h

diff --git a/Documentation/devicetree/bindings/usb/samsung-usbphy.txt 
b/Documentation/devicetree/bindings/usb/samsung-usbphy.txt
new file mode 100644
index 000..7d54d59
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/samsung-usbphy.txt
@@ -0,0 +1,11 @@
+* Samsung's usb phy transceiver
+
+The Samsung's phy transceiver is used for controlling usb otg phy for
+s3c-hsotg usb device controller.
+TODO: Adding the PHY binding with controller(s) according to the under 
+developement generic PHY driver.
+
+Required properties:
+- compatible : should be "samsung,exynos4210-usbphy"
+- reg : base physical address of the phy registers and length of memory mapped
+   region.
diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig
index 63c339b..313685f 100644
--- a/drivers/usb/phy/Kconfig
+++ b/drivers/usb/phy/Kconfig
@@ -32,3 +32,11 @@ config MV_U3D_PHY
help
  Enable this to support Marvell USB 3.0 phy controller for Marvell
  SoC.
+
+config SAMSUNG_USBPHY
+   bool "Samsung USB PHY controller Driver"
+   depends on USB_S3C_HSOTG
+   select USB_OTG_UTILS
+   help
+ Enable this to support Samsung USB phy controller for samsung
+ SoCs.
diff --git a/drivers/usb/phy/Makefile b/drivers/usb/phy/Makefile
index b069f29..55dcfc1 100644
--- a/drivers/usb/phy/Makefile
+++ b/drivers/usb/phy/Makefile
@@ -8,3 +8,4 @@ obj-$(CONFIG_OMAP_USB2) += omap-usb2.o
 obj-$(CONFIG_USB_ISP1301)  += isp1301.o
 obj-$(CONFIG_MV_U3D_PHY)   += mv_u3d_phy.o
 obj-$(CONFIG_USB_EHCI_TEGRA)   += tegra_usb_phy.o
+obj-$(CONFIG_SAMSUNG_USBPHY)   += samsung-usbphy.o
diff --git a/drivers/usb/phy/samsung-usbphy.c b/drivers/usb/phy/samsung-usbphy.c
new file mode 100644
index 000..ee2dee0
--- /dev/null
+++ b/drivers/usb/phy/samsung-usbphy.c
@@ -0,0 +1,355 @@
+/* linux/drivers/usb/phy/samsung-usbphy.c
+ *
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ *  http://www.samsung.com
+ *
+ * Author: Praveen Paneri 
+ *
+ * Samsung USB2.0 High-speed OTG transceiver, talks to S3C HS OTG controller
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/* Register definitions */
+
+#define S3C_PHYPWR (0x00)
+
+#define S3C_PHYPWR_NORMAL_MASK (0x19 << 0)
+#define S3C_PHYPWR_OTG_DISABLE (1 << 4)
+#define S3C_PHYPWR_ANALOG_POWERDOWN(1 << 3)
+#define S3C_PHYPWR_FORCE_SUSPEND   (1 << 1)
+/* For Exynos4 */
+#define EXYNOS4_PHYPWR_NORMAL_MASK (0x39 << 0)
+#define EXYNOS4_PHYPWR_SLEEP   (1 << 5)
+
+#define S3C_PHYCLK (0x04)
+
+#define S3C_PHYCLK_MODE_SERIAL (1 << 6)
+#define S3C_PHYCLK_EXT_OSC (1 << 5)
+#define S3C_PHYCLK_COMMON_ON_N (1 << 4)
+#define S3C_PHYCLK_ID_PULL (1 << 2)
+#define S3C_PHYCLK_CLKSEL_MASK (0x3 << 0)
+#define S3C_PHYCLK_CLKSEL_SHIFT(0)
+#define S3C_PHYCLK_CLKSEL_48M  (0x0 << 0)
+#define S3C_PHYCLK_CLKSEL_12M  (0x2 << 0)
+#define S3C_PHYCLK_CLKSEL_24M  (0x3 << 0)
+
+#define S3C_RSTCON (0x08)
+
+#define S3C_RSTCON_PHYCLK  (1 << 2)
+#define S3C_RSTCON_HCLK(1 << 1)
+#define S3C_RSTCON_PHY (1 << 0)
+
+#ifndef MHZ
+#define MHZ (1000*1000)
+#endif
+
+enum samsung_cpu_type {
+   TYPE_S3C64XX,
+   TY

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

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

I think this patch could be split into several smaller, while retaining logical 
integrity of particular patches, e.g.:
 - the change introduced to __clk_init (with proper description and rationale 
why the generic code is being touched)
 - generic exynos4 code
 - exynos4210-specific code
 - exynos4x12-specific code
 - patch enabling common clock framework on exynos4.

Also, see some nitpicks inline.

On Monday 01 of October 2012 17:39:21 chander.kash...@linaro.org wrote:
> From: Thomas Abraham 
> 
> Register clocks for Exynos4 platfotms using common clock framework.
> Also included are set of helper functions for clock registration
> that can be reused on other Samsung platforms as well.
> 
> Cc: Mike Turquette 
> Cc: Kukjin Kim 
> Signed-off-by: Thomas Abraham 
> ---
>  arch/arm/mach-exynos/Kconfig  |1 +
>  arch/arm/mach-exynos/common.h |3 +
>  arch/arm/mach-exynos/mct.c|   11 +-
>  arch/arm/plat-samsung/Kconfig |4 +-
>  drivers/clk/Makefile  |1 +
>  drivers/clk/clk.c |   12 +-
>  drivers/clk/samsung/Makefile  |6 +
>  drivers/clk/samsung/clk-exynos4.c |  585
> + drivers/clk/samsung/clk.c
> |  231 +++
>  drivers/clk/samsung/clk.h |  190 
>  10 files changed, 1037 insertions(+), 7 deletions(-)
>  create mode 100644 drivers/clk/samsung/Makefile
>  create mode 100644 drivers/clk/samsung/clk-exynos4.c
>  create mode 100644 drivers/clk/samsung/clk.c
>  create mode 100644 drivers/clk/samsung/clk.h
> 
> diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
> index b5b4c8c..4866ec7 100644
> --- a/arch/arm/mach-exynos/Kconfig
> +++ b/arch/arm/mach-exynos/Kconfig
> @@ -15,6 +15,7 @@ config ARCH_EXYNOS4
>   bool "SAMSUNG EXYNOS4"
>   default y
>   select HAVE_SMP
> + select COMMON_CLK
>   select MIGHT_HAVE_CACHE_L2X0
>   help
> Samsung EXYNOS4 SoCs based systems
> diff --git a/arch/arm/mach-exynos/common.h
> b/arch/arm/mach-exynos/common.h index aed2eeb..2274431 100644
> --- a/arch/arm/mach-exynos/common.h
> +++ b/arch/arm/mach-exynos/common.h
> @@ -21,6 +21,9 @@ void exynos4_restart(char mode, const char *cmd);
>  void exynos5_restart(char mode, const char *cmd);
>  void exynos_init_late(void);
> 
> +void exynos4210_clk_init(void);
> +void exynos4212_clk_init(void);

exynos4x12_clk_init?

> +
>  #ifdef CONFIG_PM_GENERIC_DOMAINS
>  int exynos_pm_late_initcall(void);
>  #else
> diff --git a/arch/arm/mach-exynos/mct.c b/arch/arm/mach-exynos/mct.c
> index b601fb8..a7cace0 100644
> --- a/arch/arm/mach-exynos/mct.c
> +++ b/arch/arm/mach-exynos/mct.c
> @@ -30,6 +30,8 @@
>  #include 
>  #include 
> 
> +#include "common.h"
> +
>  #define TICK_BASE_CNT1
> 
>  enum {
> @@ -457,7 +459,7 @@ static struct local_timer_ops exynos4_mct_tick_ops
> __cpuinitdata = { static void __init exynos4_timer_resources(void)
>  {
>   struct clk *mct_clk;
> - mct_clk = clk_get(NULL, "xtal");
> + mct_clk = clk_get(NULL, "fin_pll");
> 
>   clk_rate = clk_get_rate(mct_clk);
> 
> @@ -478,6 +480,13 @@ static void __init exynos4_timer_resources(void)
> 
>  static void __init exynos4_timer_init(void)
>  {
> +#ifdef CONFIG_COMMON_CLK
> + if (soc_is_exynos4210())
> + exynos4210_clk_init();
> + else if (soc_is_exynos4212() || soc_is_exynos4412())
> + exynos4212_clk_init();

exynos4x12_clk_init?

> +#endif
> +
>   if ((soc_is_exynos4210()) || (soc_is_exynos5250()))
>   mct_int_type = MCT_INT_SPI;
>   else
> diff --git a/arch/arm/plat-samsung/Kconfig
> b/arch/arm/plat-samsung/Kconfig index 9c3b90c..35b4cb8 100644
> --- a/arch/arm/plat-samsung/Kconfig
> +++ b/arch/arm/plat-samsung/Kconfig
> @@ -26,7 +26,7 @@ config PLAT_S5P
>   select S5P_GPIO_DRVSTR
>   select SAMSUNG_GPIOLIB_4BIT
>   select PLAT_SAMSUNG
> - select SAMSUNG_CLKSRC
> + select SAMSUNG_CLKSRC if !COMMON_CLK
>   select SAMSUNG_IRQ_VIC_TIMER
>   help
> Base platform code for Samsung's S5P series SoC.
> @@ -89,7 +89,7 @@ config SAMSUNG_CLKSRC
> used by newer systems such as the S3C64XX.
> 
>  config S5P_CLOCK
> - def_bool (ARCH_S5P64X0 || ARCH_S5PC100 || ARCH_S5PV210 || ARCH_EXYNOS)
> + def_bool ((ARCH_S5P64X0 || ARCH_S5PC100 || ARCH_S5PV210 || ARCH_EXYNOS)
> && !COMMON_CLK) help
> Support common clock part for ARCH_S5P and ARCH_EXYNOS SoCs
> 
> diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile
> index 6327536..5f5b060 100644
> --- a/drivers/clk/Makefile
> +++ b/drivers/clk/Makefile
> @@ -16,6 +16,7 @@ obj-$(CONFIG_ARCH_MMP)  += mmp/
>  endif
>  obj-$(CONFIG_MACH_LOONGSON1) += clk-ls1x.o
>  obj-$(CONFIG_ARCH_U8500) += ux500/
> +obj-$(CONFIG_PLAT_SAMSUNG)   += samsung/
> 
>  # Chip specific
>  obj-$(CONFIG_COMMON_CLK_WM831X) += clk-wm831x.o
> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> index 56e4495..456c50b 100644
> 

Re: [PATCH 0/2] ARM: Exynos4: Migrate to common clock framework.

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

On Monday 01 of October 2012 17:39:19 chander.kash...@linaro.org wrote:
> From: Thomas Abraham 
> 
> This patch series migrates Exynos4 clock support to common clock
> framework. The first patch in this series removes the existing Exynos4
> clock support that uses the Samsung specific clock framework. The second
> patch in this series add Exynos4 clock support using common clock
> framework.
> 
> Thomas Abraham (2):
>   ARM: Exynos4: Remove Samsung clock type support
>   ARM: Exynos4: Register clocks via common clock framework

I think the order of changes is a little bit off here:
 - patch 1 will break all exynos4-based boards (what about bisects?)
 - patch 2 will be still broken until all related drivers get converted to 
use clk_prepare(_enable) and clk_(disable_)unprepare.

Shouldn't the order be exactly opposite, i.e.:
 - all the patches for prepare/unprepare first
 - then the patch adding common clock frameworks support for exynos4 
(disabling the old clock code)
 - and finally the patch removing remaining (disabled by previous patch) 
code.

Also, I assume that these patches doesn't consider native device tree 
support (without auxdata, using OF-based clock lookup), correct me if I'm 
wrong. If I'm right, since Exynos SoCs are going to be DT-only, is there 
really a point for adding common clock framework support for non-DT 
platforms (which are going to be eventually dropped anyway)?

Best regards,
-- 
Tomasz Figa
Samsung Poland R&D 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