[PATCH] ARM: SAMSUNG: Add clk enable/disable of pwm

2011-10-24 Thread Joonyoung Shim
PWM timers use pclk("timers" clk) as parent clk. If this pclk is the
disabled state when PWM driver is probed, then it causes wrong read and
write operation about registers of PWM.

Signed-off-by: Joonyoung Shim 
Signed-off-by: Kyungmin Park 
---
 arch/arm/plat-samsung/pwm.c |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-samsung/pwm.c b/arch/arm/plat-samsung/pwm.c
index f37457c..dc1185d 100644
--- a/arch/arm/plat-samsung/pwm.c
+++ b/arch/arm/plat-samsung/pwm.c
@@ -299,6 +299,9 @@ static int s3c_pwm_probe(struct platform_device *pdev)
goto err_clk_tin;
}
 
+   clk_enable(pwm->clk);
+   clk_enable(pwm->clk_div);
+
local_irq_save(flags);
 
tcon = __raw_readl(S3C2410_TCON);
@@ -326,6 +329,8 @@ static int s3c_pwm_probe(struct platform_device *pdev)
return 0;
 
  err_clk_tdiv:
+   clk_disable(pwm->clk_div);
+   clk_disable(pwm->clk);
clk_put(pwm->clk_div);
 
  err_clk_tin:
@@ -340,6 +345,8 @@ static int __devexit s3c_pwm_remove(struct platform_device 
*pdev)
 {
struct pwm_device *pwm = platform_get_drvdata(pdev);
 
+   clk_disable(pwm->clk_div);
+   clk_disable(pwm->clk);
clk_put(pwm->clk_div);
clk_put(pwm->clk);
kfree(pwm);
-- 
1.7.5.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 RESEND] mmc: core: Assemble the codes of related to eMMC4.5

2011-10-24 Thread Seungwon Jeon
Code cleanup. The codes of related to eMMC4.5 are scattered.
This patch removes one if-statement and assembles all. And it also
removes variable initialization below else-statement. It is obvious
for previous version but seems unnecessary. All members of card structure
are already set to zero at card-init.

Signed-off-by: Seungwon Jeon 
---
 drivers/mmc/core/mmc.c |   20 +---
 1 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 6354eb3..6354bac 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -467,29 +467,27 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 
*ext_csd)
card->ext_csd.rst_n_function = ext_csd[EXT_CSD_RST_N_FUNCTION];
}

-   /* eMMC v4.5 or later */
-   if (card->ext_csd.rev >= 6)
-   card->ext_csd.feature_support |= MMC_DISCARD_FEATURE;
-
card->ext_csd.raw_erased_mem_count = ext_csd[EXT_CSD_ERASED_MEM_CONT];
if (ext_csd[EXT_CSD_ERASED_MEM_CONT])
card->erased_byte = 0xFF;
else
card->erased_byte = 0x0;

+   /* eMMC v4.5 or later */
if (card->ext_csd.rev >= 6) {
+   card->ext_csd.feature_support |= MMC_DISCARD_FEATURE;
+
card->ext_csd.generic_cmd6_time = 10 *
ext_csd[EXT_CSD_GENERIC_CMD6_TIME];
card->ext_csd.power_off_longtime = 10 *
ext_csd[EXT_CSD_POWER_OFF_LONG_TIME];
-   } else
-   card->ext_csd.generic_cmd6_time = 0;

-   card->ext_csd.cache_size =
-   ext_csd[EXT_CSD_CACHE_SIZE + 0] << 0 |
-   ext_csd[EXT_CSD_CACHE_SIZE + 1] << 8 |
-   ext_csd[EXT_CSD_CACHE_SIZE + 2] << 16 |
-   ext_csd[EXT_CSD_CACHE_SIZE + 3] << 24;
+   card->ext_csd.cache_size =
+   ext_csd[EXT_CSD_CACHE_SIZE + 0] << 0 |
+   ext_csd[EXT_CSD_CACHE_SIZE + 1] << 8 |
+   ext_csd[EXT_CSD_CACHE_SIZE + 2] << 16 |
+   ext_csd[EXT_CSD_CACHE_SIZE + 3] << 24;
+   }

 out:
return err;
--
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


RE: [PATCH] mmc: core: Assemble the codes of related to eMMC4.5

2011-10-24 Thread Seungwon Jeon
Chris Ball wrote:
> Hi Seungwon,
> 
> On Mon, Oct 24 2011, Seungwon Jeon wrote:
> > Code cleanup. The codes of related to eMMC4.5 are scattered.
> > This patch removes a duplicate if-statement and assembles all.
> >
> > Signed-off-by: Seungwon Jeon 
> > ---
> >  drivers/mmc/core/mmc.c |   20 +---
> >  1 files changed, 9 insertions(+), 11 deletions(-)
> >
> > diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
> > index fb5bf01..3627044 100644
> > --- a/drivers/mmc/core/mmc.c
> > +++ b/drivers/mmc/core/mmc.c
> > @@ -467,29 +467,27 @@ static int mmc_read_ext_csd(struct mmc_card *card,
> u8 *ext_csd)
> > card->ext_csd.rst_n_function =
> ext_csd[EXT_CSD_RST_N_FUNCTION];
> > }
> >
> > -   /* eMMC v4.5 or later */
> > -   if (card->ext_csd.rev >= 6)
> > -   card->ext_csd.feature_support |= MMC_DISCARD_FEATURE;
> > -
> > card->ext_csd.raw_erased_mem_count =
> ext_csd[EXT_CSD_ERASED_MEM_CONT];
> > if (ext_csd[EXT_CSD_ERASED_MEM_CONT])
> > card->erased_byte = 0xFF;
> > else
> > card->erased_byte = 0x0;
> >
> > +   /* eMMC v4.5 or later */
> > if (card->ext_csd.rev >= 6) {
> > +   card->ext_csd.feature_support |= MMC_DISCARD_FEATURE;
> > +
> > card->ext_csd.generic_cmd6_time = 10 *
> > ext_csd[EXT_CSD_GENERIC_CMD6_TIME];
> > card->ext_csd.power_off_longtime = 10 *
> > ext_csd[EXT_CSD_POWER_OFF_LONG_TIME];
> > -   } else
> > -   card->ext_csd.generic_cmd6_time = 0;
> 
> Your patch removes this line completely.  Why is that?  You should
> explain it in the commit message.
Sure, I will.
Removed line is just for explicit initialization considering previous
version
even though generic_cmd6_time is zeroed at card init-time.
So it seems be unnecessary.

Best regards,
Seungwon Jeon.

> 
> >
> > -   card->ext_csd.cache_size =
> > -   ext_csd[EXT_CSD_CACHE_SIZE + 0] << 0 |
> > -   ext_csd[EXT_CSD_CACHE_SIZE + 1] << 8 |
> > -   ext_csd[EXT_CSD_CACHE_SIZE + 2] << 16 |
> > -   ext_csd[EXT_CSD_CACHE_SIZE + 3] << 24;
> > +   card->ext_csd.cache_size =
> > +   ext_csd[EXT_CSD_CACHE_SIZE + 0] << 0 |
> > +   ext_csd[EXT_CSD_CACHE_SIZE + 1] << 8 |
> > +   ext_csd[EXT_CSD_CACHE_SIZE + 2] << 16 |
> > +   ext_csd[EXT_CSD_CACHE_SIZE + 3] << 24;
> > +   }
> >
> >  out:
> > return err;
> 
> The rest looks good, thanks,
> 
> - Chris.
> --
> Chris Ball  
> One Laptop Per Child

--
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] mmc: core: Separate the timeout value for cache-ctrl

2011-10-24 Thread Seungwon Jeon
Girish K S wrote:
> On 24 October 2011 15:40, Seungwon Jeon  wrote:
> > Turning the cache off implies flushing cache which doesn't define
> > maximum timeout unlike cache-on. This patch will apply the generic
> > CMD6 timeout only for cache-on. Additionally the kernel message is
> > added for checking failure case of cache-on.
> >
> > Signed-off-by: Seungwon Jeon 
> > ---
> >  drivers/mmc/core/core.c |   22 +-
> >  drivers/mmc/core/mmc.c  |   10 --
> >  2 files changed, 21 insertions(+), 11 deletions(-)
> >
> > diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> > index 5278ffb..65b5643 100644
> > --- a/drivers/mmc/core/core.c
> > +++ b/drivers/mmc/core/core.c
> > @@ -2248,6 +2248,7 @@ EXPORT_SYMBOL(mmc_flush_cache);
> >  int mmc_cache_ctrl(struct mmc_host *host, u8 enable)
> >  {
> >        struct mmc_card *card = host->card;
> > +       unsigned int timeout;
> >        int err = 0;
> >
> >        if (!(host->caps2 & MMC_CAP2_CACHE_CTRL) ||
> > @@ -2258,16 +2259,19 @@ int mmc_cache_ctrl(struct mmc_host *host, u8
> enable)
> >                        (card->ext_csd.cache_size > 0)) {
> >                enable = !!enable;
> >
> > -               if (card->ext_csd.cache_ctrl ^ enable)
> > +               if (card->ext_csd.cache_ctrl ^ enable) {
> > +                       timeout = enable ?
card->ext_csd.generic_cmd6_time :
> 0;
> >                        err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
> > -                                       EXT_CSD_CACHE_CTRL, enable, 0);
> Here timeout value used is 0. If it has to be 0 then why should you check
> timeout = enable ? card->ext_csd.generic_cmd6_time : 0;
> I think it should be card->ext_csd.generic_cmd6_time instead of 0
Upper line you pointed was removed. Could check '-', please?
> > -               if (err)
> > -                       pr_err("%s: cache %s error %d\n",
> > -                                       mmc_hostname(card->host),
> > -                                       enable ? "on" : "off",
> > -                                       err);
> > -               else
> > -                       card->ext_csd.cache_ctrl = enable;
> > +                                       EXT_CSD_CACHE_CTRL, enable,
timeout);
Here is modified line.

Beset regards,
Seungwon Jeon.
> > +
> > +                       if (err)
> > +                               pr_err("%s: cache %s error %d\n",
> > +                                              
mmc_hostname(card->host),
> > +                                               enable ? "on" : "off",
> > +                                               err);
> > +                       else
> > +                               card->ext_csd.cache_ctrl = enable;
> > +               }
> >        }
> >
> >        return err;
> > diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
> > index fb5bf01..6354eb3 100644
> > --- a/drivers/mmc/core/mmc.c
> > +++ b/drivers/mmc/core/mmc.c
> > @@ -1064,14 +1064,20 @@ static int mmc_init_card(struct mmc_host *host,
> u32 ocr,
> >        if ((host->caps2 & MMC_CAP2_CACHE_CTRL) &&
> >                        card->ext_csd.cache_size > 0) {
> >                err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
> > -                               EXT_CSD_CACHE_CTRL, 1, 0);
> > +                               EXT_CSD_CACHE_CTRL, 1,
> > +                               card->ext_csd.generic_cmd6_time);
> >                if (err && err != -EBADMSG)
> >                        goto free_card;
> >
> >                /*
> >                 * Only if no error, cache is turned on successfully.
> >                 */
> > -               card->ext_csd.cache_ctrl = err ? 0 : 1;
> > +               if (err) {
> > +                       pr_warning("%s: Cache is supported, but enabling
> failed\n",
> > +                                       mmc_hostname(card->host));
> > +                       err = 0;
> > +               } else
> > +                       card->ext_csd.cache_ctrl = 1;
> >        }
> >
> >        if (!oldcard)
> > --
> > 1.7.0.4
> >
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> > the body of a message to majord...@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> >

--
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 V2 1/2] ARM: EXYNOS4: Add SPI support

2011-10-24 Thread Kukjin Kim

On 10/10/11 11:33, Kukjin Kim wrote:

Padmavathi Venna wrote:


Define SPI platform devices.
Register SPI bus clock with clkdev using generic
connection id.



I can't see your second patch 'SPI: EXYNOS4: Enable the SPI driver for
EXYNOS4'. Probably you think it should be handled by spi side, Grant. Yes
right. But when you submit patch set is related to each subsystem such as
arch/arm/ and drivers/, please adding regarding maintainers on your patch
set. So they can know whether necessity of talking to each other is required
or not if there are dependencies. In this case, I need to know the progress
of driver/spi side.


Signed-off-by: Padmavathi Venna
---
  arch/arm/mach-exynos4/Kconfig|1 +
  arch/arm/mach-exynos4/Makefile   |1 +
  arch/arm/mach-exynos4/clock.c|   82 +---
  arch/arm/mach-exynos4/dev-spi.c  |  225
++
  arch/arm/mach-exynos4/include/mach/irqs.h|3 +
  arch/arm/mach-exynos4/include/mach/map.h |3 +
  arch/arm/mach-exynos4/include/mach/spi-clocks.h  |   16 ++
  arch/arm/plat-samsung/include/plat/devs.h|3 +
  arch/arm/plat-samsung/include/plat/s3c64xx-spi.h |1 +
  9 files changed, 305 insertions(+), 30 deletions(-)
  create mode 100644 arch/arm/mach-exynos4/dev-spi.c
  create mode 100644 arch/arm/mach-exynos4/include/mach/spi-clocks.h

diff --git a/arch/arm/mach-exynos4/Kconfig b/arch/arm/mach-exynos4/Kconfig
index d0491c2..96b2511 100644
--- a/arch/arm/mach-exynos4/Kconfig
+++ b/arch/arm/mach-exynos4/Kconfig
@@ -154,6 +154,7 @@ config MACH_SMDKV310
select EXYNOS4_SETUP_KEYPAD
select EXYNOS4_SETUP_SDHCI
select EXYNOS4_SETUP_USB_PHY
+   select S3C64XX_DEV_SPI


Hmm...if possible, please keep the alphabetical ordering here and I wonder
S3C64XX_DEV_SPI is proper name..


help
  Machine support for Samsung SMDKV310

diff --git a/arch/arm/mach-exynos4/Makefile

b/arch/arm/mach-exynos4/Makefile

index e19cd12..7376869 100644
--- a/arch/arm/mach-exynos4/Makefile
+++ b/arch/arm/mach-exynos4/Makefile
@@ -43,6 +43,7 @@ obj-$(CONFIG_EXYNOS4_DEV_AHCI)+= dev-
ahci.o
  obj-$(CONFIG_EXYNOS4_DEV_PD)  += dev-pd.o
  obj-$(CONFIG_EXYNOS4_DEV_SYSMMU)  += dev-sysmmu.o
  obj-$(CONFIG_EXYNOS4_DEV_DWMCI)   += dev-dwmci.o
+obj-$(CONFIG_S3C64XX_DEV_SPI)  += dev-spi.o

  obj-$(CONFIG_EXYNOS4_SETUP_FIMC)  += setup-fimc.o
  obj-$(CONFIG_EXYNOS4_SETUP_FIMD0) += setup-fimd0.o
diff --git a/arch/arm/mach-exynos4/clock.c b/arch/arm/mach-exynos4/clock.c
index a25c818..2497176 100644
--- a/arch/arm/mach-exynos4/clock.c
+++ b/arch/arm/mach-exynos4/clock.c
@@ -1152,36 +1152,6 @@ static struct clksrc_clk clksrcs[] = {
.reg_div = { .reg = S5P_CLKDIV_LCD0, .shift = 0, .size = 4

},

}, {
.clk= {
-   .name   = "sclk_spi",
-   .devname= "s3c64xx-spi.0",
-   .enable = exynos4_clksrc_mask_peril1_ctrl,
-   .ctrlbit= (1<<  16),
-   },
-   .sources =&clkset_group,
-   .reg_src = { .reg = S5P_CLKSRC_PERIL1, .shift = 16, .size =

4 },

-   .reg_div = { .reg = S5P_CLKDIV_PERIL1, .shift = 0, .size = 4

},

-   }, {
-   .clk= {
-   .name   = "sclk_spi",
-   .devname= "s3c64xx-spi.1",
-   .enable = exynos4_clksrc_mask_peril1_ctrl,
-   .ctrlbit= (1<<  20),
-   },
-   .sources =&clkset_group,
-   .reg_src = { .reg = S5P_CLKSRC_PERIL1, .shift = 20, .size =

4 },

-   .reg_div = { .reg = S5P_CLKDIV_PERIL1, .shift = 16, .size =

4 },

-   }, {
-   .clk= {
-   .name   = "sclk_spi",
-   .devname= "s3c64xx-spi.2",
-   .enable = exynos4_clksrc_mask_peril1_ctrl,
-   .ctrlbit= (1<<  24),
-   },
-   .sources =&clkset_group,
-   .reg_src = { .reg = S5P_CLKSRC_PERIL1, .shift = 24, .size =

4 },

-   .reg_div = { .reg = S5P_CLKDIV_PERIL2, .shift = 0, .size = 4

},

-   }, {
-   .clk= {
.name   = "sclk_fimg2d",
},
.sources =&clkset_mout_g2d,
@@ -1242,6 +1212,53 @@ static struct clksrc_clk clksrcs[] = {
}
  };

+static struct clksrc_clk sclk_spi0 = {
+   .clk= {
+   .name   = "sclk_spi",
+   .devname= "s3c64xx-spi.0",
+   .enable = exynos4_clksrc_mask_peril1_ctrl,
+   .ctrlbit= (1<<  16),
+   },
+   .sources =&clkset_group,
+   .reg_src = { .reg = S

Re: [PATCH V3 0/4]: ARM: SAMSUNG: Add SPI clkdev support

2011-10-24 Thread Kukjin Kim

On 10/10/11 11:42, Kukjin Kim wrote:

Padmavathi Venna wrote:


This patchset modifies the existing clkdev to make SPI driver
independent of the clock names send from platform data. This
patches enables the SPI driver to request SPI bus clocks
using generic connection ID.

V1 patch series are:
http://www.spinics.net/lists/arm-kernel/msg141671.html

Changes since V1:
-Add newly introduced CLKDEV_INIT macro for creating clk_lookup
structure as suggested by Russell King
V2 patches series are:
http://www.spinics.net/lists/arm-kernel/msg142733.html

Changes since V2:
-Reworked the patches as per the following link. Patch series in
the following link removed&  and , from the macro declaration and

added

in the macro defination.
http://www.spinics.net/lists/arm-kernel/msg143663.html

Padmavathi Venna (4):
   ARM: S3C64XX: Add SPI clkdev support
   ARM: S5PC100: Add SPI clkdev support
   ARM: S5P64X0: Add SPI clkdev support
   ARM: S5PV210: Add SPI clkdev support

  arch/arm/mach-s3c64xx/clock.c |   98 
  arch/arm/mach-s5p64x0/clock-s5p6440.c |   57 +-
  arch/arm/mach-s5p64x0/clock-s5p6450.c |   57 +-
  arch/arm/mach-s5pc100/clock.c |  132 
-
  arch/arm/mach-s5pv210/clock.c |   58 ++-
  5 files changed, 259 insertions(+), 143 deletions(-)

--
1.7.4.4

Looks ok but this needs 'CLKDEV_INIT' patch. Please wait until it can be
sent to upstream for this patch.


Padmavathi,

As I said, this looks ok and can be applied now.

Could you please rework this based on my next-samsung-dt branch which 
includes device tree patches so that I can apply this easily for v3.2?


If any problems, please let me know.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim , Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
--
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/3] SDHCI: S3C: Use generic clock names for sdhci bus clock options

2011-10-24 Thread Kukjin Kim

On 10/14/11 12:28, Rajeshwari Shinde wrote:

This patch modifies the driver to stop depending on the clock names
being passed from the platform and switch over to bus clock lookup
using generic clock names.

Signed-off-by: Rajeshwari Shinde
---
  drivers/mmc/host/sdhci-s3c.c |6 ++
  1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
index 82709b6..a5fde87 100644
--- a/drivers/mmc/host/sdhci-s3c.c
+++ b/drivers/mmc/host/sdhci-s3c.c
@@ -435,14 +435,12 @@ static int __devinit sdhci_s3c_probe(struct 
platform_device *pdev)

for (clks = 0, ptr = 0; ptr<  MAX_BUS_CLK; ptr++) {
struct clk *clk;
-   char *name = pdata->clocks[ptr];
+   char name[14];

-   if (name == NULL)
-   continue;
+   sprintf(name, "mmc_busclk.%d", ptr);

clk = clk_get(dev, name);
if (IS_ERR(clk)) {
-   dev_err(dev, "failed to get clock %s\n", name);
continue;
}



Looks ok for me.

Chris, if you're ok on this, could you please add this in your tree for 
this merge window? or if you want, I will apply this to Samsung tree 
with other Rajeshwari's patches. I'm ok either...


Thanks.

Best regards,
Kgene.
--
Kukjin Kim , Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
--
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 0/2] ARM: Samsung: Add basic device tree support for Exynos4 boards

2011-10-24 Thread Kukjin Kim

On 10/11/11 16:13, Thomas Abraham wrote:

This patchset adds a new basic device tree enabled machine/board file which is
based on the Samsung's Exynos4 family of SoC's. Also included in this patchset 
is the
dts file for Exynos4210 SoC, Samsung's SMDKV310 board and Insignal's Origen 
board.

The Exynos4210 dts file includes support for IRQ, GPIO, WDT, RTC, UART, SDHCI, 
Keypad,
DMA and I2C controllers. As device tree coverage for Exynos4210 increases, 
additional
device nodes to represent the controllers should be added.

The device tree enabled machine file enables boot on two boards based on the
Exynos4210 SoC. This provides a starting point to add additional device tree 
support
on these boards, migrate other existing Exynos4 based boards to use device tree
and enable device tree based boot on new upcoming boards.

This patchset has been tested on the following tree:
   https://github.com/kgene/linux-samsung.git   branch: for-next

Thomas Abraham (2):
   ARM: Samsung: Add Exynos4 device tree enabled board file
   ARM: dts: Add intial dts file for Exynos4210 SoC, SMDKV310 and Origen board

  .../devicetree/bindings/arm/insignal-boards.txt|8 +
  .../devicetree/bindings/arm/samsung-boards.txt |8 +
  arch/arm/boot/dts/exynos4210-origen.dts|  137 +++
  arch/arm/boot/dts/exynos4210-smdkv310.dts  |  182 +
  arch/arm/boot/dts/exynos4210.dtsi  |  403 
  arch/arm/mach-exynos4/Kconfig  |   14 +
  arch/arm/mach-exynos4/Makefile |2 +
  arch/arm/mach-exynos4/mach-exynos4-dt.c|   85 
  8 files changed, 839 insertions(+), 0 deletions(-)
  create mode 100644 Documentation/devicetree/bindings/arm/insignal-boards.txt
  create mode 100644 Documentation/devicetree/bindings/arm/samsung-boards.txt
  create mode 100644 arch/arm/boot/dts/exynos4210-origen.dts
  create mode 100644 arch/arm/boot/dts/exynos4210-smdkv310.dts
  create mode 100644 arch/arm/boot/dts/exynos4210.dtsi
  create mode 100644 arch/arm/mach-exynos4/mach-exynos4-dt.c


Applied.
Thanks.

Best regards,
Kgene.
--
Kukjin Kim , Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
--
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 0/2] Add device tree support for Samsung's keypad controller driver

2011-10-24 Thread Kukjin Kim

On 10/11/11 14:09, Kukjin Kim wrote:

Thomas Abraham wrote:


Changes since v4:
- Tested with linux 3.1-rc9. No changes in code.

Changes since v3:
- Addressed comments from Grant Likely.
   - Set num_rows and num_cols to zero in samsung_keypad_parse_dt function.
   - Fixed the wierd looking if-else block in samsung_keypad_probe

function.


Changes since v2:
- Addressed comments from Grant Likely.
   - Renamed 'keypad,key-code' property name to 'linux,code'.
   - Fixed incorrect data types for all instances of of_property+read_u32.
   - linux,input-type binding was not added as suggested since the driver
 supports only EV_KEY event type.

Changes since v1:
- Addressed comments from Dmitry Torokhov.
   - Type of controller is cached in driver's private data and the function
 that determines the type of the controller for each keypad scan is
 removed.
   - pdata allocated during probe is explicitly freed after probe completes
 without any error. In case of exit from probe due a error, no explicit
 deallocation of pdata memory is performed and it is left to devres to
 handle that.
   - The generic code to translate KEY(x,y,code) is retained in the driver
 itself. I am unsure of a right common place for it.
   - Driver continues with the probe even if one or more gpio configuration
 fails.
   - Patch 1 that adds a new config option is still retained in this

patchset.



This patchset adds device tree support for samsung's keypad controller

driver.

First patch adds a new config option to be used by device tree enabled

platforms

for selecting the samsung's keypad controller driver. The second patch

adds

device
tree support for the keypad driver.


Thomas Abraham (2):
   input: samsung-keypad: Add HAVE_SAMSUNG_KEYPAD config option
   input: samsung-keypad: Add device tree support

  .../devicetree/bindings/input/samsung-keypad.txt   |   88 ++
  drivers/input/keyboard/Kconfig |9 +-
  drivers/input/keyboard/samsung-keypad.c|  174
++--
  3 files changed, 258 insertions(+), 13 deletions(-)
  create mode 100644 Documentation/devicetree/bindings/input/samsung-
keypad.txt


Looks ok to me,
Acked-by: Kukjin Kim

Hi Dmitry,
If you're ok on this, please adding this in your tree for upcoming merge
window.


Dmitry,

Any problem on this?

Thanks.

Best regards,
Kgene.
--
Kukjin Kim , Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
--
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] rtc: rtc-s3c: Add device tree support

2011-10-24 Thread Kukjin Kim

On 10/13/11 21:34, Grant Likely wrote:

On Tue, Oct 11, 2011 at 07:48:07PM +0900, Kukjin Kim wrote:

Thomas Abraham wrote:


On 3 September 2011 21:19, Thomas Abraham
wrote:

Add device tree based discovery support for Samsung's rtc controller.

Cc: Ben Dooks
Signed-off-by: Thomas Abraham
---
  Documentation/devicetree/bindings/rtc/s3c-rtc.txt |   20



  drivers/rtc/rtc-s3c.c |   21

-

  2 files changed, 40 insertions(+), 1 deletions(-)
  create mode 100644 Documentation/devicetree/bindings/rtc/s3c-rtc.txt


Ping. Any comments for this patch? If this looks fine, can this be
considered for 3.2 merge via the Samsung kernel tree.


(Cc'ed Alessandro Zummo who is RTC Subsystem maintainer)

I'm ok with this, so if this can be got the ack from Grant and Alessandro,
will take this.


Acked-by: Grant Likely


Hi Alessandro,

Applied this in Samsung tree for supporting device tree for upcoming 3.2 
merge window.


If any problems, please let me know before sending to upstream.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim , Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
--
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 v2 9/9] serial: samsung: add device tree support

2011-10-24 Thread Grant Likely
On Mon, Oct 10, 2011 at 03:38:05PM +0530, Thomas Abraham wrote:
> Add device tree based discovery support for Samsung's uart controller.
> 
> Cc: Ben Dooks 
> Cc: Grant Likely 
> Signed-off-by: Thomas Abraham 

Acked-by: Grant Likely 

> ---
>  .../devicetree/bindings/serial/samsung_uart.txt|   14 
>  drivers/tty/serial/samsung.c   |   36 ++-
>  2 files changed, 48 insertions(+), 2 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/serial/samsung_uart.txt
> 
> diff --git a/Documentation/devicetree/bindings/serial/samsung_uart.txt 
> b/Documentation/devicetree/bindings/serial/samsung_uart.txt
> new file mode 100644
> index 000..2c8a17c
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/serial/samsung_uart.txt
> @@ -0,0 +1,14 @@
> +* Samsung's UART Controller
> +
> +The Samsung's UART controller is used for interfacing SoC with serial 
> communicaion
> +devices.
> +
> +Required properties:
> +- compatible: should be
> +  - "samsung,exynos4210-uart", for UART's compatible with Exynos4210 uart 
> ports.
> +
> +- reg: base physical address of the controller and length of memory mapped
> +  region.
> +
> +- interrupts: interrupt number to the cpu. The interrupt specifier format 
> depends
> +  on the interrupt controller parent.
> diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
> index c89987b..efe3756 100644
> --- a/drivers/tty/serial/samsung.c
> +++ b/drivers/tty/serial/samsung.c
> @@ -42,6 +42,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  
>  #include 
>  
> @@ -1163,10 +1164,26 @@ static ssize_t s3c24xx_serial_show_clksrc(struct 
> device *dev,
>  
>  static DEVICE_ATTR(clock_source, S_IRUGO, s3c24xx_serial_show_clksrc, NULL);
>  
> +
>  /* Device driver serial port probe */
>  
> +static const struct of_device_id s3c24xx_uart_dt_match[];
>  static int probe_index;
>  
> +static inline struct s3c24xx_serial_drv_data *s3c24xx_get_driver_data(
> + struct platform_device *pdev)
> +{
> +#ifdef CONFIG_OF
> + if (pdev->dev.of_node) {
> + const struct of_device_id *match;
> + match = of_match_node(s3c24xx_uart_dt_match, pdev->dev.of_node);
> + return (struct s3c24xx_serial_drv_data *)match->data;
> + }
> +#endif
> + return (struct s3c24xx_serial_drv_data *)
> + platform_get_device_id(pdev)->driver_data;
> +}
> +
>  static int s3c24xx_serial_probe(struct platform_device *pdev)
>  {
>   struct s3c24xx_uart_port *ourport;
> @@ -1176,8 +1193,11 @@ static int s3c24xx_serial_probe(struct platform_device 
> *pdev)
>  
>   ourport = &s3c24xx_serial_ports[probe_index];
>  
> - ourport->drv_data = (struct s3c24xx_serial_drv_data *)
> - platform_get_device_id(pdev)->driver_data;
> + ourport->drv_data = s3c24xx_get_driver_data(pdev);
> + if (!ourport->drv_data) {
> + dev_err(&pdev->dev, "could not find driver data\n");
> + return -ENODEV;
> + }
>  
>   ourport->info = ourport->drv_data->info;
>   ourport->cfg = (pdev->dev.platform_data) ?
> @@ -1626,6 +1646,17 @@ static struct platform_device_id 
> s3c24xx_serial_driver_ids[] = {
>  };
>  MODULE_DEVICE_TABLE(platform, s3c24xx_serial_driver_ids);
>  
> +#ifdef CONFIG_OF
> +static const struct of_device_id s3c24xx_uart_dt_match[] = {
> + { .compatible = "samsung,exynos4210-uart",
> + .data = &exynos4210_serial_drv_data },
> + {},
> +};
> +MODULE_DEVICE_TABLE(of, s3c24xx_uart_dt_match);
> +#else
> +#define s3c24xx_uart_dt_match NULL
> +#endif
> +
>  static struct platform_driver samsung_serial_driver = {
>   .probe  = s3c24xx_serial_probe,
>   .remove = __devexit_p(s3c24xx_serial_remove),
> @@ -1634,6 +1665,7 @@ static struct platform_driver samsung_serial_driver = {
>   .name   = "samsung-uart",
>   .owner  = THIS_MODULE,
>   .pm = SERIAL_SAMSUNG_PM_OPS,
> + .of_match_table = s3c24xx_uart_dt_match,
>   },
>  };
>  
> -- 
> 1.6.6.rc2
> 
--
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 v2 4/9] serial: samsung: remove struct 's3c24xx_uart_clksrc' and all uses of it

2011-10-24 Thread Grant Likely
On Mon, Oct 10, 2011 at 03:38:00PM +0530, Thomas Abraham wrote:
> With clkdev based clock lookup added to samsung serial driver, the use
> of 'struct s3c24xx_uart_clksrc' to supply clock names in platform
> data is removed from all the Samsung platform code.
> 
> Cc: Ben Dooks 
> Cc: Ramax Lo 
> Cc: Vasily Khoruzhick 
> Signed-off-by: Thomas Abraham 
> ---
>  arch/arm/mach-exynos4/init.c |   15 +--
>  arch/arm/mach-s3c2410/mach-bast.c|   22 ---
>  arch/arm/mach-s3c2410/mach-vr1000.c  |   24 -
>  arch/arm/mach-s3c2440/mach-anubis.c  |   22 +--
>  arch/arm/mach-s3c2440/mach-at2440evb.c   |   22 +--
>  arch/arm/mach-s3c2440/mach-osiris.c  |   24 ++---
>  arch/arm/mach-s3c2440/mach-rx1950.c  |   18 ++--
>  arch/arm/mach-s3c2440/mach-rx3715.c  |   19 ++---
>  arch/arm/mach-s5p64x0/init.c |   31 
> --
>  arch/arm/mach-s5pv210/init.c |   19 -
>  arch/arm/plat-samsung/include/plat/regs-serial.h |   23 
>  drivers/tty/serial/samsung.h |1 -
>  12 files changed, 14 insertions(+), 226 deletions(-)

Nice diffstat.  :-)

g.

--
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] mmc: core: Assemble the codes of related to eMMC4.5

2011-10-24 Thread Girish K S
On 24 October 2011 16:39, Chris Ball  wrote:
> Hi Seungwon,
>
> On Mon, Oct 24 2011, Seungwon Jeon wrote:
>> Code cleanup. The codes of related to eMMC4.5 are scattered.
>> This patch removes a duplicate if-statement and assembles all.
>>
>> Signed-off-by: Seungwon Jeon 
>> ---
>>  drivers/mmc/core/mmc.c |   20 +---
>>  1 files changed, 9 insertions(+), 11 deletions(-)
>>
>> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
>> index fb5bf01..3627044 100644
>> --- a/drivers/mmc/core/mmc.c
>> +++ b/drivers/mmc/core/mmc.c
>> @@ -467,29 +467,27 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 
>> *ext_csd)
>>               card->ext_csd.rst_n_function = ext_csd[EXT_CSD_RST_N_FUNCTION];
>>       }
>>
>> -     /* eMMC v4.5 or later */
>> -     if (card->ext_csd.rev >= 6)
>> -             card->ext_csd.feature_support |= MMC_DISCARD_FEATURE;
>> -
>>       card->ext_csd.raw_erased_mem_count = ext_csd[EXT_CSD_ERASED_MEM_CONT];
>>       if (ext_csd[EXT_CSD_ERASED_MEM_CONT])
>>               card->erased_byte = 0xFF;
>>       else
>>               card->erased_byte = 0x0;
>>
>> +     /* eMMC v4.5 or later */
>>       if (card->ext_csd.rev >= 6) {
>> +             card->ext_csd.feature_support |= MMC_DISCARD_FEATURE;
>> +
>>               card->ext_csd.generic_cmd6_time = 10 *
>>                       ext_csd[EXT_CSD_GENERIC_CMD6_TIME];
>>               card->ext_csd.power_off_longtime = 10 *
>>                       ext_csd[EXT_CSD_POWER_OFF_LONG_TIME];
>> -     } else
>> -             card->ext_csd.generic_cmd6_time = 0;
>
> Your patch removes this line completely.  Why is that?  You should
> explain it in the commit message.
By tracing the code what i understand is  mmc_read_ext_csd is called
from mmc_card_init. In the init function the card instance is created.
When the card instance is created kzalloc is used. This will
initialize all the card structure members to 0.
So the deleted line is implicit.
>
>>
>> -     card->ext_csd.cache_size =
>> -             ext_csd[EXT_CSD_CACHE_SIZE + 0] << 0 |
>> -             ext_csd[EXT_CSD_CACHE_SIZE + 1] << 8 |
>> -             ext_csd[EXT_CSD_CACHE_SIZE + 2] << 16 |
>> -             ext_csd[EXT_CSD_CACHE_SIZE + 3] << 24;
>> +             card->ext_csd.cache_size =
>> +                     ext_csd[EXT_CSD_CACHE_SIZE + 0] << 0 |
>> +                     ext_csd[EXT_CSD_CACHE_SIZE + 1] << 8 |
>> +                     ext_csd[EXT_CSD_CACHE_SIZE + 2] << 16 |
>> +                     ext_csd[EXT_CSD_CACHE_SIZE + 3] << 24;
>> +     }
>>
>>  out:
>>       return err;
>
> The rest looks good, thanks,
>
> - Chris.
> --
> Chris Ball      
> One Laptop Per Child
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
--
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] mmc: core: Assemble the codes of related to eMMC4.5

2011-10-24 Thread Chris Ball
Hi Seungwon,

On Mon, Oct 24 2011, Seungwon Jeon wrote:
> Code cleanup. The codes of related to eMMC4.5 are scattered.
> This patch removes a duplicate if-statement and assembles all.
>
> Signed-off-by: Seungwon Jeon 
> ---
>  drivers/mmc/core/mmc.c |   20 +---
>  1 files changed, 9 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
> index fb5bf01..3627044 100644
> --- a/drivers/mmc/core/mmc.c
> +++ b/drivers/mmc/core/mmc.c
> @@ -467,29 +467,27 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 
> *ext_csd)
>   card->ext_csd.rst_n_function = ext_csd[EXT_CSD_RST_N_FUNCTION];
>   }
>
> - /* eMMC v4.5 or later */
> - if (card->ext_csd.rev >= 6)
> - card->ext_csd.feature_support |= MMC_DISCARD_FEATURE;
> -
>   card->ext_csd.raw_erased_mem_count = ext_csd[EXT_CSD_ERASED_MEM_CONT];
>   if (ext_csd[EXT_CSD_ERASED_MEM_CONT])
>   card->erased_byte = 0xFF;
>   else
>   card->erased_byte = 0x0;
>
> + /* eMMC v4.5 or later */
>   if (card->ext_csd.rev >= 6) {
> + card->ext_csd.feature_support |= MMC_DISCARD_FEATURE;
> +
>   card->ext_csd.generic_cmd6_time = 10 *
>   ext_csd[EXT_CSD_GENERIC_CMD6_TIME];
>   card->ext_csd.power_off_longtime = 10 *
>   ext_csd[EXT_CSD_POWER_OFF_LONG_TIME];
> - } else
> - card->ext_csd.generic_cmd6_time = 0;

Your patch removes this line completely.  Why is that?  You should
explain it in the commit message.

>
> - card->ext_csd.cache_size =
> - ext_csd[EXT_CSD_CACHE_SIZE + 0] << 0 |
> - ext_csd[EXT_CSD_CACHE_SIZE + 1] << 8 |
> - ext_csd[EXT_CSD_CACHE_SIZE + 2] << 16 |
> - ext_csd[EXT_CSD_CACHE_SIZE + 3] << 24;
> + card->ext_csd.cache_size =
> + ext_csd[EXT_CSD_CACHE_SIZE + 0] << 0 |
> + ext_csd[EXT_CSD_CACHE_SIZE + 1] << 8 |
> + ext_csd[EXT_CSD_CACHE_SIZE + 2] << 16 |
> + ext_csd[EXT_CSD_CACHE_SIZE + 3] << 24;
> + }
>
>  out:
>   return err;

The rest looks good, thanks,

- Chris.
-- 
Chris Ball  
One Laptop Per Child
--
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] mmc: core: Separate the timeout value for cache-ctrl

2011-10-24 Thread Girish K S
On 24 October 2011 15:40, Seungwon Jeon  wrote:
> Turning the cache off implies flushing cache which doesn't define
> maximum timeout unlike cache-on. This patch will apply the generic
> CMD6 timeout only for cache-on. Additionally the kernel message is
> added for checking failure case of cache-on.
>
> Signed-off-by: Seungwon Jeon 
> ---
>  drivers/mmc/core/core.c |   22 +-
>  drivers/mmc/core/mmc.c  |   10 --
>  2 files changed, 21 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> index 5278ffb..65b5643 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
> @@ -2248,6 +2248,7 @@ EXPORT_SYMBOL(mmc_flush_cache);
>  int mmc_cache_ctrl(struct mmc_host *host, u8 enable)
>  {
>        struct mmc_card *card = host->card;
> +       unsigned int timeout;
>        int err = 0;
>
>        if (!(host->caps2 & MMC_CAP2_CACHE_CTRL) ||
> @@ -2258,16 +2259,19 @@ int mmc_cache_ctrl(struct mmc_host *host, u8 enable)
>                        (card->ext_csd.cache_size > 0)) {
>                enable = !!enable;
>
> -               if (card->ext_csd.cache_ctrl ^ enable)
> +               if (card->ext_csd.cache_ctrl ^ enable) {
> +                       timeout = enable ? card->ext_csd.generic_cmd6_time : 
> 0;
>                        err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
> -                                       EXT_CSD_CACHE_CTRL, enable, 0);
Here timeout value used is 0. If it has to be 0 then why should you check
timeout = enable ? card->ext_csd.generic_cmd6_time : 0;
I think it should be card->ext_csd.generic_cmd6_time instead of 0
> -               if (err)
> -                       pr_err("%s: cache %s error %d\n",
> -                                       mmc_hostname(card->host),
> -                                       enable ? "on" : "off",
> -                                       err);
> -               else
> -                       card->ext_csd.cache_ctrl = enable;
> +                                       EXT_CSD_CACHE_CTRL, enable, timeout);
> +
> +                       if (err)
> +                               pr_err("%s: cache %s error %d\n",
> +                                               mmc_hostname(card->host),
> +                                               enable ? "on" : "off",
> +                                               err);
> +                       else
> +                               card->ext_csd.cache_ctrl = enable;
> +               }
>        }
>
>        return err;
> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
> index fb5bf01..6354eb3 100644
> --- a/drivers/mmc/core/mmc.c
> +++ b/drivers/mmc/core/mmc.c
> @@ -1064,14 +1064,20 @@ static int mmc_init_card(struct mmc_host *host, u32 
> ocr,
>        if ((host->caps2 & MMC_CAP2_CACHE_CTRL) &&
>                        card->ext_csd.cache_size > 0) {
>                err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
> -                               EXT_CSD_CACHE_CTRL, 1, 0);
> +                               EXT_CSD_CACHE_CTRL, 1,
> +                               card->ext_csd.generic_cmd6_time);
>                if (err && err != -EBADMSG)
>                        goto free_card;
>
>                /*
>                 * Only if no error, cache is turned on successfully.
>                 */
> -               card->ext_csd.cache_ctrl = err ? 0 : 1;
> +               if (err) {
> +                       pr_warning("%s: Cache is supported, but enabling 
> failed\n",
> +                                       mmc_hostname(card->host));
> +                       err = 0;
> +               } else
> +                       card->ext_csd.cache_ctrl = 1;
>        }
>
>        if (!oldcard)
> --
> 1.7.0.4
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
--
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: core: Assemble the codes of related to eMMC4.5

2011-10-24 Thread Seungwon Jeon
Code cleanup. The codes of related to eMMC4.5 are scattered.
This patch removes a duplicate if-statement and assembles all.

Signed-off-by: Seungwon Jeon 
---
 drivers/mmc/core/mmc.c |   20 +---
 1 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index fb5bf01..3627044 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -467,29 +467,27 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 
*ext_csd)
card->ext_csd.rst_n_function = ext_csd[EXT_CSD_RST_N_FUNCTION];
}

-   /* eMMC v4.5 or later */
-   if (card->ext_csd.rev >= 6)
-   card->ext_csd.feature_support |= MMC_DISCARD_FEATURE;
-
card->ext_csd.raw_erased_mem_count = ext_csd[EXT_CSD_ERASED_MEM_CONT];
if (ext_csd[EXT_CSD_ERASED_MEM_CONT])
card->erased_byte = 0xFF;
else
card->erased_byte = 0x0;

+   /* eMMC v4.5 or later */
if (card->ext_csd.rev >= 6) {
+   card->ext_csd.feature_support |= MMC_DISCARD_FEATURE;
+
card->ext_csd.generic_cmd6_time = 10 *
ext_csd[EXT_CSD_GENERIC_CMD6_TIME];
card->ext_csd.power_off_longtime = 10 *
ext_csd[EXT_CSD_POWER_OFF_LONG_TIME];
-   } else
-   card->ext_csd.generic_cmd6_time = 0;

-   card->ext_csd.cache_size =
-   ext_csd[EXT_CSD_CACHE_SIZE + 0] << 0 |
-   ext_csd[EXT_CSD_CACHE_SIZE + 1] << 8 |
-   ext_csd[EXT_CSD_CACHE_SIZE + 2] << 16 |
-   ext_csd[EXT_CSD_CACHE_SIZE + 3] << 24;
+   card->ext_csd.cache_size =
+   ext_csd[EXT_CSD_CACHE_SIZE + 0] << 0 |
+   ext_csd[EXT_CSD_CACHE_SIZE + 1] << 8 |
+   ext_csd[EXT_CSD_CACHE_SIZE + 2] << 16 |
+   ext_csd[EXT_CSD_CACHE_SIZE + 3] << 24;
+   }

 out:
return err;
--
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] mmc: core: Separate the timeout value for cache-ctrl

2011-10-24 Thread Seungwon Jeon
Turning the cache off implies flushing cache which doesn't define
maximum timeout unlike cache-on. This patch will apply the generic
CMD6 timeout only for cache-on. Additionally the kernel message is
added for checking failure case of cache-on.

Signed-off-by: Seungwon Jeon 
---
 drivers/mmc/core/core.c |   22 +-
 drivers/mmc/core/mmc.c  |   10 --
 2 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 5278ffb..65b5643 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -2248,6 +2248,7 @@ EXPORT_SYMBOL(mmc_flush_cache);
 int mmc_cache_ctrl(struct mmc_host *host, u8 enable)
 {
struct mmc_card *card = host->card;
+   unsigned int timeout;
int err = 0;

if (!(host->caps2 & MMC_CAP2_CACHE_CTRL) ||
@@ -2258,16 +2259,19 @@ int mmc_cache_ctrl(struct mmc_host *host, u8 enable)
(card->ext_csd.cache_size > 0)) {
enable = !!enable;

-   if (card->ext_csd.cache_ctrl ^ enable)
+   if (card->ext_csd.cache_ctrl ^ enable) {
+   timeout = enable ? card->ext_csd.generic_cmd6_time : 0;
err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
-   EXT_CSD_CACHE_CTRL, enable, 0);
-   if (err)
-   pr_err("%s: cache %s error %d\n",
-   mmc_hostname(card->host),
-   enable ? "on" : "off",
-   err);
-   else
-   card->ext_csd.cache_ctrl = enable;
+   EXT_CSD_CACHE_CTRL, enable, timeout);
+
+   if (err)
+   pr_err("%s: cache %s error %d\n",
+   mmc_hostname(card->host),
+   enable ? "on" : "off",
+   err);
+   else
+   card->ext_csd.cache_ctrl = enable;
+   }
}

return err;
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index fb5bf01..6354eb3 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -1064,14 +1064,20 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
if ((host->caps2 & MMC_CAP2_CACHE_CTRL) &&
card->ext_csd.cache_size > 0) {
err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
-   EXT_CSD_CACHE_CTRL, 1, 0);
+   EXT_CSD_CACHE_CTRL, 1,
+   card->ext_csd.generic_cmd6_time);
if (err && err != -EBADMSG)
goto free_card;

/*
 * Only if no error, cache is turned on successfully.
 */
-   card->ext_csd.cache_ctrl = err ? 0 : 1;
+   if (err) {
+   pr_warning("%s: Cache is supported, but enabling 
failed\n",
+   mmc_hostname(card->host));
+   err = 0;
+   } else
+   card->ext_csd.cache_ctrl = 1;
}

if (!oldcard)
--
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


Re: [PATCH v2 0/9] serial: samsung: rework clock lookup and add device tree support

2011-10-24 Thread Greg KH
On Mon, Oct 24, 2011 at 10:27:47AM +0200, Kukjin Kim wrote:
> On 10/10/11 12:07, Thomas Abraham wrote:
> >Changes since v1:
> >- Included the missing dt bindings documentation in the last patch.
> >- Rebased and tested with linux 3.1-rc9 on linux-samsung-soc tree.
> >- Commit messages are modified to be elaborate.
> >- No changes in code.
> >
> >
> >This patchset reworks the lookup of parent clocks for baud rate generator in
> >the uart controller and adds support for device tree based discovery for the
> >uart controller.
> >
> >The Samsung uart driver was dependent on the clock names supplied in the
> >platform data. This dependency had to be first removed to add device tree 
> >based
> >discovery support for Samsung uart driver. In the process of reworking the 
> >clock
> >lookup logic, several changes had to be made which in turn made parts of the
> >driver redundant and such portions of the driver have been removed in this
> >patchset. As a result, all the SoC specific extensions have been deleted.
> >
> >Patch 1 modifies the driver to keep a copy of the location of the platform 
> >data
> >in the driver's private data. This makes device tree support addition
> >non-intrusive.
> >
> >Patch 2 moves the complicated clock divider handling for fclk source clock 
> >for
> >s3c2440 SoC into platform code. The fclk clock can be easily managed by
> >representing it as a clock in the platform code. fclk clock handling was
> >specific to s3c2440 and moving this out of the driver makes the rest of the
> >clock handling in the driver almost identical for all SoC's supported by the
> >driver.
> >
> >Patch 3 modifies the driver to lookup source clocks for baud rate generator
> >by using generic clock names. The generic clock name used by the driver is
> >'clk_uart_baud' appended with the parent number of the clock. For instance,
> >the second parent clock source option for baud rate generator is named as
> >'clk_uart_baud2'.
> >
> >The driver stops depending on the set_clock and get_clock callbacks in the
> >SoC specific extensions. Instead, the driver is modified to lookup parent
> >clock rates and decide/calculate the best parent clock source for the baud
> >rate generator (best clock would have the least delta when compared to buad
> >rate requested).
> >
> >In this process, four new members are added in the driver's private data
> >structure. The 'def_clk_sel' member is a platform set bit-value that 
> >specifies
> >the possible parents that the driver is allowed to use for baud rate clock.
> >A bit set at a particular bit position selects that parent clock source.
> >Example: If bit number 2 is set in 'def_clk_sel', then parent clock source 
> >'2'
> >can be a possible parent clock for baud rate generator. The 'num_clks'
> >is the number of possible parent clocks that the SoC supports. The
> >'clksel_mask' and 'clksel_shift' members are used to operate on the parent 
> >clock
> >selection bit field int the uart controller's contol register.
> >
> >Patch 4 removes all uses and instances of 'struct s3c24xx_uart_clksrc'. This
> >structure was used to pass source clock 'names' between platform code, driver
> >and SoC specific extensions. By moving away from using platform specified 
> >clock
> >names in the driver, all uses and instances of 'struct s3c24xx_uart_clksrc'
> >is removed.
> >
> >Patch 5 removes all the SoC specific get_clksrc and set_clksrc callbacks. 
> >These
> >callbacks were using SoC specific clock names to communicate the clock to be
> >set or retrieved. These callbacks are removed as they are no longer required.
> >
> >Patch 6 reworks the uart clocks in platform code of all Samsung SoC's. The
> >driver would use generic clock names and this patch creates aliases to uart
> >clocks with generic clock names as the alias name.
> >
> >Patch 7 merges all the SoC specific port reset functions into one common port
> >reset function and moves the common function into the common Samsung uart
> >driver. All the SoC specific port reset functions perform the same operation
> >allowing all of them to be converged.
> >
> >Patch 8 collapses all the SoC specific probe functions and associated driver
> >private data into the Samsung common uart driver. With get_clksrc, set_clksrc
> >and reset_port functions removed from SoC specific extensions, all the 
> >remains
> >in those extensions is the probe function along with SoC specific driver 
> >data.
> >These are merged into the common Samsung uart driver and all the SoC specific
> >extensions are deleted.
> >
> >Patch 9 adds device tree based discovery support for the uart driver.
> >
> >
> >This patchset is based on the following tree
> >https://github.com/kgene/linux-samsung.git  branch: for-next
> >
> >with the following two patches applied
> >[PATCH] serial: samsung: Add unified interrupt handler for s3c64xx and later 
> >SoC's
> >[PATCH] ARM: SAMSUNG: Remove uart irq handling from plaform code
> >
> >and tested on the following boards.
> >SMDK2440, SMDK2416, 

Re: [PATCH v2 0/9] serial: samsung: rework clock lookup and add device tree support

2011-10-24 Thread Kukjin Kim

On 10/10/11 12:07, Thomas Abraham wrote:

Changes since v1:
- Included the missing dt bindings documentation in the last patch.
- Rebased and tested with linux 3.1-rc9 on linux-samsung-soc tree.
- Commit messages are modified to be elaborate.
- No changes in code.


This patchset reworks the lookup of parent clocks for baud rate generator in
the uart controller and adds support for device tree based discovery for the
uart controller.

The Samsung uart driver was dependent on the clock names supplied in the
platform data. This dependency had to be first removed to add device tree based
discovery support for Samsung uart driver. In the process of reworking the clock
lookup logic, several changes had to be made which in turn made parts of the
driver redundant and such portions of the driver have been removed in this
patchset. As a result, all the SoC specific extensions have been deleted.

Patch 1 modifies the driver to keep a copy of the location of the platform data
in the driver's private data. This makes device tree support addition
non-intrusive.

Patch 2 moves the complicated clock divider handling for fclk source clock for
s3c2440 SoC into platform code. The fclk clock can be easily managed by
representing it as a clock in the platform code. fclk clock handling was
specific to s3c2440 and moving this out of the driver makes the rest of the
clock handling in the driver almost identical for all SoC's supported by the
driver.

Patch 3 modifies the driver to lookup source clocks for baud rate generator
by using generic clock names. The generic clock name used by the driver is
'clk_uart_baud' appended with the parent number of the clock. For instance,
the second parent clock source option for baud rate generator is named as
'clk_uart_baud2'.

The driver stops depending on the set_clock and get_clock callbacks in the
SoC specific extensions. Instead, the driver is modified to lookup parent
clock rates and decide/calculate the best parent clock source for the baud
rate generator (best clock would have the least delta when compared to buad
rate requested).

In this process, four new members are added in the driver's private data
structure. The 'def_clk_sel' member is a platform set bit-value that specifies
the possible parents that the driver is allowed to use for baud rate clock.
A bit set at a particular bit position selects that parent clock source.
Example: If bit number 2 is set in 'def_clk_sel', then parent clock source '2'
can be a possible parent clock for baud rate generator. The 'num_clks'
is the number of possible parent clocks that the SoC supports. The
'clksel_mask' and 'clksel_shift' members are used to operate on the parent clock
selection bit field int the uart controller's contol register.

Patch 4 removes all uses and instances of 'struct s3c24xx_uart_clksrc'. This
structure was used to pass source clock 'names' between platform code, driver
and SoC specific extensions. By moving away from using platform specified clock
names in the driver, all uses and instances of 'struct s3c24xx_uart_clksrc'
is removed.

Patch 5 removes all the SoC specific get_clksrc and set_clksrc callbacks. These
callbacks were using SoC specific clock names to communicate the clock to be
set or retrieved. These callbacks are removed as they are no longer required.

Patch 6 reworks the uart clocks in platform code of all Samsung SoC's. The
driver would use generic clock names and this patch creates aliases to uart
clocks with generic clock names as the alias name.

Patch 7 merges all the SoC specific port reset functions into one common port
reset function and moves the common function into the common Samsung uart
driver. All the SoC specific port reset functions perform the same operation
allowing all of them to be converged.

Patch 8 collapses all the SoC specific probe functions and associated driver
private data into the Samsung common uart driver. With get_clksrc, set_clksrc
and reset_port functions removed from SoC specific extensions, all the remains
in those extensions is the probe function along with SoC specific driver data.
These are merged into the common Samsung uart driver and all the SoC specific
extensions are deleted.

Patch 9 adds device tree based discovery support for the uart driver.


This patchset is based on the following tree
https://github.com/kgene/linux-samsung.git  branch: for-next

with the following two patches applied
[PATCH] serial: samsung: Add unified interrupt handler for s3c64xx and later 
SoC's
[PATCH] ARM: SAMSUNG: Remove uart irq handling from plaform code

and tested on the following boards.
SMDK2440, SMDK2416, SMDK6410, SMDK6440, SMDK6450, SMDKC100, SMDKV210, SMDKV310.

This patchset has dependency on the following patchset:
[PATCH V2 0/2] Add a common macro for creating struct clk_lookup entries


Thomas Abraham (9):
   serial: samsung: Keep a copy of the location of platform data in driver's 
private data
   serial: samsung: move handling of fclk/n clock to platform code
   s

Re: [PATCH 1/3] ARM: Samsung: Move timer irq numbers to end of linux irq space

2011-10-24 Thread Kukjin Kim


On 10/21/11 21:45, Grant Likely wrote:

On Fri, Oct 21, 2011 at 06:56:52PM +0900, Kukjin Kim wrote:

Changhwan Youn wrote:


Hi Thomas,

All UART_IRQ_RXD, TXD, ERR of Samsung's platforms are also statically
mapped to linux irq numbers 16 to 31. These interrupts also need proper

handling.


Best regards,
Changhwan Youn



Hi all,

Hmm, I'd like to apply Thomas' device tree series for EXYNOS4 and Samsung
stuff for upcoming merge window but there are still some comments on some
stuff and that should be fixed before applying. In addition I need to keep
the ordering to apply them to avoid conflicts. But as you know, v3.1 is now
close at hand and we don't have enough time for it now :(

I will leave tomorrow morning (KST) for KS. I will talk to Grant Likely
about this in Prague :)


One of the goals I have for the hacking summit is to get as much of
the outstanding DT patches queued up and into linux-next.


OK.

I talked to Grant at ARM Subarch Workshop.

I will apply Thomas' DT patches into Samsung tree and it will be sent to 
upstream via arm-soc for upcoming merge window v3.2 and if any fixing is 
required, we will do it during -rc.


Thomas, if any problems during apply, let you know.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim , Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
--
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