Re: Problem using S3C2416's HSSPI

2012-10-02 Thread Sylwester Nawrocki
On 10/02/2012 01:47 AM, Heiko Stübner wrote:
 diff --git a/arch/arm/mach-s3c24xx/common-s3c2443.c
 b/arch/arm/mach-s3c24xx/common-s3c2443.c index aeeb2be..aeb4a24 100644
 --- a/arch/arm/mach-s3c24xx/common-s3c2443.c
 +++ b/arch/arm/mach-s3c24xx/common-s3c2443.c
 @@ -559,7 +559,7 @@ static struct clk hsmmc1_clk = {

  static struct clk hsspi_clk = {
 .name   = spi,
 -   .devname= s3c64xx-spi.0,
 +   .devname= s3c2443-spi.0,
 .parent = clk_p,
 .enable = s3c2443_clkcon_enable_p,
 .ctrlbit= S3C2443_PCLKCON_HSSPI,
 @@ -633,7 +633,7 @@ static struct clk_lookup s3c2443_clk_lookup[] = {
 CLKDEV_INIT(NULL, clk_uart_baud2, clk_p),
 CLKDEV_INIT(NULL, clk_uart_baud3, clk_esys_uart.clk),
 CLKDEV_INIT(s3c-sdhci.1, mmc_busclk.0, hsmmc1_clk),
 -   CLKDEV_INIT(s3c64xx-spi.0, spi_busclk0, hsspi_clk),
 +   CLKDEV_INIT(s3c2443-spi.0, spi_busclk0, hsspi_clk),
  };
 
 ahaa ... that's the cause. As far as I was able to determine, in the patchset 
 only the clocks were renamed and the different device names introduced.
 
 The spi devices did not get a function to set the name, like for the rtc, adc 
 and nand. The devices are named s3c6410-spi by default, so it seems only the 
 s3c64xx machines should have a working spi currently.

That reminds me that I have some patches that set the SPI device names and
I have been using those for non-dt exynos platform. Yes, it looks like we
need a generic function for all Samsung machines that would override SPI
device names on all except mach-s3c64xx.

 I'm working on a patch to fix this for all Samsung arches.

OK. I have something like this too. Anyway it seems SPI is now broken on
all non-dt machines except s3c64xx in kernel 3.6. Perhaps these patches
should be also sent now to sta...@vger.kernel.org.

Regards,
Sylwester


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


[PATCH v2 1/4] ARM: EXYNOS: pm_domain: Detect domain state on registration from DT

2012-10-02 Thread Tomasz Figa
Initial state of power domains might vary on different boards and with
different bootloaders. This patch adds detection of initial state of
power domains when being registered from DT.

Signed-off-by: Tomasz Figa t.f...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 Documentation/devicetree/bindings/arm/exynos/power_domain.txt | 4 
 arch/arm/mach-exynos/pm_domains.c | 8 +---
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/Documentation/devicetree/bindings/arm/exynos/power_domain.txt 
b/Documentation/devicetree/bindings/arm/exynos/power_domain.txt
index 6528e21..843b546 100644
--- a/Documentation/devicetree/bindings/arm/exynos/power_domain.txt
+++ b/Documentation/devicetree/bindings/arm/exynos/power_domain.txt
@@ -9,10 +9,6 @@ Required Properties:
 - reg: physical base address of the controller and length of memory mapped
 region.
 
-Optional Properties:
-- samsung,exynos4210-pd-off: Specifies that the power domain is in turned-off
-state during boot and remains to be turned-off until explicitly turned-on.
-
 Example:
 
lcd0: power-domain-lcd0 {
diff --git a/arch/arm/mach-exynos/pm_domains.c 
b/arch/arm/mach-exynos/pm_domains.c
index c0bc83a..d1abc1a 100644
--- a/arch/arm/mach-exynos/pm_domains.c
+++ b/arch/arm/mach-exynos/pm_domains.c
@@ -89,6 +89,7 @@ static __init int exynos_pm_dt_parse_domains(void)
 
for_each_compatible_node(np, NULL, samsung,exynos4210-pd) {
struct exynos_pm_domain *pd;
+   int on;
 
pd = kzalloc(sizeof(*pd), GFP_KERNEL);
if (!pd) {
@@ -97,14 +98,15 @@ static __init int exynos_pm_dt_parse_domains(void)
return -ENOMEM;
}
 
-   if (of_get_property(np, samsung,exynos4210-pd-off, NULL))
-   pd-is_off = true;
pd-name = np-name;
pd-base = of_iomap(np, 0);
pd-pd.power_off = exynos_pd_power_off;
pd-pd.power_on = exynos_pd_power_on;
pd-pd.of_node = np;
-   pm_genpd_init(pd-pd, NULL, false);
+
+   on = __raw_readl(pd-base + 0x4)  S5P_INT_LOCAL_PWR_EN;
+
+   pm_genpd_init(pd-pd, NULL, !on);
}
return 0;
 }
-- 
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


[PATCH v2 2/4] ARM: EXYNOS: pm_domain: Fix power domain name initialization

2012-10-02 Thread Tomasz Figa
This patch adds initialization of name field in generic power domain
struct.

Signed-off-by: Tomasz Figa t.f...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 arch/arm/mach-exynos/pm_domains.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-exynos/pm_domains.c 
b/arch/arm/mach-exynos/pm_domains.c
index d1abc1a..5b7ce7e 100644
--- a/arch/arm/mach-exynos/pm_domains.c
+++ b/arch/arm/mach-exynos/pm_domains.c
@@ -98,7 +98,8 @@ static __init int exynos_pm_dt_parse_domains(void)
return -ENOMEM;
}
 
-   pd-name = np-name;
+   pd-pd.name = kstrdup(np-name, GFP_KERNEL);
+   pd-name = pd-pd.name;
pd-base = of_iomap(np, 0);
pd-pd.power_off = exynos_pd_power_off;
pd-pd.power_on = exynos_pd_power_on;
-- 
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


[PATCH v2 3/4] ARM: EXYNOS: pm_domain: Bind devices to power domains using DT

2012-10-02 Thread Tomasz Figa
This patch adds a way to specify bindings between devices and power
domains using device tree.

A device can be bound to particular power domain by adding a
power-domain property containing a phandle to the domain. The device
will be bound to the domain before binding a driver to it and unbound
after unbinding a driver from it.

Signed-off-by: Tomasz Figa t.f...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 .../bindings/arm/exynos/power_domain.txt   | 13 +++-
 arch/arm/mach-exynos/pm_domains.c  | 82 ++
 2 files changed, 94 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/arm/exynos/power_domain.txt 
b/Documentation/devicetree/bindings/arm/exynos/power_domain.txt
index 843b546..5216b41 100644
--- a/Documentation/devicetree/bindings/arm/exynos/power_domain.txt
+++ b/Documentation/devicetree/bindings/arm/exynos/power_domain.txt
@@ -4,14 +4,25 @@ Exynos processors include support for multiple power domains 
which are used
 to gate power to one or more peripherals on the processor.
 
 Required Properties:
-- compatiable: should be one of the following.
+- compatible: should be one of the following.
 * samsung,exynos4210-pd - for exynos4210 type power domain.
 - reg: physical base address of the controller and length of memory mapped
 region.
 
+Node of a device using power domains must have a samsung,power-domain property
+defined with a phandle to respective power domain.
+
 Example:
 
lcd0: power-domain-lcd0 {
compatible = samsung,exynos4210-pd;
reg = 0x10023C00 0x10;
};
+
+Example of the node using power domain:
+
+   node {
+   /* ... */
+   samsung,power-domain = lcd0;
+   /* ... */
+   };
diff --git a/arch/arm/mach-exynos/pm_domains.c 
b/arch/arm/mach-exynos/pm_domains.c
index 5b7ce7e..4063016 100644
--- a/arch/arm/mach-exynos/pm_domains.c
+++ b/arch/arm/mach-exynos/pm_domains.c
@@ -19,6 +19,8 @@
 #include linux/pm_domain.h
 #include linux/delay.h
 #include linux/of_address.h
+#include linux/of_platform.h
+#include linux/sched.h
 
 #include mach/regs-pmu.h
 #include plat/devs.h
@@ -83,14 +85,89 @@ static struct exynos_pm_domain PD = {   
\
 }
 
 #ifdef CONFIG_OF
+static void exynos_add_device_to_domain(struct exynos_pm_domain *pd,
+   struct device *dev)
+{
+   int ret;
+
+   dev_dbg(dev, adding to power domain %s\n, pd-pd.name);
+
+   while(1) {
+   ret = pm_genpd_add_device(pd-pd, dev);
+   if (ret != -EAGAIN)
+   break;
+   cond_resched();
+   }
+
+   pm_genpd_dev_need_restore(dev, true);
+}
+
+static void exynos_remove_device_from_domain(struct device *dev)
+{
+   struct generic_pm_domain *genpd = dev_to_genpd(dev);
+   int ret;
+
+   dev_dbg(dev, removing from power domain %s\n, genpd-name);
+
+   while(1) {
+   ret = pm_genpd_remove_device(genpd, dev);
+   if (ret != -EAGAIN)
+   break;
+   cond_resched();
+   }
+}
+
+static void exynos_read_domain_from_dt(struct device *dev)
+{
+   struct platform_device *pd_pdev;
+   struct exynos_pm_domain *pd;
+   struct device_node *node;
+
+   node = of_parse_phandle(dev-of_node, samsung,power-domain, 0);
+   if (!node)
+   return;
+   pd_pdev = of_find_device_by_node(node);
+   if (!pd_pdev)
+   return;
+   pd = platform_get_drvdata(pd_pdev);
+   exynos_add_device_to_domain(pd, dev);
+}
+
+static int exynos_pm_notifier_call(struct notifier_block *nb,
+   unsigned long event, void *data)
+{
+   struct device *dev = data;
+
+   switch (event) {
+   case BUS_NOTIFY_BIND_DRIVER:
+   if (dev-of_node)
+   exynos_read_domain_from_dt(dev);
+
+   break;
+
+   case BUS_NOTIFY_UNBOUND_DRIVER:
+   exynos_remove_device_from_domain(dev);
+
+   break;
+   }
+   return NOTIFY_DONE;
+}
+
+static struct notifier_block platform_nb = {
+   .notifier_call = exynos_pm_notifier_call,
+};
+
 static __init int exynos_pm_dt_parse_domains(void)
 {
+   struct platform_device *pdev;
struct device_node *np;
 
for_each_compatible_node(np, NULL, samsung,exynos4210-pd) {
struct exynos_pm_domain *pd;
int on;
 
+   pdev = of_find_device_by_node(np);
+
pd = kzalloc(sizeof(*pd), GFP_KERNEL);
if (!pd) {
pr_err(%s: failed to allocate memory for domain\n,
@@ -105,10 +182,15 @@ static __init int exynos_pm_dt_parse_domains(void)
pd-pd.power_on = exynos_pd_power_on;
pd-pd.of_node = np;
 
+   platform_set_drvdata(pdev, pd);
+

[PATCH v2 4/4] ARM: dts: exynos4: Set up power domains

2012-10-02 Thread Tomasz Figa
This patch adds device tree nodes for power domains of Exynos4 SoCs.

Signed-off-by: Tomasz Figa t.f...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 arch/arm/boot/dts/exynos4.dtsi| 30 ++
 arch/arm/boot/dts/exynos4210.dtsi |  5 +
 2 files changed, 35 insertions(+)

diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi
index a26c3dd..0c14f50 100644
--- a/arch/arm/boot/dts/exynos4.dtsi
+++ b/arch/arm/boot/dts/exynos4.dtsi
@@ -30,6 +30,36 @@
spi2 = spi_2;
};
 
+   pd_mfc: mfc-power-domain@10023C40 {
+   compatible = samsung,exynos4210-pd;
+   reg = 0x10023C40 0x20;
+   };
+
+   pd_g3d: g3d-power-domain@10023C60 {
+   compatible = samsung,exynos4210-pd;
+   reg = 0x10023C60 0x20;
+   };
+
+   pd_lcd0: lcd0-power-domain@10023C80 {
+   compatible = samsung,exynos4210-pd;
+   reg = 0x10023C80 0x20;
+   };
+
+   pd_tv: tv-power-domain@10023C20 {
+   compatible = samsung,exynos4210-pd;
+   reg = 0x10023C20 0x20;
+   };
+
+   pd_cam: cam-power-domain@10023C00 {
+   compatible = samsung,exynos4210-pd;
+   reg = 0x10023C00 0x20;
+   };
+
+   pd_gps: gps-power-domain@10023CE0 {
+   compatible = samsung,exynos4210-pd;
+   reg = 0x10023CE0 0x20;
+   };
+
gic:interrupt-controller@1049 {
compatible = arm,cortex-a9-gic;
#interrupt-cells = 3;
diff --git a/arch/arm/boot/dts/exynos4210.dtsi 
b/arch/arm/boot/dts/exynos4210.dtsi
index 214c557..f9f840e 100644
--- a/arch/arm/boot/dts/exynos4210.dtsi
+++ b/arch/arm/boot/dts/exynos4210.dtsi
@@ -31,6 +31,11 @@
pinctrl2 = pinctrl_2;
};
 
+   pd_lcd1: lcd1-power-domain@10023CA0 {
+   compatible = samsung,exynos4210-pd;
+   reg = 0x10023CA0 0x20;
+   };
+
gic:interrupt-controller@1049 {
cpu-offset = 0x8000;
};
-- 
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


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

2012-10-02 Thread Tomasz Figa
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;
+}
+
 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),
-- 
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


[PATCH] ARM: SAMSUNG: Add naming of s3c64xx-spi devices

2012-10-02 Thread Heiko Stübner
Commit a5238e360b71 (spi: s3c64xx: move controller information into driver
data) introduced separate device names for the different subtypes of the
spi controller but forgot to set these in the relevant machines.

To fix this introduce a s3c64xx_spi_setname function and populate all
Samsung arches with the correct names. The function resides in a new
header, as the s3c64xx-spi.h contains driver platform data and should
therefore at some later point move out of the Samsung include dir.

Tested on a s3c2416-based machine.

Signed-off-by: Heiko Stuebner he...@sntech.de
Cc: sta...@vger.kernel.org
---
 arch/arm/mach-exynos/common.c |5 
 arch/arm/mach-s3c24xx/s3c2416.c   |2 +
 arch/arm/mach-s3c24xx/s3c2443.c   |4 +++
 arch/arm/mach-s5p64x0/common.c|3 ++
 arch/arm/mach-s5pc100/common.c|3 ++
 arch/arm/mach-s5pv210/common.c|3 ++
 arch/arm/plat-samsung/include/plat/spi-core.h |   30 +
 7 files changed, 50 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/plat-samsung/include/plat/spi-core.h

diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c
index 4eb39cd..3e02ae6 100644
--- a/arch/arm/mach-exynos/common.c
+++ b/arch/arm/mach-exynos/common.c
@@ -47,6 +47,7 @@
 #include plat/fimc-core.h
 #include plat/iic-core.h
 #include plat/tv-core.h
+#include plat/spi-core.h
 #include plat/regs-serial.h
 
 #include common.h
@@ -346,6 +347,8 @@ static void __init exynos4_map_io(void)
 
s5p_fb_setname(0, exynos4-fb);
s5p_hdmi_setname(exynos4-hdmi);
+
+   s3c64xx_spi_setname(exynos4210-spi);
 }
 
 static void __init exynos5_map_io(void)
@@ -366,6 +369,8 @@ static void __init exynos5_map_io(void)
s3c_i2c0_setname(s3c2440-i2c);
s3c_i2c1_setname(s3c2440-i2c);
s3c_i2c2_setname(s3c2440-i2c);
+
+   s3c64xx_spi_setname(exynos4210-spi);
 }
 
 static void __init exynos4_init_clocks(int xtal)
diff --git a/arch/arm/mach-s3c24xx/s3c2416.c b/arch/arm/mach-s3c24xx/s3c2416.c
index 20507c7..a24960c 100644
--- a/arch/arm/mach-s3c24xx/s3c2416.c
+++ b/arch/arm/mach-s3c24xx/s3c2416.c
@@ -61,6 +61,7 @@
 #include plat/nand-core.h
 #include plat/adc-core.h
 #include plat/rtc-core.h
+#include plat/spi-core.h
 
 static struct map_desc s3c2416_iodesc[] __initdata = {
IODESC_ENT(WATCHDOG),
@@ -147,6 +148,7 @@ void __init s3c2416_map_io(void)
/* initialize device information early */
s3c2416_default_sdhci0();
s3c2416_default_sdhci1();
+   s3c64xx_spi_setname(s3c2443-spi);
 
iotable_init(s3c2416_iodesc, ARRAY_SIZE(s3c2416_iodesc));
 }
diff --git a/arch/arm/mach-s3c24xx/s3c2443.c b/arch/arm/mach-s3c24xx/s3c2443.c
index ab648ad..165b6a6 100644
--- a/arch/arm/mach-s3c24xx/s3c2443.c
+++ b/arch/arm/mach-s3c24xx/s3c2443.c
@@ -43,6 +43,7 @@
 #include plat/nand-core.h
 #include plat/adc-core.h
 #include plat/rtc-core.h
+#include plat/spi-core.h
 
 static struct map_desc s3c2443_iodesc[] __initdata = {
IODESC_ENT(WATCHDOG),
@@ -100,6 +101,9 @@ void __init s3c2443_map_io(void)
s3c24xx_gpiocfg_default.set_pull = s3c2443_gpio_setpull;
s3c24xx_gpiocfg_default.get_pull = s3c2443_gpio_getpull;
 
+   /* initialize device information early */
+   s3c64xx_spi_setname(s3c2443-spi);
+
iotable_init(s3c2443_iodesc, ARRAY_SIZE(s3c2443_iodesc));
 }
 
diff --git a/arch/arm/mach-s5p64x0/common.c b/arch/arm/mach-s5p64x0/common.c
index 6e6a0a9..111e404 100644
--- a/arch/arm/mach-s5p64x0/common.c
+++ b/arch/arm/mach-s5p64x0/common.c
@@ -44,6 +44,7 @@
 #include plat/sdhci.h
 #include plat/adc-core.h
 #include plat/fb-core.h
+#include plat/spi-core.h
 #include plat/gpio-cfg.h
 #include plat/regs-irqtype.h
 #include plat/regs-serial.h
@@ -179,6 +180,7 @@ void __init s5p6440_map_io(void)
/* initialize any device information early */
s3c_adc_setname(s3c64xx-adc);
s3c_fb_setname(s5p64x0-fb);
+   s3c64xx_spi_setname(s5p64x0-spi);
 
s5p64x0_default_sdhci0();
s5p64x0_default_sdhci1();
@@ -193,6 +195,7 @@ void __init s5p6450_map_io(void)
/* initialize any device information early */
s3c_adc_setname(s3c64xx-adc);
s3c_fb_setname(s5p64x0-fb);
+   s3c64xx_spi_setname(s5p64x0-spi);
 
s5p64x0_default_sdhci0();
s5p64x0_default_sdhci1();
diff --git a/arch/arm/mach-s5pc100/common.c b/arch/arm/mach-s5pc100/common.c
index 6219086..cc6e561 100644
--- a/arch/arm/mach-s5pc100/common.c
+++ b/arch/arm/mach-s5pc100/common.c
@@ -45,6 +45,7 @@
 #include plat/fb-core.h
 #include plat/iic-core.h
 #include plat/onenand-core.h
+#include plat/spi-core.h
 #include plat/regs-serial.h
 #include plat/watchdog-reset.h
 
@@ -165,6 +166,8 @@ void __init s5pc100_map_io(void)
s3c_onenand_setname(s5pc100-onenand);
s3c_fb_setname(s5pc100-fb);
s3c_cfcon_setname(s5pc100-pata);
+
+   s3c64xx_spi_setname(s5pc100-spi);
 }
 
 

[PATCH] watchdog: s3c2410_wdt: use clk_prepare_enable and clk_disable_unprepare

2012-10-02 Thread Thomas Abraham
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
---
 drivers/watchdog/s3c2410_wdt.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c
index 9245b4d..3cdaaff 100644
--- a/drivers/watchdog/s3c2410_wdt.c
+++ b/drivers/watchdog/s3c2410_wdt.c
@@ -354,7 +354,7 @@ static int __devinit s3c2410wdt_probe(struct 
platform_device *pdev)
goto err_map;
}
 
-   clk_enable(wdt_clock);
+   clk_prepare_enable(wdt_clock);
 
ret = s3c2410wdt_cpufreq_register();
if (ret  0) {
@@ -421,7 +421,7 @@ static int __devinit s3c2410wdt_probe(struct 
platform_device *pdev)
s3c2410wdt_cpufreq_deregister();
 
  err_clk:
-   clk_disable(wdt_clock);
+   clk_disable_unprepare(wdt_clock);
clk_put(wdt_clock);
wdt_clock = NULL;
 
@@ -445,7 +445,7 @@ static int __devexit s3c2410wdt_remove(struct 
platform_device *dev)
 
s3c2410wdt_cpufreq_deregister();
 
-   clk_disable(wdt_clock);
+   clk_disable_unprepare(wdt_clock);
clk_put(wdt_clock);
wdt_clock = NULL;
 
-- 
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


[PATCH] i2c: s3c2410: use clk_prepare_enable and clk_disable_unprepare

2012-10-02 Thread Thomas Abraham
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
---
 drivers/i2c/busses/i2c-s3c2410.c |   18 +-
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index 4d07dea..3e0335f 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -601,14 +601,14 @@ static int s3c24xx_i2c_xfer(struct i2c_adapter *adap,
int ret;
 
pm_runtime_get_sync(adap-dev);
-   clk_enable(i2c-clk);
+   clk_prepare_enable(i2c-clk);
 
for (retry = 0; retry  adap-retries; retry++) {
 
ret = s3c24xx_i2c_doxfer(i2c, msgs, num);
 
if (ret != -EAGAIN) {
-   clk_disable(i2c-clk);
+   clk_disable_unprepare(i2c-clk);
pm_runtime_put(adap-dev);
return ret;
}
@@ -618,7 +618,7 @@ static int s3c24xx_i2c_xfer(struct i2c_adapter *adap,
udelay(100);
}
 
-   clk_disable(i2c-clk);
+   clk_disable_unprepare(i2c-clk);
pm_runtime_put(adap-dev);
return -EREMOTEIO;
 }
@@ -977,7 +977,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
 
dev_dbg(pdev-dev, clock source %p\n, i2c-clk);
 
-   clk_enable(i2c-clk);
+   clk_prepare_enable(i2c-clk);
 
/* map the registers */
 
@@ -1065,7 +1065,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
pm_runtime_enable(i2c-adap.dev);
 
dev_info(pdev-dev, %s: S3C I2C adapter\n, dev_name(i2c-adap.dev));
-   clk_disable(i2c-clk);
+   clk_disable_unprepare(i2c-clk);
return 0;
 
  err_cpufreq:
@@ -1082,7 +1082,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
kfree(i2c-ioarea);
 
  err_clk:
-   clk_disable(i2c-clk);
+   clk_disable_unprepare(i2c-clk);
clk_put(i2c-clk);
 
  err_noclk:
@@ -1106,7 +1106,7 @@ static int s3c24xx_i2c_remove(struct platform_device 
*pdev)
i2c_del_adapter(i2c-adap);
free_irq(i2c-irq, i2c);
 
-   clk_disable(i2c-clk);
+   clk_disable_unprepare(i2c-clk);
clk_put(i2c-clk);
 
iounmap(i2c-regs);
@@ -1135,9 +1135,9 @@ static int s3c24xx_i2c_resume(struct device *dev)
struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev);
 
i2c-suspended = 0;
-   clk_enable(i2c-clk);
+   clk_prepare_enable(i2c-clk);
s3c24xx_i2c_init(i2c);
-   clk_disable(i2c-clk);
+   clk_disable_unprepare(i2c-clk);
 
return 0;
 }
-- 
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


[PATCH] spi: s3c64xx: use clk_prepare_enable and clk_disable_unprepare

2012-10-02 Thread Thomas Abraham
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
---
 drivers/spi/spi-s3c64xx.c |   32 
 1 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index 9e55c44..9ad7109 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -516,7 +516,7 @@ static void s3c64xx_spi_config(struct 
s3c64xx_spi_driver_data *sdd)
 
/* Disable Clock */
if (sdd-port_conf-clk_from_cmu) {
-   clk_disable(sdd-src_clk);
+   clk_disable_unprepare(sdd-src_clk);
} else {
val = readl(regs + S3C64XX_SPI_CLK_CFG);
val = ~S3C64XX_SPI_ENCLK_ENABLE;
@@ -564,7 +564,7 @@ static void s3c64xx_spi_config(struct 
s3c64xx_spi_driver_data *sdd)
/* There is half-multiplier before the SPI */
clk_set_rate(sdd-src_clk, sdd-cur_speed * 2);
/* Enable Clock */
-   clk_enable(sdd-src_clk);
+   clk_prepare_enable(sdd-src_clk);
} else {
/* Configure Clock */
val = readl(regs + S3C64XX_SPI_CLK_CFG);
@@ -1299,7 +1299,7 @@ static int __init s3c64xx_spi_probe(struct 
platform_device *pdev)
goto err3;
}
 
-   if (clk_enable(sdd-clk)) {
+   if (clk_prepare_enable(sdd-clk)) {
dev_err(pdev-dev, Couldn't enable clock 'spi'\n);
ret = -EBUSY;
goto err4;
@@ -1314,7 +1314,7 @@ static int __init s3c64xx_spi_probe(struct 
platform_device *pdev)
goto err5;
}
 
-   if (clk_enable(sdd-src_clk)) {
+   if (clk_prepare_enable(sdd-src_clk)) {
dev_err(pdev-dev, Couldn't enable clock '%s'\n, clk_name);
ret = -EBUSY;
goto err6;
@@ -1358,11 +1358,11 @@ static int __init s3c64xx_spi_probe(struct 
platform_device *pdev)
 err8:
free_irq(irq, sdd);
 err7:
-   clk_disable(sdd-src_clk);
+   clk_disable_unprepare(sdd-src_clk);
 err6:
clk_put(sdd-src_clk);
 err5:
-   clk_disable(sdd-clk);
+   clk_disable_unprepare(sdd-clk);
 err4:
clk_put(sdd-clk);
 err3:
@@ -1390,10 +1390,10 @@ static int s3c64xx_spi_remove(struct platform_device 
*pdev)
 
free_irq(platform_get_irq(pdev, 0), sdd);
 
-   clk_disable(sdd-src_clk);
+   clk_disable_unprepare(sdd-src_clk);
clk_put(sdd-src_clk);
 
-   clk_disable(sdd-clk);
+   clk_disable_unprepare(sdd-clk);
clk_put(sdd-clk);
 
if (!sdd-cntrlr_info-cfg_gpio  pdev-dev.of_node)
@@ -1414,8 +1414,8 @@ static int s3c64xx_spi_suspend(struct device *dev)
spi_master_suspend(master);
 
/* Disable the clock */
-   clk_disable(sdd-src_clk);
-   clk_disable(sdd-clk);
+   clk_disable_unprepare(sdd-src_clk);
+   clk_disable_unprepare(sdd-clk);
 
if (!sdd-cntrlr_info-cfg_gpio  dev-of_node)
s3c64xx_spi_dt_gpio_free(sdd);
@@ -1437,8 +1437,8 @@ static int s3c64xx_spi_resume(struct device *dev)
sci-cfg_gpio();
 
/* Enable the clock */
-   clk_enable(sdd-src_clk);
-   clk_enable(sdd-clk);
+   clk_prepare_enable(sdd-src_clk);
+   clk_prepare_enable(sdd-clk);
 
s3c64xx_spi_hwinit(sdd, sdd-port_id);
 
@@ -1454,8 +1454,8 @@ static int s3c64xx_spi_runtime_suspend(struct device *dev)
struct spi_master *master = dev_get_drvdata(dev);
struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master);
 
-   clk_disable(sdd-clk);
-   clk_disable(sdd-src_clk);
+   clk_disable_unprepare(sdd-clk);
+   clk_disable_unprepare(sdd-src_clk);
 
return 0;
 }
@@ -1465,8 +1465,8 @@ static int s3c64xx_spi_runtime_resume(struct device *dev)
struct spi_master *master = dev_get_drvdata(dev);
struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master);
 
-   clk_enable(sdd-src_clk);
-   clk_enable(sdd-clk);
+   clk_prepare_enable(sdd-src_clk);
+   clk_prepare_enable(sdd-clk);
 
return 0;
 }
-- 
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


[PATCH] input: samsung-keypad: add clk_prepare and clk_unprepare

2012-10-02 Thread Thomas Abraham
Add calls to clk_prepare and clk_unprepare as required by commom clock
framework.

Signed-off-by: Thomas Abraham thomas.abra...@linaro.org
---
 drivers/input/keyboard/samsung-keypad.c |   11 ++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/drivers/input/keyboard/samsung-keypad.c 
b/drivers/input/keyboard/samsung-keypad.c
index 277e26d..9d7a111 100644
--- a/drivers/input/keyboard/samsung-keypad.c
+++ b/drivers/input/keyboard/samsung-keypad.c
@@ -431,6 +431,12 @@ static int __devinit samsung_keypad_probe(struct 
platform_device *pdev)
goto err_unmap_base;
}
 
+   error = clk_prepare(keypad-clk);
+   if (error) {
+   dev_err(pdev-dev, keypad clock prepare failed\n);
+   goto err_put_clk;
+   }
+
keypad-input_dev = input_dev;
keypad-pdev = pdev;
keypad-row_shift = row_shift;
@@ -461,7 +467,7 @@ static int __devinit samsung_keypad_probe(struct 
platform_device *pdev)
   keypad-keycodes, input_dev);
if (error) {
dev_err(pdev-dev, failed to build keymap\n);
-   goto err_put_clk;
+   goto err_unprepare_clk;
}
 
input_set_capability(input_dev, EV_MSC, MSC_SCAN);
@@ -503,6 +509,8 @@ err_free_irq:
pm_runtime_disable(pdev-dev);
device_init_wakeup(pdev-dev, 0);
platform_set_drvdata(pdev, NULL);
+err_unprepare_clk:
+   clk_unprepare(keypad-clk);
 err_put_clk:
clk_put(keypad-clk);
samsung_keypad_dt_gpio_free(keypad);
@@ -531,6 +539,7 @@ static int __devexit samsung_keypad_remove(struct 
platform_device *pdev)
 */
free_irq(keypad-irq, keypad);
 
+   clk_unprepare(keypad-clk);
clk_put(keypad-clk);
samsung_keypad_dt_gpio_free(keypad);
 
-- 
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


[PATCH] rtc: rtc-s3c: use clk_prepare_enable and clk_disable_unprepare

2012-10-02 Thread Thomas Abraham
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
---
 drivers/rtc/rtc-s3c.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
index 77823d2..ff5b928 100644
--- a/drivers/rtc/rtc-s3c.c
+++ b/drivers/rtc/rtc-s3c.c
@@ -520,7 +520,7 @@ static int __devinit s3c_rtc_probe(struct platform_device 
*pdev)
goto err_clk;
}
 
-   clk_enable(rtc_clk);
+   clk_prepare_enable(rtc_clk);
 
/* check to see if everything is setup correctly */
 
@@ -591,7 +591,7 @@ static int __devinit s3c_rtc_probe(struct platform_device 
*pdev)
goto err_tick_irq;
}
 
-   clk_disable(rtc_clk);
+   clk_disable_unprepare(rtc_clk);
 
return 0;
 
@@ -604,7 +604,7 @@ static int __devinit s3c_rtc_probe(struct platform_device 
*pdev)
 
  err_nortc:
s3c_rtc_enable(pdev, 0);
-   clk_disable(rtc_clk);
+   clk_disable_unprepare(rtc_clk);
clk_put(rtc_clk);
 
  err_clk:
-- 
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


[PATCH] mmc: sdhci-s3c: use clk_prepare_enable and clk_disable_unprepare

2012-10-02 Thread Thomas Abraham
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
---
 drivers/mmc/host/sdhci-s3c.c |   28 ++--
 1 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
index 2903949..a093e2e 100644
--- a/drivers/mmc/host/sdhci-s3c.c
+++ b/drivers/mmc/host/sdhci-s3c.c
@@ -211,8 +211,8 @@ static void sdhci_s3c_set_clock(struct sdhci_host *host, 
unsigned int clock)
if (ourhost-cur_clk != best_src) {
struct clk *clk = ourhost-clk_bus[best_src];
 
-   clk_enable(clk);
-   clk_disable(ourhost-clk_bus[ourhost-cur_clk]);
+   clk_prepare_enable(clk);
+   clk_disable_unprepare(ourhost-clk_bus[ourhost-cur_clk]);
 
/* turn clock off to card before changing clock source */
writew(0, host-ioaddr + SDHCI_CLOCK_CONTROL);
@@ -607,7 +607,7 @@ static int __devinit sdhci_s3c_probe(struct platform_device 
*pdev)
}
 
/* enable the local io clock and keep it running for the moment. */
-   clk_enable(sc-clk_io);
+   clk_prepare_enable(sc-clk_io);
 
for (clks = 0, ptr = 0; ptr  MAX_BUS_CLK; ptr++) {
struct clk *clk;
@@ -638,7 +638,7 @@ static int __devinit sdhci_s3c_probe(struct platform_device 
*pdev)
}
 
 #ifndef CONFIG_PM_RUNTIME
-   clk_enable(sc-clk_bus[sc-cur_clk]);
+   clk_prepare_enable(sc-clk_bus[sc-cur_clk]);
 #endif
 
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -747,13 +747,13 @@ static int __devinit sdhci_s3c_probe(struct 
platform_device *pdev)
sdhci_s3c_setup_card_detect_gpio(sc);
 
 #ifdef CONFIG_PM_RUNTIME
-   clk_disable(sc-clk_io);
+   clk_disable_unprepare(sc-clk_io);
 #endif
return 0;
 
  err_req_regs:
 #ifndef CONFIG_PM_RUNTIME
-   clk_disable(sc-clk_bus[sc-cur_clk]);
+   clk_disable_unprepare(sc-clk_bus[sc-cur_clk]);
 #endif
for (ptr = 0; ptr  MAX_BUS_CLK; ptr++) {
if (sc-clk_bus[ptr]) {
@@ -762,7 +762,7 @@ static int __devinit sdhci_s3c_probe(struct platform_device 
*pdev)
}
 
  err_no_busclks:
-   clk_disable(sc-clk_io);
+   clk_disable_unprepare(sc-clk_io);
clk_put(sc-clk_io);
 
  err_io_clk:
@@ -794,7 +794,7 @@ static int __devexit sdhci_s3c_remove(struct 
platform_device *pdev)
gpio_free(sc-ext_cd_gpio);
 
 #ifdef CONFIG_PM_RUNTIME
-   clk_enable(sc-clk_io);
+   clk_prepare_enable(sc-clk_io);
 #endif
sdhci_remove_host(host, 1);
 
@@ -802,14 +802,14 @@ static int __devexit sdhci_s3c_remove(struct 
platform_device *pdev)
pm_runtime_disable(pdev-dev);
 
 #ifndef CONFIG_PM_RUNTIME
-   clk_disable(sc-clk_bus[sc-cur_clk]);
+   clk_disable_unprepare(sc-clk_bus[sc-cur_clk]);
 #endif
for (ptr = 0; ptr  MAX_BUS_CLK; ptr++) {
if (sc-clk_bus[ptr]) {
clk_put(sc-clk_bus[ptr]);
}
}
-   clk_disable(sc-clk_io);
+   clk_disable_unprepare(sc-clk_io);
clk_put(sc-clk_io);
 
if (pdev-dev.of_node) {
@@ -849,8 +849,8 @@ static int sdhci_s3c_runtime_suspend(struct device *dev)
 
ret = sdhci_runtime_suspend_host(host);
 
-   clk_disable(ourhost-clk_bus[ourhost-cur_clk]);
-   clk_disable(busclk);
+   clk_disable_unprepare(ourhost-clk_bus[ourhost-cur_clk]);
+   clk_disable_unprepare(busclk);
return ret;
 }
 
@@ -861,8 +861,8 @@ static int sdhci_s3c_runtime_resume(struct device *dev)
struct clk *busclk = ourhost-clk_io;
int ret;
 
-   clk_enable(busclk);
-   clk_enable(ourhost-clk_bus[ourhost-cur_clk]);
+   clk_prepare_enable(busclk);
+   clk_prepare_enable(ourhost-clk_bus[ourhost-cur_clk]);
ret = sdhci_runtime_resume_host(host);
return ret;
 }
-- 
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


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

2012-10-02 Thread Thomas Abraham
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
---
 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


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

2012-10-02 Thread Thomas Abraham
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
---
 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


[PATCH] ASoC: SAMSUNG: ac97: use clk_prepare_enable and clk_disable_unprepare

2012-10-02 Thread Thomas Abraham
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
---
 sound/soc/samsung/ac97.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/samsung/ac97.c b/sound/soc/samsung/ac97.c
index 14fbcd3..386bab1 100644
--- a/sound/soc/samsung/ac97.c
+++ b/sound/soc/samsung/ac97.c
@@ -442,7 +442,7 @@ static __devinit int s3c_ac97_probe(struct platform_device 
*pdev)
ret = -ENODEV;
goto err2;
}
-   clk_enable(s3c_ac97.ac97_clk);
+   clk_prepare_enable(s3c_ac97.ac97_clk);
 
if (ac97_pdata-cfg_gpio(pdev)) {
dev_err(pdev-dev, Unable to configure gpio\n);
@@ -468,7 +468,7 @@ err5:
free_irq(irq_res-start, NULL);
 err4:
 err3:
-   clk_disable(s3c_ac97.ac97_clk);
+   clk_disable_unprepare(s3c_ac97.ac97_clk);
clk_put(s3c_ac97.ac97_clk);
 err2:
iounmap(s3c_ac97.regs);
@@ -488,7 +488,7 @@ static __devexit int s3c_ac97_remove(struct platform_device 
*pdev)
if (irq_res)
free_irq(irq_res-start, NULL);
 
-   clk_disable(s3c_ac97.ac97_clk);
+   clk_disable_unprepare(s3c_ac97.ac97_clk);
clk_put(s3c_ac97.ac97_clk);
 
iounmap(s3c_ac97.regs);
-- 
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


[PATCH] ASoC: SAMSUNG: i2s: use clk_prepare_enable and clk_disable_unprepare

2012-10-02 Thread Thomas Abraham
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
---
 sound/soc/samsung/i2s.c |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
index 40b00a1..547b919 100644
--- a/sound/soc/samsung/i2s.c
+++ b/sound/soc/samsung/i2s.c
@@ -423,7 +423,7 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai,
if (i2s-op_clk) {
if ((clk_id  !(mod  MOD_IMS_SYSMUX)) ||
(!clk_id  (mod  MOD_IMS_SYSMUX))) {
-   clk_disable(i2s-op_clk);
+   clk_disable_unprepare(i2s-op_clk);
clk_put(i2s-op_clk);
} else {
i2s-rclk_srcrate =
@@ -434,7 +434,7 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai,
 
i2s-op_clk = clk_get(i2s-pdev-dev,
i2s-src_clk[clk_id]);
-   clk_enable(i2s-op_clk);
+   clk_prepare_enable(i2s-op_clk);
i2s-rclk_srcrate = clk_get_rate(i2s-op_clk);
 
/* Over-ride the other's */
@@ -880,7 +880,7 @@ static int samsung_i2s_dai_probe(struct snd_soc_dai *dai)
iounmap(i2s-addr);
return -ENOENT;
}
-   clk_enable(i2s-clk);
+   clk_prepare_enable(i2s-clk);
 
if (other) {
other-addr = i2s-addr;
@@ -922,7 +922,7 @@ static int samsung_i2s_dai_remove(struct snd_soc_dai *dai)
if (i2s-quirks  QUIRK_NEED_RSTCLR)
writel(0, i2s-addr + I2SCON);
 
-   clk_disable(i2s-clk);
+   clk_disable_unprepare(i2s-clk);
clk_put(i2s-clk);
 
iounmap(i2s-addr);
-- 
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


[PATCH] ASoC: SAMSUNG: pcm: use clk_prepare_enable and clk_disable_unprepare

2012-10-02 Thread Thomas Abraham
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
---
 sound/soc/samsung/pcm.c |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/sound/soc/samsung/pcm.c b/sound/soc/samsung/pcm.c
index c860819..45f4a75 100644
--- a/sound/soc/samsung/pcm.c
+++ b/sound/soc/samsung/pcm.c
@@ -543,7 +543,7 @@ static __devinit int s3c_pcm_dev_probe(struct 
platform_device *pdev)
ret = PTR_ERR(pcm-cclk);
goto err1;
}
-   clk_enable(pcm-cclk);
+   clk_prepare_enable(pcm-cclk);
 
/* record our pcm structure for later use in the callbacks */
dev_set_drvdata(pdev-dev, pcm);
@@ -568,7 +568,7 @@ static __devinit int s3c_pcm_dev_probe(struct 
platform_device *pdev)
ret = -ENOENT;
goto err4;
}
-   clk_enable(pcm-pclk);
+   clk_prepare_enable(pcm-pclk);
 
s3c_pcm_stereo_in[pdev-id].dma_addr = mem_res-start
+ S3C_PCM_RXFIFO;
@@ -592,14 +592,14 @@ static __devinit int s3c_pcm_dev_probe(struct 
platform_device *pdev)
return 0;
 
 err5:
-   clk_disable(pcm-pclk);
+   clk_disable_unprepare(pcm-pclk);
clk_put(pcm-pclk);
 err4:
iounmap(pcm-regs);
 err3:
release_mem_region(mem_res-start, resource_size(mem_res));
 err2:
-   clk_disable(pcm-cclk);
+   clk_disable_unprepare(pcm-cclk);
clk_put(pcm-cclk);
 err1:
return ret;
@@ -619,8 +619,8 @@ static __devexit int s3c_pcm_dev_remove(struct 
platform_device *pdev)
mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
release_mem_region(mem_res-start, resource_size(mem_res));
 
-   clk_disable(pcm-cclk);
-   clk_disable(pcm-pclk);
+   clk_disable_unprepare(pcm-cclk);
+   clk_disable_unprepare(pcm-pclk);
clk_put(pcm-pclk);
clk_put(pcm-cclk);
 
-- 
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


[PATCH] ASoC: SAMSUNG: spdif: use clk_prepare_enable and clk_disable_unprepare

2012-10-02 Thread Thomas Abraham
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
---
 sound/soc/samsung/spdif.c |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/sound/soc/samsung/spdif.c b/sound/soc/samsung/spdif.c
index bc24c7a..5f3b06d 100644
--- a/sound/soc/samsung/spdif.c
+++ b/sound/soc/samsung/spdif.c
@@ -397,7 +397,7 @@ static __devinit int spdif_probe(struct platform_device 
*pdev)
ret = -ENOENT;
goto err0;
}
-   clk_enable(spdif-pclk);
+   clk_prepare_enable(spdif-pclk);
 
spdif-sclk = clk_get(pdev-dev, sclk_spdif);
if (IS_ERR(spdif-sclk)) {
@@ -405,7 +405,7 @@ static __devinit int spdif_probe(struct platform_device 
*pdev)
ret = -ENOENT;
goto err1;
}
-   clk_enable(spdif-sclk);
+   clk_prepare_enable(spdif-sclk);
 
/* Request S/PDIF Register's memory region */
if (!request_mem_region(mem_res-start,
@@ -444,10 +444,10 @@ err4:
 err3:
release_mem_region(mem_res-start, resource_size(mem_res));
 err2:
-   clk_disable(spdif-sclk);
+   clk_disable_unprepare(spdif-sclk);
clk_put(spdif-sclk);
 err1:
-   clk_disable(spdif-pclk);
+   clk_disable_unprepare(spdif-pclk);
clk_put(spdif-pclk);
 err0:
return ret;
@@ -466,9 +466,9 @@ static __devexit int spdif_remove(struct platform_device 
*pdev)
if (mem_res)
release_mem_region(mem_res-start, resource_size(mem_res));
 
-   clk_disable(spdif-sclk);
+   clk_disable_unprepare(spdif-sclk);
clk_put(spdif-sclk);
-   clk_disable(spdif-pclk);
+   clk_disable_unprepare(spdif-pclk);
clk_put(spdif-pclk);
 
return 0;
-- 
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


[PATCH] [media] s5p-jpeg: use clk_prepare_enable and clk_disable_unprepare

2012-10-02 Thread Thomas Abraham
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
---
 drivers/media/platform/s5p-jpeg/jpeg-core.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c 
b/drivers/media/platform/s5p-jpeg/jpeg-core.c
index 90459cef..9df35b2 100644
--- a/drivers/media/platform/s5p-jpeg/jpeg-core.c
+++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c
@@ -1353,7 +1353,7 @@ static int s5p_jpeg_probe(struct platform_device *pdev)
return ret;
}
dev_dbg(pdev-dev, clock source %p\n, jpeg-clk);
-   clk_enable(jpeg-clk);
+   clk_prepare_enable(jpeg-clk);
 
/* v4l2 device */
ret = v4l2_device_register(pdev-dev, jpeg-v4l2_dev);
@@ -1459,7 +1459,7 @@ device_register_rollback:
v4l2_device_unregister(jpeg-v4l2_dev);
 
 clk_get_rollback:
-   clk_disable(jpeg-clk);
+   clk_disable_unprepare(jpeg-clk);
clk_put(jpeg-clk);
 
return ret;
@@ -1479,7 +1479,7 @@ static int s5p_jpeg_remove(struct platform_device *pdev)
v4l2_m2m_release(jpeg-m2m_dev);
v4l2_device_unregister(jpeg-v4l2_dev);
 
-   clk_disable(jpeg-clk);
+   clk_disable_unprepare(jpeg-clk);
clk_put(jpeg-clk);
 
return 0;
-- 
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


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

2012-10-02 Thread Thomas Abraham
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
---
 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 V6 2/2] video: drm: exynos: Add device tree support

2012-10-02 Thread Leela Krishna Amudala
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..?

 + - samsung,fimd-display: This property should specify the phandle of the
 +   display device node which holds the video interface timing with the
 +   below mentioned properties.
 +
 +   - lcd-htiming: Specifies the horizontal timing for the overlay. The
 + horizontal timing includes four parameters in the following order.
 +
 + - horizontal back porch (in number of lcd clocks)
 + - horizontal front porch (in number of lcd clocks)
 + - hsync pulse width (in number of lcd clocks)
 + - Display panels X resolution.

 A single lcd-htiming property, which contains 4 values. (and a similar
 construct for the vertical timing).

 That seems entirely different to me...
 ___
 devicetree-discuss mailing list
 devicetree-disc...@lists.ozlabs.org
 https://lists.ozlabs.org/listinfo/devicetree-discuss
--
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