Re: [PATCH v1 1/6] dts: exynos: add device tree support for exynos5 hdmi

2012-10-12 Thread Rahul Sharma
Hi Tomasz,

On Sat, Oct 13, 2012 at 3:34 AM, Tomasz Figa  wrote:
> Hi Rahul,
>
> On Friday 12 of October 2012 00:27:42 Rahul Sharma wrote:
>> This patch adds support for device tree based discovery for exynos5
>> hdmi. Hdmi node is also renamed with "exynos5-hdmi".
>>
>> Signed-off-by: Rahul Sharma 
>> ---
>>  arch/arm/boot/dts/exynos5250-smdk5250.dts |4 
>>  arch/arm/boot/dts/exynos5250.dtsi |7 +++
>>  arch/arm/mach-exynos/include/mach/map.h   |1 +
>>  arch/arm/mach-exynos/mach-exynos5-dt.c|2 ++
>>  4 files changed, 14 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/arm/boot/dts/exynos5250-smdk5250.dts
>> b/arch/arm/boot/dts/exynos5250-smdk5250.dts index a352df4..2a478ab
>> 100644
>> --- a/arch/arm/boot/dts/exynos5250-smdk5250.dts
>> +++ b/arch/arm/boot/dts/exynos5250-smdk5250.dts
>> @@ -166,4 +166,8 @@
>>   spi_2: spi@12d4 {
>>   status = "disabled";
>>   };
>> +
>> + hdmi {
>> + hpd-gpio = <&gpx3 7 0xf 1 3>;
>> + };
>>  };
>> diff --git a/arch/arm/boot/dts/exynos5250.dtsi
>> b/arch/arm/boot/dts/exynos5250.dtsi index f69e389..4e019b5 100644
>> --- a/arch/arm/boot/dts/exynos5250.dtsi
>> +++ b/arch/arm/boot/dts/exynos5250.dtsi
>> @@ -492,4 +492,11 @@
>>   #gpio-cells = <4>;
>>   };
>>   };
>> +
>> + hdmi {
>
> hdmi@1453
>
>> + compatible = "samsung,exynos5-hdmi";
>> + reg = <0x1453 0x10>;
>> + interrupts = <0 95 0>;
>> + version = "1.4";
>> +};
>
> Is it just me or there is something wrong with indentation of this
> bracket?
>
> Best regards,
> Tomasz Figa
>
My understanding was when there are multiple hardware instances of
same IP, addresses
are put along with the name like i2c, uart. But when only single hw IP
is present like
hdmi, mixer, watchdog, rtc etc address concatenation is optional.
Please correct me if
I am wrong. I will do the respective change.

in V2 patchset "version", "vp-support" properties are dropped and made
part of driver data
inside driver. I also added DT binding documentation for new nodes.

I had posted V2 yesterday but not visible on samsung-soc mailing list.
I will forward you the
patches.

regards,
Rahul Sharma
--
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 v1 6/6] arm: exynos: removing exynos-drm device registration from non-dt platforms

2012-10-12 Thread Rahul Sharma
Hi Tomasz,

On Sat, Oct 13, 2012 at 3:42 AM, Tomasz Figa  wrote:
> Hi Rahul,
>
> On Friday 12 of October 2012 00:27:47 Rahul Sharma wrote:
>> As exynos-drm is a software device, its registration is moved to the
>> exynos drm driver. This will provide generic solution for device
>> registration for dt and non-dt platforms. Corresponding patches are
>> posted to dri-devel list.
>
> In which patch is exynos drm registration being moved to exynos drm
> driver?
>
> Best regards,
> Tomasz Figa
>

Patch set is listed at
http://comments.gmane.org/gmane.comp.video.dri.devel/75121.

regards,
Rahul Sharma
--
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 6/6] ARM: EXYNOS5: SATA PHY controller driver

2012-10-12 Thread Tomasz Figa
Hi,

On Tuesday 09 of October 2012 17:18:52 Vasanth Ananthan wrote:
> This patch adds a platform driver and I2C client driver for SATA PHY
> controller
> 
> Signed-off-by: Vasanth Ananthan 
> ---
>  drivers/ata/Makefile  |2 +-
>  drivers/ata/sata_exynos_phy.c |  303
> + 2 files changed, 304
> insertions(+), 1 deletions(-)
>  create mode 100644 drivers/ata/sata_exynos_phy.c
> 
> diff --git a/drivers/ata/Makefile b/drivers/ata/Makefile
> index 33fb2f6..769d945 100644
> --- a/drivers/ata/Makefile
> +++ b/drivers/ata/Makefile
> @@ -9,7 +9,7 @@ obj-$(CONFIG_SATA_FSL)+= sata_fsl.o
>  obj-$(CONFIG_SATA_INIC162X)  += sata_inic162x.o
>  obj-$(CONFIG_SATA_SIL24) += sata_sil24.o
>  obj-$(CONFIG_SATA_DWC)   += sata_dwc_460ex.o
> -obj-$(CONFIG_SATA_EXYNOS)  += sata_phy.o sata_exynos.o
> libahci.o +obj-$(CONFIG_SATA_EXYNOS)  += sata_phy.o
> sata_exynos_phy.o sata_exynos.o libahci.o
> 
>  # SFF w/ custom DMA
>  obj-$(CONFIG_PDC_ADMA)   += pdc_adma.o
> diff --git a/drivers/ata/sata_exynos_phy.c
> b/drivers/ata/sata_exynos_phy.c new file mode 100644
> index 000..44861de
> --- /dev/null
> +++ b/drivers/ata/sata_exynos_phy.c
> @@ -0,0 +1,303 @@
> +/*
> + * Copyright (c) 2010-2012 Samsung Electronics Co., Ltd.
> + *  http://www.samsung.com
> + *
> + * EXYNOS - SATA PHY controller driver
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as +
> * published by the Free Software Foundation.
> +*/
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include "sata_phy.h"
> +
> +#define  SATA_TIME_LIMIT 1000
> +
> +static struct i2c_client *i2c_client;
> +
> +static struct i2c_driver sataphy_i2c_driver;
> +
> +struct exynos_sata_phy {
> + void __iomem *mmio;
> + struct resource *mem;
> + struct clk *clk;
> +};
> +
> +static bool sata_is_reg(void __iomem *base, u32 reg, u32 checkbit, u32
> Status) +{

Please use lowercase for variable names.

> + if ((readl(base + reg) & checkbit) == Status)
> + return true;
> + else
> + return false;
> +}
> +
> +static bool wait_for_reg_status(void __iomem *base, u32 reg, u32
> checkbit, +   u32 Status)

Same here.

> +{
> + u16 time_limit_cnt = 0;
> + while (!sata_is_reg(base, reg, checkbit, Status)) {
> + if (time_limit_cnt == SATA_TIME_LIMIT)
> + return false;
> + udelay(1000);
> + time_limit_cnt++;
> + }
> + return true;
> +}
> +
> +int sataphy_init(struct sata_phy *phy)

static int sataphy_init(struct sata_phy *phy) ?

> +{
> + int ret;
> + u32 val;
> +
> + /* Values to be written to enable 40 bits interface */
> + u8 buf[] = { 0x3A, 0x0B };
> +
> + struct exynos_sata_phy *sata_phy;
> +
> + sata_phy = (struct exynos_sata_phy *)phy->priv_data;
> +
> + clk_enable(sata_phy->clk);
> +
> + writel(S5P_PMU_SATA_PHY_CONTROL_EN, EXYNOS5_SATA_PHY_CONTROL);
> +
> + val = 0;
> + writel(val, sata_phy->mmio + EXYNOS5_SATA_RESET);
> +
> + val = readl(sata_phy->mmio + EXYNOS5_SATA_RESET);
> + val |= 0xFF;
> + writel(val, sata_phy->mmio + EXYNOS5_SATA_RESET);
> +
> + val = readl(sata_phy->mmio + EXYNOS5_SATA_RESET);
> + val |= LINK_RESET;
> + writel(val, sata_phy->mmio + EXYNOS5_SATA_RESET);
> +
> + val = readl(sata_phy->mmio + EXYNOS5_SATA_RESET);
> + val |= RESET_CMN_RST_N;
> + writel(val, sata_phy->mmio + EXYNOS5_SATA_RESET);
> +
> + val = readl(sata_phy->mmio + EXYNOS5_SATA_PHSATA_CTRLM);
> + val &= ~PHCTRLM_REF_RATE;
> + writel(val, sata_phy->mmio + EXYNOS5_SATA_PHSATA_CTRLM);
> +
> + /* High speed enable for Gen3 */
> + val = readl(sata_phy->mmio + EXYNOS5_SATA_PHSATA_CTRLM);
> + val |= PHCTRLM_HIGH_SPEED;
> + writel(val, sata_phy->mmio + EXYNOS5_SATA_PHSATA_CTRLM);
> +
> + val = readl(sata_phy->mmio + EXYNOS5_SATA_CTRL0);
> + val |= CTRL0_P0_PHY_CALIBRATED_SEL | CTRL0_P0_PHY_CALIBRATED;
> + writel(val, sata_phy->mmio + EXYNOS5_SATA_CTRL0);
> +
> + writel(SATA_PHY_GENERATION3, sata_phy->mmio + EXYNOS5_SATA_MODE0);
> +
> + ret = i2c_master_send(i2c_client, buf, sizeof(buf));
> + if (ret < 0)
> + return -EINVAL;
> +
> + /* release cmu reset */
> + val = readl(sata_phy->mmio + EXYNOS5_SATA_RESET);
> + val &= ~RESET_CMN_RST_N;
> + writel(val, sata_phy->mmio + EXYNOS5_SATA_RESET);
> +
> + val = readl(sata_phy->mmio + EXYNOS5_SATA_RESET);
> + val |= RESET_CMN_RST_N;
> + writel(val, sata_phy->mmio + EXYNOS5_SATA_RESET);
> +
> + if (wait_for_reg_status(sata_phy->mmio, EXYNOS5_SATA_PHSATA_STATM,
> +  

Re: [PATCH 5/6] ARM: EYNOS5: SATA controller driver

2012-10-12 Thread Tomasz Figa
Hi,

On Tuesday 09 of October 2012 17:18:51 Vasanth Ananthan wrote:
> This patch adds a platform driver for SATA controller.
> 
> Signed-off-by: Vasanth Ananthan 
> ---
>  arch/arm/mach-exynos/include/mach/regs-pmu.h |3 +
>  drivers/ata/Makefile |2 +-
>  drivers/ata/sata_exynos.c|  274
> ++ 3 files changed, 278 insertions(+), 1
> deletions(-)
>  create mode 100644 drivers/ata/sata_exynos.c
> 
> diff --git a/arch/arm/mach-exynos/include/mach/regs-pmu.h
> b/arch/arm/mach-exynos/include/mach/regs-pmu.h index d4e392b..3716ce8
> 100644
> --- a/arch/arm/mach-exynos/include/mach/regs-pmu.h
> +++ b/arch/arm/mach-exynos/include/mach/regs-pmu.h
> @@ -367,4 +367,7 @@
> 
>  #define EXYNOS5_OPTION_USE_RETENTION (1 << 4)
> 
> +/* Only for EXYNOS5250 */
> +#define EXYNOS5_SATA_PHY_CONTROL S5P_PMUREG(0x0724)
> +
>  #endif /* __ASM_ARCH_REGS_PMU_H */
> diff --git a/drivers/ata/Makefile b/drivers/ata/Makefile
> index bf3fd91..33fb2f6 100644
> --- a/drivers/ata/Makefile
> +++ b/drivers/ata/Makefile
> @@ -9,7 +9,7 @@ obj-$(CONFIG_SATA_FSL)+= sata_fsl.o
>  obj-$(CONFIG_SATA_INIC162X)  += sata_inic162x.o
>  obj-$(CONFIG_SATA_SIL24) += sata_sil24.o
>  obj-$(CONFIG_SATA_DWC)   += sata_dwc_460ex.o
> -obj-$(CONFIG_SATA_EXYNOS)  += sata_phy.o libahci.o
> +obj-$(CONFIG_SATA_EXYNOS)  += sata_phy.o sata_exynos.o
> libahci.o
> 
>  # SFF w/ custom DMA
>  obj-$(CONFIG_PDC_ADMA)   += pdc_adma.o
> diff --git a/drivers/ata/sata_exynos.c b/drivers/ata/sata_exynos.c
> new file mode 100644
> index 000..877039e
> --- /dev/null
> +++ b/drivers/ata/sata_exynos.c
> @@ -0,0 +1,274 @@
> +/*
> + * Copyright (c) 2010-2012 Samsung Electronics Co., Ltd.
> + *  http://www.samsung.com
> + *
> + * EXYNOS - SATA controller driver
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as +
> * published by the Free Software Foundation.
> +*/
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include "ahci.h"
> +#include "sata_phy.h"
> +
> +#define SATA_FREQ(66*1000*1000)
> +
> +static const struct ata_port_info ahci_port_info[] = {
> + [0] = {
> +.flags = AHCI_FLAG_COMMON,
> +.pio_mask = ATA_PIO4,
> +.udma_mask = ATA_UDMA6,
> +.port_ops = &ahci_ops,
> +},

nitpick: Indentation of closing bracket is incorrect.

> +};
> +
> +static struct scsi_host_template ahci_platform_sht = {
> + AHCI_SHT("ahci_platform"),
> +};
> +
> +struct exynos_sata {
> + struct clk *sclk;
> + struct clk *clk;
> + struct sata_phy *phy;
> + int irq;
> +};
> +
> +static int __init exynos_sata_probe(struct platform_device *pdev)
> +{
> + struct device *dev = &pdev->dev;
> + struct ata_port_info pi = ahci_port_info[0];
> + const struct ata_port_info *ppi[] = { &pi, NULL };
> + struct ahci_host_priv *hpriv;
> + struct exynos_sata *sata;
> + struct ata_host *host;
> + struct resource *mem;
> + int n_ports, i, ret;
> +
> + sata = kzalloc(sizeof(*sata), GFP_KERNEL);

Why this one isn't also allocated using devm_kzalloc?

> + if (!sata) {
> + dev_err(dev, "can't alloc sata\n");
> + ret = -ENOMEM;
> + return ret;

return -ENOMEM;

> + }
> +
> + hpriv = devm_kzalloc(dev, sizeof(*hpriv), GFP_KERNEL);
> + if (!hpriv) {
> + dev_err(dev, "can't alloc ahci_host_priv\n");
> + ret = -ENOMEM;
> + goto err1;
> + }
> +
> + hpriv->flags |= (unsigned long)pi.private_data;
> +
> + mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> + if (!mem) {
> + dev_err(dev, "no mmio space\n");
> + ret = -EINVAL;
> + goto err2;
> + }
> +
> + sata->irq = platform_get_irq(pdev, 0);
> + if (sata->irq <= 0) {
> + dev_err(dev, "no irq\n");
> + ret = -EINVAL;
> + goto err2;
> + }
> +
> + hpriv->mmio = devm_ioremap(dev, mem->start, resource_size(mem));
> + if (!hpriv->mmio) {
> + dev_err(dev, "can't map %pR\n", mem);
> + ret = -ENOMEM;
> + goto err2;
> + }
> +
> + sata->sclk = clk_get(dev, "sclk_sata");

devm_clk_get?

> + if (IS_ERR(sata->sclk)) {
> + dev_err(dev, "failed to get sclk_sata\n");
> + ret = PTR_ERR(sata->sclk);
> + goto err3;
> + }
> + clk_enable(sata->sclk);
> +
> + clk_set_rate(sata->sclk, SATA_FREQ);
> +
> + sata->clk = clk_get(dev, "sata");

devm_clk_get?

> + if (IS_ERR(sata->clk)) {
> + dev_err(dev, "failed to get sata clock\n");
> + ret = PTR_ERR(sata->clk);
> + goto err

Re: [PATCH 4/6] ARM: S3C2410: I2C driver polling mode support

2012-10-12 Thread Tomasz Figa
Hi,

On Tuesday 09 of October 2012 17:18:50 Vasanth Ananthan wrote:
> This patch adds polling mode support for i2c s3c-2410 driver.
> The I2C_SATAPHY controller lacks an interrupt line but the s3c-2410
> driver is interrupt driven. Hence this support is required for
> functioning of the I2C_SATAPHY controller.
> 
> Signed-off-by: Vasanth Ananthan 
> ---
>  drivers/i2c/busses/i2c-s3c2410.c |   84
> +- 1 files changed, 65
> insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-s3c2410.c
> b/drivers/i2c/busses/i2c-s3c2410.c index 5ae3b02..699b530 100644
> --- a/drivers/i2c/busses/i2c-s3c2410.c
> +++ b/drivers/i2c/busses/i2c-s3c2410.c
> @@ -48,6 +48,7 @@
>  #define QUIRK_S3C2440(1 << 0)
>  #define QUIRK_HDMIPHY(1 << 1)
>  #define QUIRK_NO_GPIO(1 << 2)
> +#define QUIRK_SATAPHY(1 << 3)
> 
>  /* i2c controller state */
>  enum s3c24xx_i2c_state {
> @@ -102,10 +103,14 @@ static struct platform_device_id
> s3c24xx_driver_ids[] = { };
>  MODULE_DEVICE_TABLE(platform, s3c24xx_driver_ids);
> 
> +static int i2c_s3c_irq_nextbyte(struct s3c24xx_i2c *i2c, unsigned long
> iicstat); +
>  #ifdef CONFIG_OF
>  static const struct of_device_id s3c24xx_i2c_match[] = {
>   { .compatible = "samsung,s3c2410-i2c", .data = (void *)0 },
>   { .compatible = "samsung,s3c2440-i2c", .data = (void *)QUIRK_S3C2440
> }, +  { .compatible = "samsung,s3c2440-sataphy-i2c",
> +   .data = (void *)(QUIRK_S3C2440|QUIRK_SATAPHY|QUIRK_NO_GPIO) },

nitpick: Please insert spaces around bitwise OR operators.

>   { .compatible = "samsung,s3c2440-hdmiphy-i2c",
> .data = (void *)(QUIRK_S3C2440 | QUIRK_HDMIPHY | QUIRK_NO_GPIO) },
>   {},
> @@ -146,7 +151,8 @@ static inline void
> s3c24xx_i2c_master_complete(struct s3c24xx_i2c *i2c, int ret) if (ret)
>   i2c->msg_idx = ret;
> 
> - wake_up(&i2c->wait);
> + if (!(i2c->quirks & QUIRK_SATAPHY))
> + wake_up(&i2c->wait);
>  }
> 
>  static inline void s3c24xx_i2c_disable_ack(struct s3c24xx_i2c *i2c)
> @@ -184,6 +190,21 @@ static inline void s3c24xx_i2c_enable_irq(struct
> s3c24xx_i2c *i2c) }
> 
> 
> +static bool is_ack(struct s3c24xx_i2c *i2c)
> +{
> + u32 time_out = i2c->tx_setup;

nitpick: Separate local variable declaration from code with a blank line.

> + while (--time_out) {
> + if (readl(i2c->regs + S3C2410_IICCON)
> + & S3C2410_IICCON_IRQPEND) {
> + if (!(readl(i2c->regs + S3C2410_IICSTAT)
> + & S3C2410_IICSTAT_LASTBIT))
> + return true;
> + }
> + udelay(time_out);
> + }

nitpick: Here a blank line would be fine.

> + return false;
> +}
> +
>  /* s3c24xx_i2c_message_start
>   *
>   * put the start of a message onto the bus
> @@ -227,6 +248,21 @@ static void s3c24xx_i2c_message_start(struct
> s3c24xx_i2c *i2c,
> 
>   stat |= S3C2410_IICSTAT_START;
>   writel(stat, i2c->regs + S3C2410_IICSTAT);
> +
> + if (i2c->quirks & QUIRK_SATAPHY) {
> +

nitpick: Unnecessary blank line.

> + while ((i2c->msg_num != 0) && is_ack(i2c)) {
> +

Same here.

> + i2c_s3c_irq_nextbyte(i2c, stat);
> +
> + stat = readl(i2c->regs + S3C2410_IICSTAT);
> + if (stat & S3C2410_IICSTAT_ARBITR)
> + dev_err(i2c->dev, "deal with arbitration 
> loss\n");
> +

Same here.

> + }
> +
Same here.

> + }
> +

Same here.

>  }
>

Best regards,
Tomasz Figa

--
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 3/6] DRIVERS: ATA: SATA PHY utility framework

2012-10-12 Thread Tomasz Figa
Hi Vasanth, 

On Tuesday 09 of October 2012 17:18:49 Vasanth Ananthan wrote:
> This patch adds SATA PHY utility framework APIs. The framework acts as
> an interface between the SATA device and the PHY device. The SATA PHY
> device registers itself with the framework through the APIs provided
> and the SATA device finds and requests for an appropriate PHY device.
> 
> Signed-off-by: Vasanth Ananthan 
> ---
>  drivers/ata/Kconfig|9 
>  drivers/ata/Makefile   |1 +
>  drivers/ata/sata_phy.c |   99
>  drivers/ata/sata_phy.h
> |   44 +
>  4 files changed, 153 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/ata/sata_phy.c
>  create mode 100644 drivers/ata/sata_phy.h
> 
> diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
> index 27cecd3..0344b78 100644
> --- a/drivers/ata/Kconfig
> +++ b/drivers/ata/Kconfig
> @@ -83,6 +83,15 @@ config SATA_AHCI_PLATFORM
> 
> If unsure, say N.
> 
> +config SATA_EXYNOS
> + bool "Exynos SATA AHCI support"
> + depends on I2C_S3C2410
> + help
> +  This option enables support for Exynos AHCI Serial ATA
> +  controllers.
> +
> +  If unsure, say N.
> +
>  config SATA_FSL
>   tristate "Freescale 3.0Gbps SATA support"
>   depends on FSL_SOC
> diff --git a/drivers/ata/Makefile b/drivers/ata/Makefile
> index a454a13..bf3fd91 100644
> --- a/drivers/ata/Makefile
> +++ b/drivers/ata/Makefile
> @@ -9,6 +9,7 @@ obj-$(CONFIG_SATA_FSL)+= sata_fsl.o
>  obj-$(CONFIG_SATA_INIC162X)  += sata_inic162x.o
>  obj-$(CONFIG_SATA_SIL24) += sata_sil24.o
>  obj-$(CONFIG_SATA_DWC)   += sata_dwc_460ex.o
> +obj-$(CONFIG_SATA_EXYNOS)  += sata_phy.o libahci.o


If the framework introduced by this patch is supposed to be generic, maybe 
a new Kconfig entry should be created for it, like CONFIG_SATA_PHY, which 
would be selected by any drivers using it?

> 
>  # SFF w/ custom DMA
>  obj-$(CONFIG_PDC_ADMA)   += pdc_adma.o
> diff --git a/drivers/ata/sata_phy.c b/drivers/ata/sata_phy.c
> new file mode 100644
> index 000..dbb4aa3
> --- /dev/null
> +++ b/drivers/ata/sata_phy.c
> @@ -0,0 +1,99 @@
> +/*
> + * Copyright (c) 2010-2012 Samsung Electronics Co., Ltd.
> + *  http://www.samsung.com
> + *
> + * EXYNOS - SATA utility framework.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as +
> * published by the Free Software Foundation.
> +*/
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include "sata_phy.h"
> +
> +static LIST_HEAD(phy_list);
> +static DEFINE_SPINLOCK(phy_lock);
> +
> +struct sata_phy *sata_get_phy(enum sata_phy_type type)
> +{
> + struct sata_phy *x = NULL;
> + unsigned long flag;
> +
> + spin_lock_irqsave(&phy_lock, flag);
> +
> + list_for_each_entry(x, &phy_list, head) {
> + if (x->type == type) {
> + get_device(x->dev);
> + break;
> + }
> + }
> +
> + spin_unlock_irqrestore(&phy_lock, flag);
> + return x;
> +}
> +EXPORT_SYMBOL(sata_get_phy);
> +
> +int sata_add_phy(struct sata_phy *phy, enum sata_phy_type type)
> +{
> + unsigned long flag;
> + unsigned int ret = -EINVAL;
> + struct sata_phy *x;

If you need to handle the situation when phy is NULL here, then why not 
to:

if (!phy)
return -EINVAL;

and then make the code below unconditional?

> +
> + spin_lock_irqsave(&phy_lock, flag);
> +
> + if (phy) {
> +
> + list_for_each_entry(x, &phy_list, head) {
> + if (x->type == type) {
> + dev_err(phy->dev, "transceiver type already 
exists\n");
> + goto out;
> + }
> + }
> + phy->type = type;
> + list_add_tail(&phy->head, &phy_list);
> + ret = 0;
> + }
> +
> + out:
> + spin_unlock_irqrestore(&phy_lock, flag);
> + return ret;
> +}
> +EXPORT_SYMBOL(sata_add_phy);
> +
> +void sata_remove_phy(struct sata_phy *phy)
> +{
> + unsigned long flag;
> + struct sata_phy *x;

Same here.

Best regards,
Tomasz Figa

--
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 V5 1/2] video: exynos_dp: Add device tree support to DP driver

2012-10-12 Thread Tomasz Figa
On Saturday 13 of October 2012 00:14:39 Sylwester Nawrocki wrote:
> On 10/12/2012 11:54 PM, Tomasz Figa wrote:
> >>> + if (of_get_property(dp_node, "interlaced", NULL))
> >>> + dp_video_config->interlaced = 1;
> >> 
> >> of_property_read_bool() could also be used here.
> > 
> > Wouldn't it make the property mandatory?
> 
> No, it wouldn't. of_property_read_bool() uses of_find_property()
> internally. It just returns true if property is found or false
> otherwise.

Right, sorry. I thought that all of_property_read_* return error in case 
of missing property.

> Anyway, it appears of_get_property(..., NULL) pattern
> is commonly used for boolean properties.

I guess all three of them should be fine in this case, but since there is 
a dedicated function for bool, it might be the best solution here indeed.

Best regards,
Tomasz Figa

--
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 V5 1/2] video: exynos_dp: Add device tree support to DP driver

2012-10-12 Thread Sylwester Nawrocki
On 10/12/2012 11:54 PM, Tomasz Figa wrote:
>>> +   if (of_get_property(dp_node, "interlaced", NULL))
>>> +   dp_video_config->interlaced = 1;
>>
>> of_property_read_bool() could also be used here.
> 
> Wouldn't it make the property mandatory?

No, it wouldn't. of_property_read_bool() uses of_find_property() 
internally. It just returns true if property is found or false 
otherwise. Anyway, it appears of_get_property(..., NULL) pattern
is commonly used for boolean properties.

> I would just use of_find_property here, instead of of_get_property.
> 
> Best regards,
> Tomasz Figa

--
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 v1 6/6] arm: exynos: removing exynos-drm device registration from non-dt platforms

2012-10-12 Thread Tomasz Figa
Hi Rahul,

On Friday 12 of October 2012 00:27:47 Rahul Sharma wrote:
> As exynos-drm is a software device, its registration is moved to the
> exynos drm driver. This will provide generic solution for device
> registration for dt and non-dt platforms. Corresponding patches are
> posted to dri-devel list.

In which patch is exynos drm registration being moved to exynos drm 
driver?

Best regards,
Tomasz Figa

--
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 v1 2/6] dts: exynos: add device tree support for exynos5 mixer

2012-10-12 Thread Tomasz Figa
On Friday 12 of October 2012 00:27:43 Rahul Sharma wrote:
> This patch adds support for device tree based discovery for exynos5
> mixer. Mixer node is also renamed with "exynos5-mixer".
> 
> Signed-off-by: Rahul Sharma 
> ---
>  arch/arm/boot/dts/exynos5250.dtsi   |8 
>  arch/arm/mach-exynos/include/mach/map.h |1 +
>  arch/arm/mach-exynos/mach-exynos5-dt.c  |2 ++
>  3 files changed, 11 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/exynos5250.dtsi
> b/arch/arm/boot/dts/exynos5250.dtsi index 4e019b5..e4483bc 100644
> --- a/arch/arm/boot/dts/exynos5250.dtsi
> +++ b/arch/arm/boot/dts/exynos5250.dtsi
> @@ -499,4 +499,12 @@
>   interrupts = <0 95 0>;
>   version = "1.4";
>  };
> +
> +mixer {
> + compatible = "samsung,exynos5-mixer";
> + reg = <0x1445 0x1>;
> + interrupts = <0 94 0>;
> + version = "16.0.33.0";
> + vp-support = <0>;
> +};

mixer@1445

Also, what is this version property? How is it used in the driver?

Best regards,
Tomasz Figa

--
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 v1 1/6] dts: exynos: add device tree support for exynos5 hdmi

2012-10-12 Thread Tomasz Figa
Hi Rahul,

On Friday 12 of October 2012 00:27:42 Rahul Sharma wrote:
> This patch adds support for device tree based discovery for exynos5
> hdmi. Hdmi node is also renamed with "exynos5-hdmi".
> 
> Signed-off-by: Rahul Sharma 
> ---
>  arch/arm/boot/dts/exynos5250-smdk5250.dts |4 
>  arch/arm/boot/dts/exynos5250.dtsi |7 +++
>  arch/arm/mach-exynos/include/mach/map.h   |1 +
>  arch/arm/mach-exynos/mach-exynos5-dt.c|2 ++
>  4 files changed, 14 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/exynos5250-smdk5250.dts
> b/arch/arm/boot/dts/exynos5250-smdk5250.dts index a352df4..2a478ab
> 100644
> --- a/arch/arm/boot/dts/exynos5250-smdk5250.dts
> +++ b/arch/arm/boot/dts/exynos5250-smdk5250.dts
> @@ -166,4 +166,8 @@
>   spi_2: spi@12d4 {
>   status = "disabled";
>   };
> +
> + hdmi {
> + hpd-gpio = <&gpx3 7 0xf 1 3>;
> + };
>  };
> diff --git a/arch/arm/boot/dts/exynos5250.dtsi
> b/arch/arm/boot/dts/exynos5250.dtsi index f69e389..4e019b5 100644
> --- a/arch/arm/boot/dts/exynos5250.dtsi
> +++ b/arch/arm/boot/dts/exynos5250.dtsi
> @@ -492,4 +492,11 @@
>   #gpio-cells = <4>;
>   };
>   };
> +
> + hdmi {

hdmi@1453

> + compatible = "samsung,exynos5-hdmi";
> + reg = <0x1453 0x10>;
> + interrupts = <0 95 0>;
> + version = "1.4";
> +};

Is it just me or there is something wrong with indentation of this 
bracket?

Best regards,
Tomasz Figa

--
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 V5 1/2] video: exynos_dp: Add device tree support to DP driver

2012-10-12 Thread Tomasz Figa
Dnia piątek, 12 października 2012 23:44:05 Sylwester Nawrocki pisze:
> On 10/12/2012 10:47 PM, Ajay Kumar wrote:
> > This patch enables device tree based discovery support for DP driver.
> > The driver is modified to handle platform data in both the cases:
> > with DT and non-DT.
> > 
> > Signed-off-by: Ajay Kumar
> > Acked-by: Jingoo Han
> > ---
> > 
> >   drivers/video/exynos/exynos_dp_core.c |  161
> >   ++---
> >   drivers/video/exynos/exynos_dp_core.h |2 +
> >   2 files changed, 149 insertions(+), 14 deletions(-)
> > 
> > diff --git a/drivers/video/exynos/exynos_dp_core.c
> > b/drivers/video/exynos/exynos_dp_core.c index d55470e..62932ba 100644
> > --- a/drivers/video/exynos/exynos_dp_core.c
> > +++ b/drivers/video/exynos/exynos_dp_core.c
> > @@ -18,6 +18,7 @@
> > 
> >   #include
> >   #include
> >   #include
> > 
> > +#include
> > 
> >   #include
> > 
> > @@ -856,6 +857,99 @@ static irqreturn_t exynos_dp_irq_handler(int irq,
> > void *arg)> 
> > return IRQ_HANDLED;
> >   
> >   }
> > 
> > +#ifdef CONFIG_OF
> > +struct exynos_dp_platdata *exynos_dp_dt_parse_pdata(struct device
> > *dev)
> > +{
> > +   struct device_node *dp_node = dev->of_node;
> > +   struct exynos_dp_platdata *pd;
> > +   struct video_info *dp_video_config;
> > +
> > +   pd = devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL);
> > +   if (!pd) {
> > +   dev_err(dev, "memory allocation for pdata failed\n");
> > +   return ERR_PTR(-ENOMEM);
> > +   }
> > +   dp_video_config = devm_kzalloc(dev,
> > +   sizeof(*dp_video_config), GFP_KERNEL);
> > +
> > +   if (!dp_video_config) {
> > +   dev_err(dev, "memory allocation for video config failed\n");
> > +   return ERR_PTR(-ENOMEM);
> > +   }
> > +   pd->video_info = dp_video_config;
> > +
> > +   if (of_get_property(dp_node, "hsync-active-high", NULL))
> > +   dp_video_config->h_sync_polarity = 1;
> > +
> > +   if (of_get_property(dp_node, "vsync-active-high", NULL))
> > +   dp_video_config->v_sync_polarity = 1;
> > +
> > +   if (of_get_property(dp_node, "interlaced", NULL))
> > +   dp_video_config->interlaced = 1;
> 
> of_property_read_bool() could also be used here.

Wouldn't it make the property mandatory?

I would just use of_find_property here, instead of of_get_property.

Best regards,
Tomasz Figa

--
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 V5 1/2] video: exynos_dp: Add device tree support to DP driver

2012-10-12 Thread Sylwester Nawrocki
On 10/12/2012 10:47 PM, Ajay Kumar wrote:
> This patch enables device tree based discovery support for DP driver.
> The driver is modified to handle platform data in both the cases:
> with DT and non-DT.
> 
> Signed-off-by: Ajay Kumar
> Acked-by: Jingoo Han
> ---
>   drivers/video/exynos/exynos_dp_core.c |  161 
> ++---
>   drivers/video/exynos/exynos_dp_core.h |2 +
>   2 files changed, 149 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/video/exynos/exynos_dp_core.c 
> b/drivers/video/exynos/exynos_dp_core.c
> index d55470e..62932ba 100644
> --- a/drivers/video/exynos/exynos_dp_core.c
> +++ b/drivers/video/exynos/exynos_dp_core.c
> @@ -18,6 +18,7 @@
>   #include
>   #include
>   #include
> +#include
> 
>   #include
> 
> @@ -856,6 +857,99 @@ static irqreturn_t exynos_dp_irq_handler(int irq, void 
> *arg)
>   return IRQ_HANDLED;
>   }
> 
> +#ifdef CONFIG_OF
> +struct exynos_dp_platdata *exynos_dp_dt_parse_pdata(struct device *dev)
> +{
> + struct device_node *dp_node = dev->of_node;
> + struct exynos_dp_platdata *pd;
> + struct video_info *dp_video_config;
> +
> + pd = devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL);
> + if (!pd) {
> + dev_err(dev, "memory allocation for pdata failed\n");
> + return ERR_PTR(-ENOMEM);
> + }
> + dp_video_config = devm_kzalloc(dev,
> + sizeof(*dp_video_config), GFP_KERNEL);
> +
> + if (!dp_video_config) {
> + dev_err(dev, "memory allocation for video config failed\n");
> + return ERR_PTR(-ENOMEM);
> + }
> + pd->video_info = dp_video_config;
> +
> + if (of_get_property(dp_node, "hsync-active-high", NULL))
> + dp_video_config->h_sync_polarity = 1;
> +
> + if (of_get_property(dp_node, "vsync-active-high", NULL))
> + dp_video_config->v_sync_polarity = 1;
> +
> + if (of_get_property(dp_node, "interlaced", NULL))
> + dp_video_config->interlaced = 1;

of_property_read_bool() could also be used here.

> +
> + of_property_read_u32(dp_node, "samsung,color-space",
> + &dp_video_config->color_space);
> +
> + of_property_read_u32(dp_node, "samsung,dynamic-range",
> + &dp_video_config->dynamic_range);
> +
> + of_property_read_u32(dp_node, "samsung,ycbcr-coeff",
> + &dp_video_config->ycbcr_coeff);
> +
> + of_property_read_u32(dp_node, "samsung,color-depth",
> + &dp_video_config->color_depth);
> +
> + of_property_read_u32(dp_node, "samsung,link-rate",
> + &dp_video_config->link_rate);
> +
> + of_property_read_u32(dp_node, "samsung,lane-count",
> + &dp_video_config->lane_count);

Shouldn't it be checked whether all these required properties are present ? 
If someone forgets to specify any one the driver will silently ignore it,
not giving a clue what's wrong.

> + return pd;
> +}
> +
> +void exynos_dp_dt_parse_phydata(struct exynos_dp_device *dp)
> +{
> + struct device_node *dp_phy_node;
> + u32 phy_base;
> + void *virt_phy_base;
> +
> + dp_phy_node = of_find_node_by_name(dp->dev->of_node, "dptx-phy");
> + if (!dp_phy_node) {
> + dp->dp_phy_addr = NULL;

Is this required ? You've allocated dp with kzalloc().

> + return;
> + }
> +
> + of_property_read_u32(dp_phy_node, "reg",&phy_base);
> + of_property_read_u32(dp_phy_node, "samsung,enable-mask",
> + &dp->enable_mask);

I think you should check the return values, these are required properties.
Some error logs might be useful here.

> + virt_phy_base = ioremap(phy_base, SZ_4);

How about assigning to dp->dp_phy_addr directly and gettting rid of
virt_phy_base ?

> + if (!virt_phy_base) {
> + dev_err(dp->dev, "failed to ioremap dp-phy\n");
> + dp->dp_phy_addr = NULL;
> + return;
> + }
> + dp->dp_phy_addr = virt_phy_base;
> +}
> +
> +void exynos_dp_phy_init(struct exynos_dp_device *dp)
> +{
> + u32 reg;
> +
> + reg = __raw_readl(dp->dp_phy_addr);
> + reg |= dp->enable_mask;
> + __raw_writel(reg, dp->dp_phy_addr);
> +}
> +
> +void exynos_dp_phy_exit(struct exynos_dp_device *dp)
> +{
> + u32 reg;
> +
> + reg = __raw_readl(dp->dp_phy_addr);
> + reg&= ~(dp->enable_mask);
> + __raw_writel(reg, dp->dp_phy_addr);
> +}
> +#endif /* CONFIG_OF */
> +
>   static int __devinit exynos_dp_probe(struct platform_device *pdev)
>   {
>   struct resource *res;
> @@ -864,12 +958,6 @@ static int __devinit exynos_dp_probe(struct 
> platform_device *pdev)
> 
>   int ret = 0;
> 
> - pdata = pdev->dev.platform_data;
> - if (!pdata) {
> - dev_err(&pdev->dev, "no platform data\n");
> - return -EINVAL;
> - }
> -
>   dp = devm_kzalloc(&pdev->dev, si

[PATCH 2/2] ARM: config: make sure that platforms are ordered by option string

2012-10-12 Thread Russell King
The large platform selection choice should be sorted by option string
so it's easy to find the platform you're looking for.  Fix the few
options which are out of this order.

Signed-off-by: Russell King 
---
 arch/arm/Kconfig |   76 +++---
 1 files changed, 38 insertions(+), 38 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index bd12ddd..1bc092e 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -348,16 +348,6 @@ config ARCH_BCM2835
  This enables support for the Broadcom BCM2835 SoC. This SoC is
  use in the Raspberry Pi, and Roku 2 devices.
 
-config ARCH_CLPS711X
-   bool "Cirrus Logic CLPS711x/EP721x/EP731x-based"
-   select ARCH_USES_GETTIMEOFFSET
-   select CLKDEV_LOOKUP
-   select COMMON_CLK
-   select CPU_ARM720T
-   select NEED_MACH_MEMORY_H
-   help
- Support for Cirrus Logic 711x/721x/731x based boards.
-
 config ARCH_CNS3XXX
bool "Cavium Networks CNS3XXX family"
select ARM_GIC
@@ -369,6 +359,16 @@ config ARCH_CNS3XXX
help
  Support for Cavium Networks CNS3XXX platform.
 
+config ARCH_CLPS711X
+   bool "Cirrus Logic CLPS711x/EP721x/EP731x-based"
+   select ARCH_USES_GETTIMEOFFSET
+   select CLKDEV_LOOKUP
+   select COMMON_CLK
+   select CPU_ARM720T
+   select NEED_MACH_MEMORY_H
+   help
+ Support for Cirrus Logic 711x/721x/731x based boards.
+
 config ARCH_GEMINI
bool "Cortina Systems Gemini"
select ARCH_REQUIRE_GPIOLIB
@@ -549,21 +549,6 @@ config ARCH_KIRKWOOD
  Support for the following Marvell Kirkwood series SoCs:
  88F6180, 88F6192 and 88F6281.
 
-config ARCH_LPC32XX
-   bool "NXP LPC32XX"
-   select ARCH_REQUIRE_GPIOLIB
-   select ARM_AMBA
-   select CLKDEV_LOOKUP
-   select CLKSRC_MMIO
-   select CPU_ARM926T
-   select GENERIC_CLOCKEVENTS
-   select HAVE_IDE
-   select HAVE_PWM
-   select USB_ARCH_HAS_OHCI
-   select USE_OF
-   help
- Support for the NXP LPC32XX family of processors
-
 config ARCH_MV78XX0
bool "Marvell MV78xx0"
select ARCH_REQUIRE_GPIOLIB
@@ -630,6 +615,21 @@ config ARCH_W90X900
  
 
+config ARCH_LPC32XX
+   bool "NXP LPC32XX"
+   select ARCH_REQUIRE_GPIOLIB
+   select ARM_AMBA
+   select CLKDEV_LOOKUP
+   select CLKSRC_MMIO
+   select CPU_ARM926T
+   select GENERIC_CLOCKEVENTS
+   select HAVE_IDE
+   select HAVE_PWM
+   select USB_ARCH_HAS_OHCI
+   select USE_OF
+   help
+ Support for the NXP LPC32XX family of processors
+
 config ARCH_TEGRA
bool "NVIDIA Tegra"
select ARCH_HAS_CPUFREQ
@@ -823,7 +823,7 @@ config ARCH_S5PV210
  Samsung S5PV210/S5PC110 series based systems
 
 config ARCH_EXYNOS
-   bool "SAMSUNG EXYNOS"
+   bool "Samsung EXYNOS"
select ARCH_HAS_CPUFREQ
select ARCH_HAS_HOLES_MEMORYMODEL
select ARCH_SPARSEMEM_ENABLE
@@ -899,6 +899,18 @@ config ARCH_NOMADIK
help
  Support for the Nomadik platform by ST-Ericsson
 
+config PLAT_SPEAR
+   bool "ST SPEAr"
+   select ARCH_REQUIRE_GPIOLIB
+   select ARM_AMBA
+   select CLKDEV_LOOKUP
+   select CLKSRC_MMIO
+   select COMMON_CLK
+   select GENERIC_CLOCKEVENTS
+   select HAVE_CLK
+   help
+ Support for ST's SPEAr platform (SPEAr3xx, SPEAr6xx and SPEAr13xx).
+
 config ARCH_DAVINCI
bool "TI DaVinci"
select ARCH_HAS_HOLES_MEMORYMODEL
@@ -926,18 +938,6 @@ config ARCH_OMAP
help
  Support for TI's OMAP platform (OMAP1/2/3/4).
 
-config PLAT_SPEAR
-   bool "ST SPEAr"
-   select ARCH_REQUIRE_GPIOLIB
-   select ARM_AMBA
-   select CLKDEV_LOOKUP
-   select CLKSRC_MMIO
-   select COMMON_CLK
-   select GENERIC_CLOCKEVENTS
-   select HAVE_CLK
-   help
- Support for ST's SPEAr platform (SPEAr3xx, SPEAr6xx and SPEAr13xx).
-
 config ARCH_VT8500
bool "VIA/WonderMedia 85xx"
select ARCH_HAS_CPUFREQ
-- 
1.7.4.4

--
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 6/6] arm: exynos: removing exynos-drm device registration from non-dt platforms

2012-10-12 Thread Rahul Sharma
As exynos-drm is a software device, its registration is moved to the
exynos drm driver. This will provide generic solution for device registration
for dt and non-dt platforms. Corresponding patches are posted to dri-devel
list.

Signed-off-by: Rahul Sharma 
---
 arch/arm/mach-exynos/Makefile  |1 -
 arch/arm/mach-exynos/dev-drm.c |   29 
 arch/arm/mach-exynos/mach-nuri.c   |3 --
 arch/arm/mach-exynos/mach-origen.c |3 --
 arch/arm/mach-exynos/mach-smdk4x12.c   |3 --
 arch/arm/mach-exynos/mach-smdkv310.c   |3 --
 arch/arm/mach-exynos/mach-universal_c210.c |3 --
 arch/arm/plat-samsung/include/plat/devs.h  |2 -
 8 files changed, 0 insertions(+), 47 deletions(-)
 delete mode 100644 arch/arm/mach-exynos/dev-drm.c

diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile
index 9b58024..1797dee 100644
--- a/arch/arm/mach-exynos/Makefile
+++ b/arch/arm/mach-exynos/Makefile
@@ -53,7 +53,6 @@ obj-$(CONFIG_EXYNOS4_DEV_AHCI)+= dev-ahci.o
 obj-$(CONFIG_EXYNOS4_DEV_DWMCI)+= dev-dwmci.o
 obj-$(CONFIG_EXYNOS_DEV_DMA)   += dma.o
 obj-$(CONFIG_EXYNOS4_DEV_USB_OHCI) += dev-ohci.o
-obj-$(CONFIG_EXYNOS_DEV_DRM)   += dev-drm.o
 obj-$(CONFIG_EXYNOS_DEV_SYSMMU)+= dev-sysmmu.o
 
 obj-$(CONFIG_ARCH_EXYNOS)  += setup-i2c0.o
diff --git a/arch/arm/mach-exynos/dev-drm.c b/arch/arm/mach-exynos/dev-drm.c
deleted file mode 100644
index 17c9c6e..000
--- a/arch/arm/mach-exynos/dev-drm.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * linux/arch/arm/mach-exynos/dev-drm.c
- *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd.
- * http://www.samsung.com
- *
- * EXYNOS - core DRM device
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-
-#include 
-#include 
-#include 
-
-#include 
-
-static u64 exynos_drm_dma_mask = DMA_BIT_MASK(32);
-
-struct platform_device exynos_device_drm = {
-   .name   = "exynos-drm",
-   .dev= {
-   .dma_mask   = &exynos_drm_dma_mask,
-   .coherent_dma_mask  = DMA_BIT_MASK(32),
-   }
-};
diff --git a/arch/arm/mach-exynos/mach-nuri.c b/arch/arm/mach-exynos/mach-nuri.c
index ea785fc..9267caf 100644
--- a/arch/arm/mach-exynos/mach-nuri.c
+++ b/arch/arm/mach-exynos/mach-nuri.c
@@ -1330,9 +1330,6 @@ static struct platform_device *nuri_devices[] __initdata 
= {
&cam_vdda_fixed_rdev,
&cam_8m_12v_fixed_rdev,
&exynos4_bus_devfreq,
-#ifdef CONFIG_DRM_EXYNOS
-   &exynos_device_drm,
-#endif
 };
 
 static void __init nuri_map_io(void)
diff --git a/arch/arm/mach-exynos/mach-origen.c 
b/arch/arm/mach-exynos/mach-origen.c
index b45600f..be8fac7 100644
--- a/arch/arm/mach-exynos/mach-origen.c
+++ b/arch/arm/mach-exynos/mach-origen.c
@@ -709,9 +709,6 @@ static struct platform_device *origen_devices[] __initdata 
= {
&s5p_device_mfc_l,
&s5p_device_mfc_r,
&s5p_device_mixer,
-#ifdef CONFIG_DRM_EXYNOS
-   &exynos_device_drm,
-#endif
&exynos4_device_ohci,
&origen_device_gpiokeys,
&origen_lcd_hv070wsa,
diff --git a/arch/arm/mach-exynos/mach-smdk4x12.c 
b/arch/arm/mach-exynos/mach-smdk4x12.c
index 81bf59c..f02ee11 100644
--- a/arch/arm/mach-exynos/mach-smdk4x12.c
+++ b/arch/arm/mach-exynos/mach-smdk4x12.c
@@ -317,9 +317,6 @@ static struct platform_device *smdk4x12_devices[] 
__initdata = {
&s5p_device_mfc,
&s5p_device_mfc_l,
&s5p_device_mfc_r,
-#ifdef CONFIG_DRM_EXYNOS
-   &exynos_device_drm,
-#endif
&samsung_device_keypad,
 };
 
diff --git a/arch/arm/mach-exynos/mach-smdkv310.c 
b/arch/arm/mach-exynos/mach-smdkv310.c
index 12a1db2..bffb1b2 100644
--- a/arch/arm/mach-exynos/mach-smdkv310.c
+++ b/arch/arm/mach-exynos/mach-smdkv310.c
@@ -300,9 +300,6 @@ static struct platform_device *smdkv310_devices[] 
__initdata = {
&s5p_device_fimc_md,
&s5p_device_g2d,
&s5p_device_jpeg,
-#ifdef CONFIG_DRM_EXYNOS
-   &exynos_device_drm,
-#endif
&exynos4_device_ac97,
&exynos4_device_i2s0,
&exynos4_device_ohci,
diff --git a/arch/arm/mach-exynos/mach-universal_c210.c 
b/arch/arm/mach-exynos/mach-universal_c210.c
index 4d1f40d..f7b1337 100644
--- a/arch/arm/mach-exynos/mach-universal_c210.c
+++ b/arch/arm/mach-exynos/mach-universal_c210.c
@@ -1084,9 +1084,6 @@ static struct platform_device *universal_devices[] 
__initdata = {
&s5p_device_onenand,
&s5p_device_fimd0,
&s5p_device_jpeg,
-#ifdef CONFIG_DRM_EXYNOS
-   &exynos_device_drm,
-#endif
&s3c_device_usb_hsotg,
&s5p_device_mfc,
&s5p_device_mfc_l,
diff --git a/arch/arm/plat-samsung/include/plat/devs.h 
b/arch/arm/plat-samsung/

[PATCH V5 2/2] video: exynos_dp: device tree documentation

2012-10-12 Thread Ajay Kumar
Add documentation for the DT bindings in exynos display port driver.

Signed-off-by: Ajay Kumar 
---
 .../devicetree/bindings/video/exynos_dp.txt|   80 
 1 files changed, 80 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/video/exynos_dp.txt

diff --git a/Documentation/devicetree/bindings/video/exynos_dp.txt 
b/Documentation/devicetree/bindings/video/exynos_dp.txt
new file mode 100644
index 000..e19594b
--- /dev/null
+++ b/Documentation/devicetree/bindings/video/exynos_dp.txt
@@ -0,0 +1,80 @@
+The Exynos display port interface should be configured based on the
+based on the type of panel connected to it.
+
+We use two nodes:
+   -display-port-controller node
+   -dptx-phy node(defined inside display-port-controller node)
+
+For the DP-PHY initialization, we use the dptx-phy node.
+Required properties for dptx-phy:
+   -reg:
+   Base address of DP PHY register.
+   -samsung,enable-mask:
+   The bit-mask used to enable/disable DP PHY.
+
+For the Panel initialization, we read data from display-port-controller node.
+Required properties for display-port-controller:
+   -compatible:
+   should be "samsung,exynos5-dp".
+   -reg:
+   physical base address of the controller and length
+   of memory mapped region.
+   -interrupts:
+   interrupt combiner values.
+   -interrupt-parent:
+   phandle to Interrupt combiner node.
+   -samsung,color-space:
+   input video data format.
+   COLOR_RGB = 0, COLOR_YCBCR422 = 1, COLOR_YCBCR444 = 2
+   -samsung,dynamic-range:
+   dynamic range for input video data.
+   VESA = 0, CEA = 1
+   -samsung,ycbcr-coeff:
+   YCbCr co-efficients for input video.
+   COLOR_YCBCR601 = 0, COLOR_YCBCR709 = 1
+   -samsung,color-depth:
+   number of bits per colour component.
+   COLOR_6 = 0, COLOR_8 = 1, COLOR_10 = 2, COLOR_12 = 3
+   -samsung,link-rate:
+   link rate supported by the panel.
+   LINK_RATE_1_62GBPS = 0x6, LINK_RATE_2_70GBPS = 0x0A
+   -samsung,lane-count:
+   number of lanes supported by the panel.
+   LANE_COUNT1 = 1, LANE_COUNT2 = 2, LANE_COUNT4 = 4
+
+Optional properties for display-port-controller:
+   -interlaced:
+   interlace scan mode.
+   Progressive if defined, Interlaced if not defined
+   -vsync-active-high:
+   VSYNC polarity configuration.
+   High if defined, Low if not defined
+   -hsync-active-high:
+   HSYNC polarity configuration.
+   High if defined, Low if not defined
+
+Example:
+
+SOC specific portion:
+   display-port-controller {
+   compatible = "samsung,exynos5-dp";
+   reg = <0x145b 0x1>;
+   interrupts = <10 3>;
+   interrupt-parent = <&combiner>;
+
+   dptx-phy {
+   reg = <0x10040720>;
+   samsung,enable-mask = <1>;
+   };
+
+};
+
+Board Specific portion:
+   display-port-controller {
+   samsung,color-space = <0>;
+   samsung,dynamic-range = <0>;
+   samsung,ycbcr-coeff = <0>;
+   samsung,color-depth = <1>;
+   samsung,link-rate = <0x0a>;
+   samsung,lane-count = <2>;
+   };
-- 
1.7.0.4

--
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 5/6] arm: exynos: add clocks for exynos5 hdmi

2012-10-12 Thread Rahul Sharma
This patch adds support for clocks for hdmi, hdmiphy and mixer.

Signed-off-by: Rahul Sharma 
---
 arch/arm/mach-exynos/clock-exynos5.c |   14 --
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-exynos/clock-exynos5.c 
b/arch/arm/mach-exynos/clock-exynos5.c
index 17e6c77..ec2a4da 100644
--- a/arch/arm/mach-exynos/clock-exynos5.c
+++ b/arch/arm/mach-exynos/clock-exynos5.c
@@ -201,6 +201,11 @@ static int exynos5_clk_ip_isp1_ctrl(struct clk *clk, int 
enable)
return s5p_gatectrl(EXYNOS5_CLKGATE_IP_ISP1, clk, enable);
 }
 
+static int exynos5_clk_hdmiphy_ctrl(struct clk *clk, int enable)
+{
+   return s5p_gatectrl(S5P_HDMI_PHY_CONTROL, clk, enable);
+}
+
 /* Core list of CMU_CPU side */
 
 static struct clksrc_clk exynos5_clk_mout_apll = {
@@ -612,12 +617,17 @@ static struct clk exynos5_init_clocks_off[] = {
.ctrlbit= (1 << 0),
}, {
.name   = "hdmi",
-   .devname= "exynos4-hdmi",
+   .devname= "exynos5-hdmi",
.enable = exynos5_clk_ip_disp1_ctrl,
.ctrlbit= (1 << 6),
}, {
+   .name   = "hdmiphy",
+   .devname= "exynos5-hdmi",
+   .enable = exynos5_clk_hdmiphy_ctrl,
+   .ctrlbit= (1 << 0),
+   }, {
.name   = "mixer",
-   .devname= "s5p-mixer",
+   .devname= "exynos5-mixer",
.enable = exynos5_clk_ip_disp1_ctrl,
.ctrlbit= (1 << 5),
}, {
-- 
1.7.0.4

--
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 V5 1/2] video: exynos_dp: Add device tree support to DP driver

2012-10-12 Thread Ajay Kumar
This patch enables device tree based discovery support for DP driver.
The driver is modified to handle platform data in both the cases:
with DT and non-DT.

Signed-off-by: Ajay Kumar 
Acked-by: Jingoo Han 
---
 drivers/video/exynos/exynos_dp_core.c |  161 ++---
 drivers/video/exynos/exynos_dp_core.h |2 +
 2 files changed, 149 insertions(+), 14 deletions(-)

diff --git a/drivers/video/exynos/exynos_dp_core.c 
b/drivers/video/exynos/exynos_dp_core.c
index d55470e..62932ba 100644
--- a/drivers/video/exynos/exynos_dp_core.c
+++ b/drivers/video/exynos/exynos_dp_core.c
@@ -18,6 +18,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -856,6 +857,99 @@ static irqreturn_t exynos_dp_irq_handler(int irq, void 
*arg)
return IRQ_HANDLED;
 }
 
+#ifdef CONFIG_OF
+struct exynos_dp_platdata *exynos_dp_dt_parse_pdata(struct device *dev)
+{
+   struct device_node *dp_node = dev->of_node;
+   struct exynos_dp_platdata *pd;
+   struct video_info *dp_video_config;
+
+   pd = devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL);
+   if (!pd) {
+   dev_err(dev, "memory allocation for pdata failed\n");
+   return ERR_PTR(-ENOMEM);
+   }
+   dp_video_config = devm_kzalloc(dev,
+   sizeof(*dp_video_config), GFP_KERNEL);
+
+   if (!dp_video_config) {
+   dev_err(dev, "memory allocation for video config failed\n");
+   return ERR_PTR(-ENOMEM);
+   }
+   pd->video_info = dp_video_config;
+
+   if (of_get_property(dp_node, "hsync-active-high", NULL))
+   dp_video_config->h_sync_polarity = 1;
+
+   if (of_get_property(dp_node, "vsync-active-high", NULL))
+   dp_video_config->v_sync_polarity = 1;
+
+   if (of_get_property(dp_node, "interlaced", NULL))
+   dp_video_config->interlaced = 1;
+
+   of_property_read_u32(dp_node, "samsung,color-space",
+   &dp_video_config->color_space);
+
+   of_property_read_u32(dp_node, "samsung,dynamic-range",
+   &dp_video_config->dynamic_range);
+
+   of_property_read_u32(dp_node, "samsung,ycbcr-coeff",
+   &dp_video_config->ycbcr_coeff);
+
+   of_property_read_u32(dp_node, "samsung,color-depth",
+   &dp_video_config->color_depth);
+
+   of_property_read_u32(dp_node, "samsung,link-rate",
+   &dp_video_config->link_rate);
+
+   of_property_read_u32(dp_node, "samsung,lane-count",
+   &dp_video_config->lane_count);
+   return pd;
+}
+
+void exynos_dp_dt_parse_phydata(struct exynos_dp_device *dp)
+{
+   struct device_node *dp_phy_node;
+   u32 phy_base;
+   void *virt_phy_base;
+
+   dp_phy_node = of_find_node_by_name(dp->dev->of_node, "dptx-phy");
+   if (!dp_phy_node) {
+   dp->dp_phy_addr = NULL;
+   return;
+   }
+
+   of_property_read_u32(dp_phy_node, "reg", &phy_base);
+   of_property_read_u32(dp_phy_node, "samsung,enable-mask",
+   &dp->enable_mask);
+   virt_phy_base = ioremap(phy_base, SZ_4);
+   if (!virt_phy_base) {
+   dev_err(dp->dev, "failed to ioremap dp-phy\n");
+   dp->dp_phy_addr = NULL;
+   return;
+   }
+   dp->dp_phy_addr = virt_phy_base;
+}
+
+void exynos_dp_phy_init(struct exynos_dp_device *dp)
+{
+   u32 reg;
+
+   reg = __raw_readl(dp->dp_phy_addr);
+   reg |= dp->enable_mask;
+   __raw_writel(reg, dp->dp_phy_addr);
+}
+
+void exynos_dp_phy_exit(struct exynos_dp_device *dp)
+{
+   u32 reg;
+
+   reg = __raw_readl(dp->dp_phy_addr);
+   reg &= ~(dp->enable_mask);
+   __raw_writel(reg, dp->dp_phy_addr);
+}
+#endif /* CONFIG_OF */
+
 static int __devinit exynos_dp_probe(struct platform_device *pdev)
 {
struct resource *res;
@@ -864,12 +958,6 @@ static int __devinit exynos_dp_probe(struct 
platform_device *pdev)
 
int ret = 0;
 
-   pdata = pdev->dev.platform_data;
-   if (!pdata) {
-   dev_err(&pdev->dev, "no platform data\n");
-   return -EINVAL;
-   }
-
dp = devm_kzalloc(&pdev->dev, sizeof(struct exynos_dp_device),
GFP_KERNEL);
if (!dp) {
@@ -879,6 +967,21 @@ static int __devinit exynos_dp_probe(struct 
platform_device *pdev)
 
dp->dev = &pdev->dev;
 
+   if (pdev->dev.of_node) {
+   pdata = exynos_dp_dt_parse_pdata(&pdev->dev);
+   if (IS_ERR(pdata))
+   return PTR_ERR(pdata);
+
+   exynos_dp_dt_parse_phydata(dp);
+   } else {
+   pdata = pdev->dev.platform_data;
+   }
+
+   if (!pdata) {
+   dev_err(&pdev->dev, "no platform data\n");
+   return -EINVAL;
+   }
+
dp->clock = dev

[PATCH v2 4/6] dts: exynos: add device tree support for exynos5 hdmiddc

2012-10-12 Thread Rahul Sharma
This patch adds support for device tree based discovery for exynos5
hdmi ddc.

Signed-off-by: Rahul Sharma 
---
 .../devicetree/bindings/drm/exynos/hdmiddc.txt |   12 
 arch/arm/boot/dts/exynos5250-smdk5250.dts  |   10 +-
 arch/arm/mach-exynos/mach-exynos5-dt.c |2 ++
 3 files changed, 23 insertions(+), 1 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/drm/exynos/hdmiddc.txt

diff --git a/Documentation/devicetree/bindings/drm/exynos/hdmiddc.txt 
b/Documentation/devicetree/bindings/drm/exynos/hdmiddc.txt
new file mode 100644
index 000..c408892
--- /dev/null
+++ b/Documentation/devicetree/bindings/drm/exynos/hdmiddc.txt
@@ -0,0 +1,12 @@
+Device-Tree bindings for hdmiddc driver
+
+Required properties:
+- compatible: value should be "samsung,exynos5-hdmiddc".
+- reg: I2C address of the hdmiddc device.
+
+Example:
+
+   hdmiddc {
+   compatible = "samsung,exynos5-hdmiddc";
+   reg = <0x50>;
+   };
\ No newline at end of file
diff --git a/arch/arm/boot/dts/exynos5250-smdk5250.dts 
b/arch/arm/boot/dts/exynos5250-smdk5250.dts
index af9271c..be22a83 100644
--- a/arch/arm/boot/dts/exynos5250-smdk5250.dts
+++ b/arch/arm/boot/dts/exynos5250-smdk5250.dts
@@ -56,7 +56,15 @@
};
 
i2c@12C8 {
-   status = "disabled";
+   samsung,i2c-sda-delay = <100>;
+   samsung,i2c-max-bus-freq = <66000>;
+   gpios = <&gpa0 6 3 3 0>,
+   <&gpa0 7 3 3 0>;
+
+   hdmiddc {
+   compatible = "samsung,exynos5-hdmiddc";
+   reg = <0x50>;
+   };
};
 
i2c@12C9 {
diff --git a/arch/arm/mach-exynos/mach-exynos5-dt.c 
b/arch/arm/mach-exynos/mach-exynos5-dt.c
index 3f129db..003963c 100644
--- a/arch/arm/mach-exynos/mach-exynos5-dt.c
+++ b/arch/arm/mach-exynos/mach-exynos5-dt.c
@@ -47,6 +47,8 @@ static const struct of_dev_auxdata 
exynos5250_auxdata_lookup[] __initconst = {
"s3c2440-i2c.0", NULL),
OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS5_PA_IIC(1),
"s3c2440-i2c.1", NULL),
+   OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS5_PA_IIC(2),
+   "s3c2440-i2c.2", NULL),
OF_DEV_AUXDATA("samsung,s3c2440-hdmiphy-i2c", EXYNOS5_PA_IIC(8),
"s3c2440-hdmiphy-i2c", NULL),
OF_DEV_AUXDATA("samsung,exynos5250-dw-mshc", EXYNOS5_PA_DWMCI0,
-- 
1.7.0.4

--
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/6] dts: exynos: add device tree support for exynos5 hdmiphy

2012-10-12 Thread Rahul Sharma
This patch adds support for device tree based discovery for exynos5
hdmiphy.

Signed-off-by: Rahul Sharma 
---
 .../devicetree/bindings/drm/exynos/hdmiphy.txt |   12 
 arch/arm/boot/dts/exynos5250-smdk5250.dts  |   10 ++
 arch/arm/boot/dts/exynos5250.dtsi  |8 
 arch/arm/mach-exynos/mach-exynos5-dt.c |2 ++
 4 files changed, 32 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/drm/exynos/hdmiphy.txt

diff --git a/Documentation/devicetree/bindings/drm/exynos/hdmiphy.txt 
b/Documentation/devicetree/bindings/drm/exynos/hdmiphy.txt
new file mode 100644
index 000..c4face5
--- /dev/null
+++ b/Documentation/devicetree/bindings/drm/exynos/hdmiphy.txt
@@ -0,0 +1,12 @@
+Device-Tree bindings for hdmiphy driver
+
+Required properties:
+- compatible: value should be "samsung,exynos5-hdmiphy".
+- reg: I2C address of the hdmiphy device.
+
+Example:
+
+   hdmiphy {
+   compatible = "samsung,exynos5-hdmiphy";
+   reg = <0x38>;
+   };
\ No newline at end of file
diff --git a/arch/arm/boot/dts/exynos5250-smdk5250.dts 
b/arch/arm/boot/dts/exynos5250-smdk5250.dts
index 2a478ab..af9271c 100644
--- a/arch/arm/boot/dts/exynos5250-smdk5250.dts
+++ b/arch/arm/boot/dts/exynos5250-smdk5250.dts
@@ -79,6 +79,16 @@
status = "disabled";
};
 
+i2c@12CE {
+   samsung,i2c-sda-delay = <100>;
+   samsung,i2c-max-bus-freq = <66000>;
+
+   hdmiphy {
+   compatible = "samsung,exynos5-hdmiphy";
+   reg = <0x38>;
+   };
+   };
+
dwmmc_0: dwmmc0@1220 {
num-slots = <1>;
supports-highspeed;
diff --git a/arch/arm/boot/dts/exynos5250.dtsi 
b/arch/arm/boot/dts/exynos5250.dtsi
index 6abadbf..fc5123f 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -152,6 +152,14 @@
#size-cells = <0>;
};
 
+   i2c@12CE {
+   compatible = "samsung,s3c2440-hdmiphy-i2c";
+   reg = <0x12CE 0x1000>;
+   interrupts = <0 64 0>;
+   #address-cells = <1>;
+   #size-cells = <0>;
+   };
+
spi_0: spi@12d2 {
compatible = "samsung,exynos4210-spi";
reg = <0x12d2 0x100>;
diff --git a/arch/arm/mach-exynos/mach-exynos5-dt.c 
b/arch/arm/mach-exynos/mach-exynos5-dt.c
index cdad7c1..3f129db 100644
--- a/arch/arm/mach-exynos/mach-exynos5-dt.c
+++ b/arch/arm/mach-exynos/mach-exynos5-dt.c
@@ -47,6 +47,8 @@ static const struct of_dev_auxdata 
exynos5250_auxdata_lookup[] __initconst = {
"s3c2440-i2c.0", NULL),
OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS5_PA_IIC(1),
"s3c2440-i2c.1", NULL),
+   OF_DEV_AUXDATA("samsung,s3c2440-hdmiphy-i2c", EXYNOS5_PA_IIC(8),
+   "s3c2440-hdmiphy-i2c", NULL),
OF_DEV_AUXDATA("samsung,exynos5250-dw-mshc", EXYNOS5_PA_DWMCI0,
"dw_mmc.0", NULL),
OF_DEV_AUXDATA("samsung,exynos5250-dw-mshc", EXYNOS5_PA_DWMCI1,
-- 
1.7.0.4

--
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/6] dts: exynos: add device tree support for exynos5 mixer

2012-10-12 Thread Rahul Sharma
This patch adds support for device tree based discovery for exynos5
mixer. Mixer node is also renamed with "exynos5-mixer".

Signed-off-by: Rahul Sharma 
---
 .../devicetree/bindings/drm/exynos/mixer.txt   |   15 +++
 arch/arm/boot/dts/exynos5250.dtsi  |6 ++
 arch/arm/mach-exynos/include/mach/map.h|1 +
 arch/arm/mach-exynos/mach-exynos5-dt.c |2 ++
 4 files changed, 24 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/drm/exynos/mixer.txt

diff --git a/Documentation/devicetree/bindings/drm/exynos/mixer.txt 
b/Documentation/devicetree/bindings/drm/exynos/mixer.txt
new file mode 100644
index 000..05e4731
--- /dev/null
+++ b/Documentation/devicetree/bindings/drm/exynos/mixer.txt
@@ -0,0 +1,15 @@
+Device-Tree bindings for mixer driver
+
+Required properties:
+- compatible: value should be "samsung,exynos5-mixer".
+- reg: physical base address of the mixer and length of memory mapped
+   region.
+- interrupts: interrupt number to the cpu.
+
+Example:
+
+   mixer {
+   compatible = "samsung,exynos5-mixer";
+   reg = <0x1445 0x1>;
+   interrupts = <0 94 0>;
+   };
\ No newline at end of file
diff --git a/arch/arm/boot/dts/exynos5250.dtsi 
b/arch/arm/boot/dts/exynos5250.dtsi
index eea84a3..6abadbf 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -498,4 +498,10 @@
reg = <0x1453 0x10>;
interrupts = <0 95 0>;
 };
+
+mixer {
+   compatible = "samsung,exynos5-mixer";
+   reg = <0x1445 0x1>;
+   interrupts = <0 94 0>;
+};
 };
diff --git a/arch/arm/mach-exynos/include/mach/map.h 
b/arch/arm/mach-exynos/include/mach/map.h
index 7b9efb2..314ee75 100644
--- a/arch/arm/mach-exynos/include/mach/map.h
+++ b/arch/arm/mach-exynos/include/mach/map.h
@@ -201,6 +201,7 @@
 #define EXYNOS4_PA_SDO 0x12C2
 #define EXYNOS4_PA_HDMI0x12D0
 #define EXYNOS4_PA_IIC_HDMIPHY 0x138E
+#define EXYNOS5_PA_MIXER   0x1445
 #define EXYNOS5_PA_HDMI0x1453
 
 #define EXYNOS4_PA_IIC(x)  (0x1386 + ((x) * 0x1))
diff --git a/arch/arm/mach-exynos/mach-exynos5-dt.c 
b/arch/arm/mach-exynos/mach-exynos5-dt.c
index 43449fb..cdad7c1 100644
--- a/arch/arm/mach-exynos/mach-exynos5-dt.c
+++ b/arch/arm/mach-exynos/mach-exynos5-dt.c
@@ -66,6 +66,8 @@ static const struct of_dev_auxdata 
exynos5250_auxdata_lookup[] __initconst = {
OF_DEV_AUXDATA("arm,pl330", EXYNOS5_PA_MDMA1, "dma-pl330.2", NULL),
OF_DEV_AUXDATA("samsung,exynos5-hdmi", EXYNOS5_PA_HDMI,
"exynos5-hdmi", NULL),
+   OF_DEV_AUXDATA("samsung,exynos5-mixer", EXYNOS5_PA_MIXER,
+   "exynos5-mixer", NULL),
{},
 };
 
-- 
1.7.0.4

--
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/6] dts: exynos: add device tree support for exynos5 hdmi

2012-10-12 Thread Rahul Sharma
This patch adds support for device tree based discovery for exynos5
hdmi. Hdmi node is also renamed with "exynos5-hdmi".

Signed-off-by: Rahul Sharma 
---
 .../devicetree/bindings/drm/exynos/hdmi.txt|   22 
 arch/arm/boot/dts/exynos5250-smdk5250.dts  |4 +++
 arch/arm/boot/dts/exynos5250.dtsi  |6 +
 arch/arm/mach-exynos/include/mach/map.h|1 +
 arch/arm/mach-exynos/mach-exynos5-dt.c |2 +
 5 files changed, 35 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/drm/exynos/hdmi.txt

diff --git a/Documentation/devicetree/bindings/drm/exynos/hdmi.txt 
b/Documentation/devicetree/bindings/drm/exynos/hdmi.txt
new file mode 100644
index 000..8b0fa7c
--- /dev/null
+++ b/Documentation/devicetree/bindings/drm/exynos/hdmi.txt
@@ -0,0 +1,22 @@
+Device-Tree bindings for drm hdmi driver
+
+Required properties:
+- compatible: value should be "samsung,exynos5-hdmi".
+- reg: physical base address of the hdmi and length of memory mapped
+   region.
+- interrupts: interrupt number to the cpu.
+- hpd-gpio: following information about the hotplug gpio pin.
+   a) phandle of the gpio controller node.
+   b) pin number within the gpio controller.
+   c) pin function mode.
+   d) optional flags and pull up/down.
+   e) drive strength.
+
+Example:
+
+   hdmi {
+   compatible = "samsung,exynos5-hdmi";
+   reg = <0x1453 0x10>;
+   interrupts = <0 95 0>;
+   hpd-gpio = <&gpx3 7 0xf 1 3>;
+   };
\ No newline at end of file
diff --git a/arch/arm/boot/dts/exynos5250-smdk5250.dts 
b/arch/arm/boot/dts/exynos5250-smdk5250.dts
index a352df4..2a478ab 100644
--- a/arch/arm/boot/dts/exynos5250-smdk5250.dts
+++ b/arch/arm/boot/dts/exynos5250-smdk5250.dts
@@ -166,4 +166,8 @@
spi_2: spi@12d4 {
status = "disabled";
};
+
+   hdmi {
+   hpd-gpio = <&gpx3 7 0xf 1 3>;
+   };
 };
diff --git a/arch/arm/boot/dts/exynos5250.dtsi 
b/arch/arm/boot/dts/exynos5250.dtsi
index f69e389..eea84a3 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -492,4 +492,10 @@
#gpio-cells = <4>;
};
};
+
+   hdmi {
+   compatible = "samsung,exynos5-hdmi";
+   reg = <0x1453 0x10>;
+   interrupts = <0 95 0>;
+};
 };
diff --git a/arch/arm/mach-exynos/include/mach/map.h 
b/arch/arm/mach-exynos/include/mach/map.h
index 5edbbe9..7b9efb2 100644
--- a/arch/arm/mach-exynos/include/mach/map.h
+++ b/arch/arm/mach-exynos/include/mach/map.h
@@ -201,6 +201,7 @@
 #define EXYNOS4_PA_SDO 0x12C2
 #define EXYNOS4_PA_HDMI0x12D0
 #define EXYNOS4_PA_IIC_HDMIPHY 0x138E
+#define EXYNOS5_PA_HDMI0x1453
 
 #define EXYNOS4_PA_IIC(x)  (0x1386 + ((x) * 0x1))
 #define EXYNOS5_PA_IIC(x)  (0x12C6 + ((x) * 0x1))
diff --git a/arch/arm/mach-exynos/mach-exynos5-dt.c 
b/arch/arm/mach-exynos/mach-exynos5-dt.c
index ce82f30..43449fb 100644
--- a/arch/arm/mach-exynos/mach-exynos5-dt.c
+++ b/arch/arm/mach-exynos/mach-exynos5-dt.c
@@ -64,6 +64,8 @@ static const struct of_dev_auxdata 
exynos5250_auxdata_lookup[] __initconst = {
OF_DEV_AUXDATA("arm,pl330", EXYNOS5_PA_PDMA0, "dma-pl330.0", NULL),
OF_DEV_AUXDATA("arm,pl330", EXYNOS5_PA_PDMA1, "dma-pl330.1", NULL),
OF_DEV_AUXDATA("arm,pl330", EXYNOS5_PA_MDMA1, "dma-pl330.2", NULL),
+   OF_DEV_AUXDATA("samsung,exynos5-hdmi", EXYNOS5_PA_HDMI,
+   "exynos5-hdmi", NULL),
{},
 };
 
-- 
1.7.0.4

--
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 0/6] arm: exynos: add dt based support for exynos5 hdmi

2012-10-12 Thread Rahul Sharma
This patch set adds the DT based support for Samsung's Exynos5250. It adds
device tree nodes for hdmi, mixer, hdmiphy and hdmiddc. The name of these
devices are changed to the one matching with drivers. Exynos-drm and exynos
hdmi-drm-commmon devices are removed from machine init code.

Exynos-drm and exynos hdmi-drm-commmon devices are removed from machine
init code. Patch set which adds this code is "add exynos-drm platform device
registration to driver" is posted to dri-devel mailing list.

This patchset is based on linux v3.6-rc5, branch dt-samsung-new at
git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git

v1:
- dropped patch for hpd gpio initialisation from machine init.
- dropped patch for platform device registration.
- removed platform device registration from non-dt platforms.

v2:
- removed version information from hdmi, mixer dt nodes.
- added DT binding documentation for hdmi, mixer, hdmiphy and hdmiddc.

Rahul Sharma (6):
  dts: exynos: add device tree support for exynos5 hdmi
  dts: exynos: add device tree support for exynos5 mixer
  dts: exynos: add device tree support for exynos5 hdmiphy
  dts: exynos: add device tree support for exynos5 hdmiddc
  arm: exynos: add clocks for exynos5 hdmi
  arm: exynos: removing exynos-drm device registration from non-dt
platforms

 .../devicetree/bindings/drm/exynos/hdmi.txt|   22 +++
 .../devicetree/bindings/drm/exynos/hdmiddc.txt |   12 
 .../devicetree/bindings/drm/exynos/hdmiphy.txt |   12 
 .../devicetree/bindings/drm/exynos/mixer.txt   |   15 ++
 arch/arm/boot/dts/exynos5250-smdk5250.dts  |   24 +++-
 arch/arm/boot/dts/exynos5250.dtsi  |   20 +
 arch/arm/mach-exynos/Makefile  |1 -
 arch/arm/mach-exynos/clock-exynos5.c   |   14 -
 arch/arm/mach-exynos/dev-drm.c |   29 
 arch/arm/mach-exynos/include/mach/map.h|2 +
 arch/arm/mach-exynos/mach-exynos5-dt.c |8 +
 arch/arm/mach-exynos/mach-nuri.c   |3 --
 arch/arm/mach-exynos/mach-origen.c |3 --
 arch/arm/mach-exynos/mach-smdk4x12.c   |3 --
 arch/arm/mach-exynos/mach-smdkv310.c   |3 --
 arch/arm/mach-exynos/mach-universal_c210.c |3 --
 arch/arm/plat-samsung/include/plat/devs.h  |2 -
 17 files changed, 126 insertions(+), 50 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/drm/exynos/hdmi.txt
 create mode 100644 Documentation/devicetree/bindings/drm/exynos/hdmiddc.txt
 create mode 100644 Documentation/devicetree/bindings/drm/exynos/hdmiphy.txt
 create mode 100644 Documentation/devicetree/bindings/drm/exynos/mixer.txt
 delete mode 100644 arch/arm/mach-exynos/dev-drm.c

--
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: phy: samsung: Introducing usb phy driver for hsotg

2012-10-12 Thread Praveen Paneri
platform_set_drvdata() required for driver's remove function, so adding
it back.

>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   |  357 
 include/linux/platform_data/samsung-usbphy.h   |   27 ++
 5 files changed, 404 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..7b26e2d
--- /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..14c182f
--- /dev/null
+++ b/drivers/usb/phy/samsung-usbphy.c
@@ -0,0 +1,357 @@
+/* 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 MH

[PATCH] ARM: EXYNOS: exynos4-dt: Set .smp field of machine descriptor

2012-10-12 Thread Tomasz Figa
This patch adds missing initializer of .smp field of machine descriptor
of Exynos 4 DT machine.

Signed-off-by: Tomasz Figa 
---
 arch/arm/mach-exynos/mach-exynos4-dt.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-exynos/mach-exynos4-dt.c 
b/arch/arm/mach-exynos/mach-exynos4-dt.c
index 7222e3c..d6bdcfb 100644
--- a/arch/arm/mach-exynos/mach-exynos4-dt.c
+++ b/arch/arm/mach-exynos/mach-exynos4-dt.c
@@ -119,6 +119,7 @@ static char const *exynos4_dt_compat[] __initdata = {
 
 DT_MACHINE_START(EXYNOS4210_DT, "Samsung Exynos4 (Flattened Device Tree)")
/* Maintainer: Thomas Abraham  */
+   .smp= smp_ops(exynos_smp_ops),
.init_irq   = exynos4_init_irq,
.map_io = exynos4_dt_map_io,
.handle_irq = gic_handle_irq,
-- 
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