Re: [PATCH V4 0/5] Add generic DMA DT binding support

2013-02-14 Thread Vinod Koul
On Thu, Feb 14, 2013 at 11:12:51AM +0530, Padma Venkat wrote:
 Hi Vinod,
 
 On Thu, Feb 14, 2013 at 10:17 AM, Vinod Koul vinod.k...@intel.com wrote:
  On Wed, Feb 13, 2013 at 09:52:30AM +0530, Padma Venkat wrote:
  Hi Vinod,
 
  On Tue, Feb 12, 2013 at 8:19 PM, Vinod Koul vinod.k...@intel.com wrote:
   On Mon, Feb 11, 2013 at 02:08:20PM +0530, Padmavathi Venna wrote:
  
   This looks fine, I have only question. The code seems to assume that 
   pl330 dma
   controller always uses DT. But I dont see that as dependency for pl330.
  Have you checked this?
 
 Sorry I didn't see this comment previously. I verified on SMDK6410
 board which doesn't have DT support.
 I didn't see any build error and it detected the sound card.
Okay, sound good...

I will try the series now.

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


Re: [PATCH V6 02/10] ASoC: SAMSUNG: Add DT support for i2s

2013-02-14 Thread Sylwester Nawrocki
Hi,

On 01/18/2013 12:47 PM, Padmavathi Venna wrote:
 Add support for device based discovery.
 
 Signed-off-by: Padmavathi Venna padm...@samsung.com
 ---
  .../devicetree/bindings/sound/samsung-i2s.txt  |   63 ++
  sound/soc/samsung/dma.c|3 +-
  sound/soc/samsung/dma.h|1 +
  sound/soc/samsung/i2s.c|  209 
 +++-
  4 files changed, 230 insertions(+), 46 deletions(-)
  create mode 100644 Documentation/devicetree/bindings/sound/samsung-i2s.txt
 
 diff --git a/Documentation/devicetree/bindings/sound/samsung-i2s.txt 
 b/Documentation/devicetree/bindings/sound/samsung-i2s.txt
 new file mode 100644
 index 000..3070046
 --- /dev/null
 +++ b/Documentation/devicetree/bindings/sound/samsung-i2s.txt
 @@ -0,0 +1,63 @@
 +* Samsung I2S controller
 +
...
 +Required Board Specific Properties:
 +
 +- gpios: The gpio specifier for data out,data in, LRCLK, CDCLK and SCLK
 +  interface lines. The format of the gpio specifier depends on the gpio
 +  controller.
 +  The syntax of samsung gpio specifier is
 + [phandle of the gpio controller node]
 +  [pin number within the gpio controller]
 +  [mux function]
 +  [flags and pull up/down]
 +  [drive strength]

I don't think there is a need to copy the gpio specifier documentation
over to this file. Moreover this gpio specifier was supposed to be temporary,
until pinctrl support is added. Now Exynos4 uses generic gpio specifiers
and pinctrl for pin muxing and Exynos5 is still not converted to that,
although I believe this wouldn't require much effort now.

 +Example:
 +
...
 +- Board Specific Portion:
 +
 +i2s@0383 {
 + gpios = gpz 0 2 0 0, /* I2S_0_SCLK */
 + gpz 1 2 0 0, /* I2S_0_CDCLK */
 + gpz 2 2 0 0, /* I2S_0_LRCK */
 + gpz 3 2 0 0, /* I2S_0_SDI */
 + gpz 4 2 0 0, /* I2S_0_SDO[1] */
 + gpz 5 2 0 0, /* I2S_0_SDO[2] */
 + gpz 6 2 0 0; /* I2S_0_SDO[3] */
 +};

We should switch to pinctrl instead. Most of work now seems to be
to define pinctrl nodes for each Exynos5 device, so there is proper
pinctrl support for Exynos5.

--

Thanks,
Sylwester

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


Re: [PATCH V6 02/10] ASoC: SAMSUNG: Add DT support for i2s

2013-02-14 Thread Sylwester Nawrocki
On 01/18/2013 12:47 PM, Padmavathi Venna wrote:
 Add support for device based discovery.
 
 Signed-off-by: Padmavathi Venna padm...@samsung.com
 ---
...
  /* Lock for cross i/f checks */
 @@ -997,19 +1006,76 @@ static struct i2s_dai *i2s_alloc_dai(struct 
 platform_device *pdev, bool sec)
   return i2s;
  }
  
 +#ifdef CONFIG_OF
 +static int samsung_i2s_parse_dt_gpio(struct i2s_dai *i2s)
 +{
 + struct device *dev = i2s-pdev-dev;
 + int index, gpio, ret;
 +
 + for (index = 0; index  7; index++) {
 + gpio = of_get_gpio(dev-of_node, index);
 + if (!gpio_is_valid(gpio)) {
 + dev_err(dev, invalid gpio[%d]: %d\n, index, gpio);
 + goto free_gpio;
 + }
 +
 + ret = gpio_request(gpio, dev_name(dev));
 + if (ret) {
 + dev_err(dev, gpio [%d] request failed\n, gpio);
 + goto free_gpio;
 + }
 + i2s-gpios[index] = gpio;
 + }
 + return 0;
 +
 +free_gpio:
 + while (--index = 0)
 + gpio_free(i2s-gpios[index]);
 + return -EINVAL;
 +}
 +
 +static void samsung_i2s_dt_gpio_free(struct i2s_dai *i2s)
 +{
 + unsigned int index;
 + for (index = 0; index  7; index++)
 + gpio_free(i2s-gpios[index]);
 +}
 +#else
 +static int samsung_i2s_parse_dt_gpio(struct i2s_dai *dai)
 +{
 + return -EINVAL;
 +}
 +
 +static void samsung_i2s_dt_gpio_free(struct i2s_dai *dai)
 +{
 +}
 +
 +#endif

NAK.

Why we should leave with this temporary code when there is already
pinctrl support for Exynos SoCs ?

If the pinctrl driver for Exynos5 was updated you could instead just do

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


Re: [PATCH V6 02/10] ASoC: SAMSUNG: Add DT support for i2s

2013-02-14 Thread Tomasz Figa
Hi,

On Thursday 14 of February 2013 11:48:59 Sylwester Nawrocki wrote:
 On 01/18/2013 12:47 PM, Padmavathi Venna wrote:
  Add support for device based discovery.
  
  Signed-off-by: Padmavathi Venna padm...@samsung.com
  ---
 
 ...
 
   /* Lock for cross i/f checks */
  
  @@ -997,19 +1006,76 @@ static struct i2s_dai *i2s_alloc_dai(struct
  platform_device *pdev, bool sec) 
  return i2s;
   
   }
  
  +#ifdef CONFIG_OF
  +static int samsung_i2s_parse_dt_gpio(struct i2s_dai *i2s)
  +{
  +   struct device *dev = i2s-pdev-dev;
  +   int index, gpio, ret;
  +
  +   for (index = 0; index  7; index++) {
  +   gpio = of_get_gpio(dev-of_node, index);
  +   if (!gpio_is_valid(gpio)) {
  +   dev_err(dev, invalid gpio[%d]: %d\n, index, gpio);
  +   goto free_gpio;
  +   }
  +
  +   ret = gpio_request(gpio, dev_name(dev));
  +   if (ret) {
  +   dev_err(dev, gpio [%d] request failed\n, gpio);
  +   goto free_gpio;
  +   }
  +   i2s-gpios[index] = gpio;
  +   }
  +   return 0;
  +
  +free_gpio:
  +   while (--index = 0)
  +   gpio_free(i2s-gpios[index]);
  +   return -EINVAL;
  +}
  +
  +static void samsung_i2s_dt_gpio_free(struct i2s_dai *i2s)
  +{
  +   unsigned int index;
  +   for (index = 0; index  7; index++)
  +   gpio_free(i2s-gpios[index]);
  +}
  +#else
  +static int samsung_i2s_parse_dt_gpio(struct i2s_dai *dai)
  +{
  +   return -EINVAL;
  +}
  +
  +static void samsung_i2s_dt_gpio_free(struct i2s_dai *dai)
  +{
  +}
  +
  +#endif
 
 NAK.

+1

 
 Why we should leave with this temporary code when there is already
 pinctrl support for Exynos SoCs ?
 
 If the pinctrl driver for Exynos5 was updated you could instead just do
 
 devm_pinctrl_get_select_default(i2s-pdev-dev);

I said it already by the way of some other Exynos5 patches that Exynos5 
has to be migrated to pin control.

The legacy GPIO interface was supposed to be kept only for compatibility 
with existing code (until it gets migrated to pin control), not for adding 
new code relying on it.

If you intend to add new code which needs to configure pin muxes, you 
should migrate Exynos5 to pin control first. This won't be particularly 
hard, since pinctrl-exynos driver already supports Exynos5 and all that is 
missing are Device Tree nodes for it.

Best regards,
-- 
Tomasz Figa
Samsung Poland RD Center
SW Solution Development, Linux Platform

--
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: [RFC v2 3/3] video: exynos: Making s6e8ax0 panel driver compliant with CDF

2013-02-14 Thread Vikas Sajjan
Hi Mr. Lee,

thanks for the review.

On 14 February 2013 07:30, Donghwa Lee dh09@samsung.com wrote:
 On Wed, Feb 13, 2013 at 19:01, Vikas Sajjan wrote:

 Made necessary changes in s6e8ax0 panel driver as per the  CDF-T.
 It also removes the dependency on backlight and lcd framework

 Signed-off-by: Vikas Sajjanvikas.saj...@linaro.org
 ---
   drivers/video/exynos/s6e8ax0.c |  848
 +---
   1 file changed, 444 insertions(+), 404 deletions(-)

 diff --git a/drivers/video/exynos/s6e8ax0.c
 b/drivers/video/exynos/s6e8ax0.c
 index 7f7b25f..5a17e3c 100644
 --- a/drivers/video/exynos/s6e8ax0.c
 +++ b/drivers/video/exynos/s6e8ax0.c
 @@ -25,6 +25,7 @@
   #include linux/backlight.h
   #include linux/regulator/consumer.h
   +#include video/display.h
   #include video/mipi_display.h
   #include video/exynos_mipi_dsim.h
   @@ -38,8 +39,7 @@
   #define POWER_IS_OFF(pwr) ((pwr) == FB_BLANK_POWERDOWN)
   #define POWER_IS_NRM(pwr) ((pwr) == FB_BLANK_NORMAL)
   -#define lcd_to_master(a) (a-dsim_dev-master)
 -#define lcd_to_master_ops(a)   ((lcd_to_master(a))-master_ops)
 +#define to_panel(p) container_of(p, struct s6e8ax0, entity)
 enum {
 DSIM_NONE_STATE = 0,
 @@ -47,20 +47,34 @@ enum {
 DSIM_FRAME_DONE = 2,
   };
   +/* This structure defines all the properties of a backlight */
 +struct backlight_prop {
 +   /* Current User requested brightness (0 - max_brightness) */
 +   int brightness;
 +   /* Maximal value for brightness (read-only) */
 +   int max_brightness;
 +};
 +
 +struct panel_platform_data {
 +   unsigned intreset_delay;
 +   unsigned intpower_on_delay;
 +   unsigned intpower_off_delay;
 +   const char  *video_source_name;
 +};
 +
   struct s6e8ax0 {
 -   struct device   *dev;
 -   unsigned intpower;
 -   unsigned intid;
 -   unsigned intgamma;
 -   unsigned intacl_enable;
 -   unsigned intcur_acl;
 -
 -   struct lcd_device   *ld;
 -   struct backlight_device *bd;
 -
 -   struct mipi_dsim_lcd_device *dsim_dev;
 -   struct lcd_platform_data*ddi_pd;
 +   struct platform_device  *pdev;
 +   struct video_source *src;
 +   struct display_entity   entity;
 +   unsigned intpower;
 +   unsigned intid;
 +   unsigned intgamma;
 +   unsigned intacl_enable;
 +   unsigned intcur_acl;
 +   boolpanel_reverse;
 +   struct lcd_platform_data*plat_data;
 struct mutexlock;
 +   struct backlight_prop   bl_prop;
 bool  enabled;
   };


 Could this panel driver use only CDF?
 Does not consider the compatibility with backlight and lcd framework?

as of now CDF does not support backlight and lcd framework functionalities.
Once CDF has the support, we modify the driver to support both CDF and
non CDF way, there by maintaining the backward compatibility with
backlight and lcd framework.

 -static const unsigned char s6e8ax0_22_gamma_30[] = {
 +static unsigned char s6e8ax0_22_gamma_30[] = {
 0xfa, 0x01, 0x60, 0x10, 0x60, 0xf5, 0x00, 0xff, 0xad, 0xaf,
 0xbA, 0xc3, 0xd8, 0xc5, 0x9f, 0xc6, 0x9e, 0xc1, 0xdc, 0xc0,
 0x00, 0x61, 0x00, 0x5a, 0x00, 0x74,
   };

 In all case, you had changed data type to 'static unsigned char'.
 Is it need to change all case? Otherwise, for the unity of the code?

in the CDF-T proposed by Mr. Tomi Valkeinen, the prototype for
dcs_write looks as below

int (*dcs_write)(struct video_source *src, int channel, u8 *data, size_t len);

It does not have const for the 3rd parameter (u8 *data ), and in our
driver we have all the arrays as const.
Just to silence the compiler warnings, i had removed the const keyword.


 Thank you,
 Donghwa Lee





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


Re: [PATCH V6 02/10] ASoC: SAMSUNG: Add DT support for i2s

2013-02-14 Thread Mark Brown
On Thu, Feb 14, 2013 at 11:48:59AM +0100, Sylwester Nawrocki wrote:

 NAK.

 Why we should leave with this temporary code when there is already
 pinctrl support for Exynos SoCs ?

 If the pinctrl driver for Exynos5 was updated you could instead just do

 devm_pinctrl_get_select_default(i2s-pdev-dev);

Too late, this stuff is already merged and on its way upstream.


signature.asc
Description: Digital signature


[PATCH v6] iio: adc: add exynos adc driver under iio framwork

2013-02-14 Thread Naveen Krishna Chatradhi
This patch adds New driver to support:
1. Supports ADC IF found on EXYNOS4412/EXYNOS5250
   and future SoCs from Samsung
2. Add ADC driver under iio/adc framework
3. Also adds the Documentation for device tree bindings

Signed-off-by: Naveen Krishna Chatradhi ch.nav...@samsung.com
---
Changes since v1:

1. Fixed comments from Lars
2. Added support for ADC on EXYNOS5410

Changes since v2:

1. Changed the instance name for (struct iio_dev *) to indio_dev
2. Changed devm_request_irq to request_irq

Few doubts regarding the mappings and child device handling.
Kindly, suggest me better methods.

Changes since v3:

1. Added clk_prepare_disable and regulator_disable calls in _remove()
2. Moved init_completion before irq_request
3. Added NULL pointer check for devm_request_and_ioremap() return value.
4. Use number of channels as per the ADC version
5. Change the define ADC_V1_CHANNEL to ADC_CHANNEL
6. Update the Documentation to include EXYNOS5410 compatible

Changes since v4:

1. if devm_request_and_ioremap() failes, free iio_device before returning

Changes since v5:

1. Fixed comments from Olof (ADC hardware version handling)
2. Rebased on top of comming OF framework for IIO by Guenter Roeck.

 .../bindings/arm/samsung/exynos5-adc.txt   |   42 ++
 drivers/iio/adc/Kconfig|7 +
 drivers/iio/adc/Makefile   |1 +
 drivers/iio/adc/exynos_adc.c   |  438 
 4 files changed, 488 insertions(+)
 .../devicetree/bindings/arm/samsung/exynos-adc.txt |   52 +++
 drivers/iio/adc/Kconfig|7 +
 drivers/iio/adc/Makefile   |1 +
 drivers/iio/adc/exynos_adc.c   |  437 
 4 files changed, 497 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
 create mode 100644 drivers/iio/adc/exynos_adc.c

diff --git a/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt 
b/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
new file mode 100644
index 000..f686378
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
@@ -0,0 +1,52 @@
+Samsung Exynos Analog to Digital Converter bindings
+
+This devicetree binding are for the new adc driver written fori
+Exynos4 and upward SoCs from Samsung.
+
+New driver handles the following
+1. Supports ADC IF found on EXYNOS4412/EXYNOS5250
+   and future SoCs from Samsung
+2. Add ADC driver under iio/adc framework
+3. Also adds the Documentation for device tree bindings
+
+Required properties:
+- compatible:  Must be samsung,exynos-adc-v1
+   for exynos4412/5250 controllers.
+   Must be samsung,exynos-adc-v2 for
+   future controllers.
+- reg: Contains ADC register address range (base address and
+   length).
+- interrupts:  Contains the interrupt information for the timer. The
+   format is being dependent on which interrupt controller
+   the Samsung device uses.
+- #io-channel-cells = 1; As ADC has multiple outputs
+
+Note: child nodes can be added for auto probing from device tree.
+
+Example: adding device info in dtsi file
+
+adc: adc@12D1 {
+   compatible = samsung,exynos-adc-v1;
+   reg = 0x12D1 0x100;
+   interrupts = 0 106 0;
+   #io-channel-cells = 1;
+   io-channel-ranges;
+};
+
+
+Example: Adding child nodes in dts file
+
+adc@12D1 {
+
+   /* NTC thermistor is a hwmon device */
+   ncp15wb473@0 {
+   compatible = ntc,ncp15wb473;
+   pullup-uV = 180;
+   pullup-ohm = 47000;
+   pulldown-ohm = 0;
+   io-channels = adc 4;
+   };
+};
+
+Note: Does not apply to ADC driver under arch/arm/plat-samsung/
+Note: The child node can be added under the adc node or seperately.
diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig
index e372257..04311f8 100644
--- a/drivers/iio/adc/Kconfig
+++ b/drivers/iio/adc/Kconfig
@@ -91,6 +91,13 @@ config AT91_ADC
help
  Say yes here to build support for Atmel AT91 ADC.
 
+config EXYNOS_ADC
+   bool Exynos ADC driver support
+   help
+ Core support for the ADC block found in the Samsung EXYNOS series
+ of SoCs for drivers such as the touchscreen and hwmon to use to share
+ this resource.
+
 config LP8788_ADC
bool LP8788 ADC driver
depends on MFD_LP8788
diff --git a/drivers/iio/adc/Makefile b/drivers/iio/adc/Makefile
index 2d5f100..fabac2c 100644
--- a/drivers/iio/adc/Makefile
+++ b/drivers/iio/adc/Makefile
@@ -10,6 +10,7 @@ obj-$(CONFIG_AD7791) += ad7791.o
 obj-$(CONFIG_AD7793) += ad7793.o
 obj-$(CONFIG_AD7887) += ad7887.o
 obj-$(CONFIG_AT91_ADC) += at91_adc.o
+obj-$(CONFIG_EXYNOS_ADC) += exynos_adc.o
 obj-$(CONFIG_LP8788_ADC) += lp8788_adc.o
 

Re: [PATCH] ARM: exynos: move exynos4210-combiner to drivers/irqchip

2013-02-14 Thread Rob Herring
On 02/13/2013 12:51 PM, Doug Anderson wrote:
 Rob / Olof,
 
 On Tue, Feb 12, 2013 at 2:52 PM, Olof Johansson o...@lixom.net wrote:
 On Tue, Feb 12, 2013 at 04:04:52PM -0600, Rob Herring wrote:
 From: Rob Herring rob.herr...@calxeda.com

 Exynos boot is broken with commit 0529e315 (ARM: use common irqchip_init
 for GIC init). This commit split the irqchip initialization into 2 calls
 to of_irq_init. This does not work because of_irq_init requires interrupt
 parents to be in the match list.

 Rather than reverting exynos changes, make it do the proper thing by using
 IRQCHIP_DECLARE. This requires moving the combiner code to drivers/irqchip.

 Reported-by: Doug Anderson diand...@chromium.org
 Signed-off-by: Rob Herring rob.herr...@calxeda.com
 Cc: Kukjin Kim kgene@samsung.com
 Cc: Russell King li...@arm.linux.org.uk
 Cc: Thomas Gleixner t...@linutronix.de
 Cc: linux-samsung-soc@vger.kernel.org
 ---

 I thought there may be other platforms broken in the same way, but I
 checked and exynos is the only one.

 This is based on my gic/vic irqchip branch in arm-soc.

 Applied to next/cleanup.
 
 I synced up to next-20130213 and the problem is fixed.  :)  ...that
 label doesn't exactly boot but the problems are unrelated to this
 problem now (there are problems with the OF conversions to raw
 spinlocks)...
 

That should be fixed, but may not be in -next yet. It is in Grant's tree.

Rob

 I haven't done any review of this code (I'm assuming that Olof already
 looked it over and Samsung engineers will give it a thorough review),
 but it's definitely tested.  :)
 
 Tested-by: Doug Anderson diand...@chromium.org
 
 Thanks!
 
 -Doug
 

--
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 V4 0/4] Add generic DMA DT binding support

2013-02-14 Thread Vinod Koul
On Thu, Feb 14, 2013 at 09:10:04AM +0530, Padmavathi Venna wrote:

Logically this should have been v5 :)

Applied all, thanks

--
~Vinod
 Changes since V3:
 - Make dma-cells property optional as suggested by Rob Herring
 - Add dma-requests and dma-channels properties to DMA controller
   as suggested by Arnd for future-proof
 - Add Acked-by for some of the patches
 
 Changes since V2:
 - Add new filter function for DT case as suggested by Arnd
 - Add xlate as static function
 - Use newly added filter function in xlate.
 - Add Acked-by for some of the patches
 
 Changes since V1:
 - Address the review comments by Arnd Bergmann as below
 - Wording of the properties.
 - Pass pdmac as third parameter to of_dma_controller_register
 - Filter the dma channel based on channel number and dma_device
 
 This patch set adds support for generic dma device tree bindings for
 Samsung platforms and is dependent on the following patches from
 Vinod Koul next branch
 1)of: Add generic device tree DMA helpers
 2)dmaengine: add helper function to request a slave DMA channel
 
 This patch set is made based on Vinod Koul next branch
 
 Padmavathi Venna (4):
   DMA: PL330: Add new pl330 filter for DT case.
   DMA: PL330: Add xlate function
   DMA: PL330: Register the DMA controller with the generic DMA helpers
   ARM: dts: pl330: Add #dma-cells for generic dma binding support
 
  .../devicetree/bindings/dma/arm-pl330.txt  |   21 +--
  arch/arm/boot/dts/exynos5250.dtsi  |   12 
  drivers/dma/pl330.c|   64 +++
  3 files changed, 78 insertions(+), 19 deletions(-)
 
 -- 
 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


Re: [PATCH 7/7] ARM: dts: Add Samsung G2D DT bindings documentation

2013-02-14 Thread Sylwester Nawrocki
On 02/14/2013 04:45 PM, Sachin Kamat wrote:
 Thanks for reviewing. Does the filename look good or should it be exynos-g2d?

You're welcome. My apologies for being a bit late.
I guess exynos-g2d.txt would be more appropriate. OTOH if this document is
going to cover all Samsung G2D IP blocks then current name might be better.
I used samsung- prefix for fimc and mipi-csis as those documents are supposed
to cover the S5P and Exynos4 SoCs.


--
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 v4 02/10] s5p-fimc: Add device tree support for FIMC devices

2013-02-14 Thread Sylwester Nawrocki

On 02/13/2013 09:42 PM, Stephen Warren wrote:

On 02/12/2013 03:39 PM, Sylwester Nawrocki wrote:

[...]

The whole subsystem topology is exposed to user space through the Media
Controller API.


OK, stable user-visible names are a reasonable use for device tree. I
still don't think you should use those user-visible IDs for making any
other kind of decision though.


OK, I will update the bindings so all variant details are placed in the
device tree. Then the routing information would mostly be coming from the
device specific dt properties/the common media bindings and the state of
links between the media entities, set by the user.


It's a bit simpler than that. We would need only to look for the reg
property in a local port subnode. MIPI-CSIS correspond to physical MIPI
CSI-2 bus interface of an SoC, hence it has to have specific reg values
that identify each camera input interface.


Oh I see. I guess if a device is using its own node to determine its own
identify, that's reasonable.


OK, I'm going to post an updated patch series in a week or two.


I thought you were talking about a situation like:

FIMC -- XXX

where FIMC wanted to determine what ID XXX knew that particular FIMC as.


Ah, no. Sorry for the poor explanation. FIMC are on a sort if interconnect
bus and they can be attached to a single data source, even in parallel,
and the data source entity don't even need to be fully aware of it.


I can see aliases used in bindings of multiple devices: uart, spi, sound
interfaces, gpio, ... And all bindings seem to impose some rules on how
their aliases are created.


Do you have specific examples? I really don't think the bindings should
be dictating the alias values.


I just grepped through the existing bindings documentation:

...

I think correctly numbered in the above statements means there are some
specific rules on how the aliases are created, however those seem not
clearly communicated.


A binding specifying that an alias must (or even should) exist for each
node seems odd to me. In the absence of an explicit rule for how to
determine the alias IDs to use, I think the rule would simply be that
the aliases must be unique?


I guess so. Inspecting of_alias_get_id() call sites tells us that most 
drivers

just fail when alias is not present and only rarely it is not treated as an
error condition.


And there is a new patch series that allows I2C bus controller enumeration
by means of the aliases:

http://www.spinics.net/lists/arm-kernel/msg224162.html


That's not enumerating controllers by alias (they're still enumerated by
scanning the DT nodes for buses in the normal way). The change simply
assigns the bus ID of each controller from an alias; exactly what
aliases are for.


OK, that clarifies a bit my understanding of the aliases.

Thanks,
Sylwester
--
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/4] ARM: Exynos5250: Enabling ehci-s5p driver

2013-02-14 Thread Vivek Gautam
On Sat, Feb 9, 2013 at 4:05 AM, Kukjin Kim kgene@samsung.com wrote:
 Vivek Gautam wrote:

 Adding EHCI device tree node for Exynos5250 along with
 the device base adress and gpio line for vbus.

 Signed-off-by: Vivek Gautam gautam.vi...@samsung.com
 Acked-by: Jingoo Han jg1@samsung.com
 Acked-by: Grant Likely grant.lik...@secretlab.ca
 ---

 Changes from v4:
  - Added gpio line for VBUS of USB2.0 on snow board.

  .../devicetree/bindings/usb/exynos-usb.txt |   25
 
  arch/arm/boot/dts/exynos5250-smdk5250.dts  |4 +++
  arch/arm/boot/dts/exynos5250-snow.dts  |4 +++
  arch/arm/boot/dts/exynos5250.dtsi  |6 
  4 files changed, 39 insertions(+), 0 deletions(-)
  create mode 100644 Documentation/devicetree/bindings/usb/exynos-
 usb.txt

 diff --git a/Documentation/devicetree/bindings/usb/exynos-usb.txt
 b/Documentation/devicetree/bindings/usb/exynos-usb.txt
 new file mode 100644
 index 000..e8bbb47
 --- /dev/null
 +++ b/Documentation/devicetree/bindings/usb/exynos-usb.txt
 @@ -0,0 +1,25 @@
 +Samsung Exynos SoC USB controller
 +
 +The USB devices interface with USB controllers on Exynos SOCs.
 +The device node has following properties.
 +
 +EHCI
 +Required properties:
 + - compatible: should be samsung,exynos4210-ehci for USB 2.0
 +   EHCI controller in host mode.
 + - reg: physical base address of the controller and length of memory
 mapped
 +   region.
 + - interrupts: interrupt number to the cpu.
 +
 +Optional properties:
 + - samsung,vbus-gpio:  if present, specifies the GPIO that
 +   needs to be pulled up for the bus to be powered.
 +
 +Example:
 +
 + usb@1211 {
 + compatible = samsung,exynos4210-ehci;
 + reg = 0x1211 0x100;
 + interrupts = 0 71 0;
 + samsung,vbus-gpio = gpx2 6 1 3 3;
 + };
 diff --git a/arch/arm/boot/dts/exynos5250-smdk5250.dts
 b/arch/arm/boot/dts/exynos5250-smdk5250.dts
 index 942d576..7363e14 100644
 --- a/arch/arm/boot/dts/exynos5250-smdk5250.dts
 +++ b/arch/arm/boot/dts/exynos5250-smdk5250.dts
 @@ -204,4 +204,8 @@
   samsung,mfc-r = 0x4300 0x80;
   samsung,mfc-l = 0x5100 0x80;
   };
 +
 + usb@1211 {
 + samsung,vbus-gpio = gpx2 6 1 3 3;
 + };
  };
 diff --git a/arch/arm/boot/dts/exynos5250-snow.dts
 b/arch/arm/boot/dts/exynos5250-snow.dts
 index 17dd951..47b6b84 100644
 --- a/arch/arm/boot/dts/exynos5250-snow.dts
 +++ b/arch/arm/boot/dts/exynos5250-snow.dts
 @@ -40,4 +40,8 @@
   gpc4 5 2 3 0, gpc4 6 2 3 0;
   };
   };
 +
 + usb@1211 {
 + samsung,vbus-gpio = gpx1 1 1 3 3;
 + };
  };
 diff --git a/arch/arm/boot/dts/exynos5250.dtsi
 b/arch/arm/boot/dts/exynos5250.dtsi
 index 30485de..2cbe53e 100644
 --- a/arch/arm/boot/dts/exynos5250.dtsi
 +++ b/arch/arm/boot/dts/exynos5250.dtsi
 @@ -275,6 +275,12 @@
   #size-cells = 0;
   };

 + usb@1211 {
 + compatible = samsung,exynos4210-ehci;
 + reg = 0x1211 0x100;
 + interrupts = 0 71 0;
 + };
 +
   amba {
   #address-cells = 1;
   #size-cells = 1;
 --
 1.7.6.5

 Looks good to me and applied this and [PATCH v3 2/4] ARM: Exynos5250:
 Enabling ohci-exynos driver in Samsung tree.

 Note, I think, you need to implement to use pinctrl for this instead of old
 gpio bindings next time, probably after release v3.9-rc1.


Sure, will add the necessary pinctrl support replacing the old gpio bindings,
and post the same asap. :-)

 Ah, one more, please use subject lines appropriate like others, ARM: dts:
 .


Sorry, for misleading subject line, will keep commit titles
aligned-with in future,

 Thanks.

 - Kukjin



-- 
Thanks  Regards
Vivek
--
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 v7] iio: adc: add exynos adc driver under iio framwork

2013-02-14 Thread Naveen Krishna Chatradhi
This patch adds New driver to support:
1. Supports ADC IF found on EXYNOS4412/EXYNOS5250
   and future SoCs from Samsung
2. Add ADC driver under iio/adc framework
3. Also adds the Documentation for device tree bindings

Signed-off-by: Naveen Krishna Chatradhi ch.nav...@samsung.com
---
Changes since v1:

1. Fixed comments from Lars
2. Added support for ADC on EXYNOS5410

Changes since v2:

1. Changed the instance name for (struct iio_dev *) to indio_dev
2. Changed devm_request_irq to request_irq

Few doubts regarding the mappings and child device handling.
Kindly, suggest me better methods.

Changes since v3:

1. Added clk_prepare_disable and regulator_disable calls in _remove()
2. Moved init_completion before irq_request
3. Added NULL pointer check for devm_request_and_ioremap() return value.
4. Use number of channels as per the ADC version
5. Change the define ADC_V1_CHANNEL to ADC_CHANNEL
6. Update the Documentation to include EXYNOS5410 compatible

Changes since v4:

1. if devm_request_and_ioremap() failes, free iio_device before returning

Changes since v5:

1. Fixed comments from Olof (ADC hardware version handling)
2. Rebased on top of comming OF framework for IIO by Guenter Roeck.

Changes since v6:

1. Addressed comments from Lars-Peter Clausen

 .../bindings/arm/samsung/exynos5-adc.txt   |   42 ++
 drivers/iio/adc/Kconfig|7 +
 drivers/iio/adc/Makefile   |1 +
 drivers/iio/adc/exynos_adc.c   |  438 
 4 files changed, 488 insertions(+)
 .../devicetree/bindings/arm/samsung/exynos-adc.txt |   52 +++
 drivers/iio/adc/Kconfig|7 +
 drivers/iio/adc/Makefile   |1 +
 drivers/iio/adc/exynos_adc.c   |  440 
 4 files changed, 500 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
 create mode 100644 drivers/iio/adc/exynos_adc.c

diff --git a/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt 
b/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
new file mode 100644
index 000..f686378
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
@@ -0,0 +1,52 @@
+Samsung Exynos Analog to Digital Converter bindings
+
+This devicetree binding are for the new adc driver written fori
+Exynos4 and upward SoCs from Samsung.
+
+New driver handles the following
+1. Supports ADC IF found on EXYNOS4412/EXYNOS5250
+   and future SoCs from Samsung
+2. Add ADC driver under iio/adc framework
+3. Also adds the Documentation for device tree bindings
+
+Required properties:
+- compatible:  Must be samsung,exynos-adc-v1
+   for exynos4412/5250 controllers.
+   Must be samsung,exynos-adc-v2 for
+   future controllers.
+- reg: Contains ADC register address range (base address and
+   length).
+- interrupts:  Contains the interrupt information for the timer. The
+   format is being dependent on which interrupt controller
+   the Samsung device uses.
+- #io-channel-cells = 1; As ADC has multiple outputs
+
+Note: child nodes can be added for auto probing from device tree.
+
+Example: adding device info in dtsi file
+
+adc: adc@12D1 {
+   compatible = samsung,exynos-adc-v1;
+   reg = 0x12D1 0x100;
+   interrupts = 0 106 0;
+   #io-channel-cells = 1;
+   io-channel-ranges;
+};
+
+
+Example: Adding child nodes in dts file
+
+adc@12D1 {
+
+   /* NTC thermistor is a hwmon device */
+   ncp15wb473@0 {
+   compatible = ntc,ncp15wb473;
+   pullup-uV = 180;
+   pullup-ohm = 47000;
+   pulldown-ohm = 0;
+   io-channels = adc 4;
+   };
+};
+
+Note: Does not apply to ADC driver under arch/arm/plat-samsung/
+Note: The child node can be added under the adc node or seperately.
diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig
index e372257..04311f8 100644
--- a/drivers/iio/adc/Kconfig
+++ b/drivers/iio/adc/Kconfig
@@ -91,6 +91,13 @@ config AT91_ADC
help
  Say yes here to build support for Atmel AT91 ADC.
 
+config EXYNOS_ADC
+   bool Exynos ADC driver support
+   help
+ Core support for the ADC block found in the Samsung EXYNOS series
+ of SoCs for drivers such as the touchscreen and hwmon to use to share
+ this resource.
+
 config LP8788_ADC
bool LP8788 ADC driver
depends on MFD_LP8788
diff --git a/drivers/iio/adc/Makefile b/drivers/iio/adc/Makefile
index 2d5f100..fabac2c 100644
--- a/drivers/iio/adc/Makefile
+++ b/drivers/iio/adc/Makefile
@@ -10,6 +10,7 @@ obj-$(CONFIG_AD7791) += ad7791.o
 obj-$(CONFIG_AD7793) += ad7793.o
 obj-$(CONFIG_AD7887) += ad7887.o
 obj-$(CONFIG_AT91_ADC) += at91_adc.o

[PATCH v4 0/5] Add DRM FIMD DT support for Exynos4 DT Machines

2013-02-14 Thread Vikas Sajjan
This patch series adds support for DRM FIMD DT for Exynos4 DT Machines,
specifically for Exynos4412 SoC.

changes since v3:
- rebased on

http://git.kernel.org/?p=linux/kernel/git/kgene/linux-samsung.git;a=shortlog;h=refs/heads/for-next-next

changes since v2:
- added alias to 'fimd@11c0' node
(reported by: Rahul Sharma r.sh.o...@gmail.com)
- removed 'lcd0_data' node as there was already a similar node 
lcd_data24
(reported by: Jingoo Han jg1@samsung.com
- replaced spaces with tabs in display-timing node

changes since v1:
- added new patch to add FIMD DT binding Documentation
- removed patch enabling SAMSUNG_DEV_BACKLIGHT and SAMSUNG_DEV_PMW 
for mach-exynos4 DT
- added 'status' property to fimd DT node

Is based on branch for-next-next
http://git.kernel.org/?p=linux/kernel/git/kgene/linux-samsung.git;a=shortlog;h=refs/heads/for-next-next

Sachin Kamat (1):
  ARM: dts: Add lcd pinctrl node entries for EXYNOS4412 SoC

Vikas Sajjan (4):
  ARM: dts: Add FIMD node to exynos4
  ARM: dts: Add FIMD node and display timing node to
exynos4412-origen.dts
  ARM: dts: add FIMD AUXDATA node entry for exynos4 DT
  ARM: exynos: dts: Add FIMD DT binding Documentation

 .../devicetree/bindings/drm/exynos/fimd.txt|   37 
 arch/arm/boot/dts/exynos4.dtsi |7 
 arch/arm/boot/dts/exynos4412-origen.dts|   22 
 arch/arm/boot/dts/exynos4x12-pinctrl.dtsi  |   14 
 arch/arm/mach-exynos/mach-exynos4-dt.c |2 ++
 5 files changed, 82 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/drm/exynos/fimd.txt

-- 
1.7.9.5

--
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 v4 1/5] ARM: dts: Add FIMD node to exynos4

2013-02-14 Thread Vikas Sajjan
This adds common FIMD device node for all Exynos4 SoCs.

Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
---
 arch/arm/boot/dts/exynos4.dtsi |7 +++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi
index 6581bb2..d73b9ee 100644
--- a/arch/arm/boot/dts/exynos4.dtsi
+++ b/arch/arm/boot/dts/exynos4.dtsi
@@ -297,4 +297,11 @@
interrupts = 0 34 0;
};
};
+
+   fimd: fimd@11c0 {
+   compatible = samsung,exynos4-fimd;
+   interrupt-parent = combiner;
+   reg = 0x11c0 0x2;
+   interrupts = 11 1, 11 0, 11 2;
+   };
 };
-- 
1.7.9.5

--
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 v4 2/5] ARM: dts: Add lcd pinctrl node entries for EXYNOS4412 SoC

2013-02-14 Thread Vikas Sajjan
From: Sachin Kamat sachin.ka...@linaro.org

This patch adds the lcd panel related picntrl nodes for Exynos4412 SoC

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
---
 arch/arm/boot/dts/exynos4x12-pinctrl.dtsi |   14 ++
 1 file changed, 14 insertions(+)

diff --git a/arch/arm/boot/dts/exynos4x12-pinctrl.dtsi 
b/arch/arm/boot/dts/exynos4x12-pinctrl.dtsi
index 099cec7..a59d69c 100644
--- a/arch/arm/boot/dts/exynos4x12-pinctrl.dtsi
+++ b/arch/arm/boot/dts/exynos4x12-pinctrl.dtsi
@@ -354,6 +354,20 @@
samsung,pin-drv = 0;
};
 
+   lcd_sync: lcd-sync {
+   samsung,pins = gpf0-0, gpf0-1;
+   samsung,pin-function = 2;
+   samsung,pin-pud = 0;
+   samsung,pin-drv = 0;
+   };
+
+   lcd_en: lcd-en {
+   samsung,pins = gpf0-3;
+   samsung,pin-function = 2;
+   samsung,pin-pud = 0;
+   samsung,pin-drv = 0;
+   };
+
lcd_clk: lcd-clk {
samsung,pins = gpf0-0, gpf0-1, gpf0-2, gpf0-3;
samsung,pin-function = 2;
-- 
1.7.9.5

--
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 v4 3/5] ARM: dts: Add FIMD node and display timing node to exynos4412-origen.dts

2013-02-14 Thread Vikas Sajjan
Adds FIMD DT support to Origen quad board

Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
---
 arch/arm/boot/dts/exynos4412-origen.dts |   22 ++
 1 file changed, 22 insertions(+)

diff --git a/arch/arm/boot/dts/exynos4412-origen.dts 
b/arch/arm/boot/dts/exynos4412-origen.dts
index 31e14c4..a6fd41f 100644
--- a/arch/arm/boot/dts/exynos4412-origen.dts
+++ b/arch/arm/boot/dts/exynos4412-origen.dts
@@ -70,6 +70,28 @@
status = okay;
};
 
+   fimd@11c0 {
+   samsung,power-domain = pd_lcd0;
+   pinctrl-0 = lcd_sync lcd_clk lcd_en lcd_data24 pwm1_out;
+   pinctrl-names = default;
+   status = okay;
+   };
+
+   display-timings {
+   native-mode = timing0;
+   timing0: timing@0 {
+   clock-frequency = 5;
+   hactive = 1024;
+   vactive = 600;
+   hfront-porch = 64;
+   hback-porch = 16;
+   hsync-len = 48;
+   vback-porch = 64;
+   vfront-porch = 16;
+   vsync-len = 3;
+   };
+   };
+
serial@1380 {
status = okay;
};
-- 
1.7.9.5

--
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 v4 4/5] ARM: dts: add FIMD AUXDATA node entry for exynos4 DT

2013-02-14 Thread Vikas Sajjan
Adds the FIMD AUXDATA node

Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
---
 arch/arm/mach-exynos/mach-exynos4-dt.c |2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/mach-exynos/mach-exynos4-dt.c 
b/arch/arm/mach-exynos/mach-exynos4-dt.c
index b68115a..779f151 100644
--- a/arch/arm/mach-exynos/mach-exynos4-dt.c
+++ b/arch/arm/mach-exynos/mach-exynos4-dt.c
@@ -84,6 +84,8 @@ static const struct of_dev_auxdata exynos4_auxdata_lookup[] 
__initconst = {
OF_DEV_AUXDATA(samsung,exynos4210-tmu, EXYNOS4_PA_TMU,
exynos-tmu, NULL),
OF_DEV_AUXDATA(samsung,mfc-v5, 0x1340, s5p-mfc, NULL),
+   OF_DEV_AUXDATA(samsung,exynos4-fimd, EXYNOS4_PA_FIMD0,
+   exynos4-fb.0, NULL),
{},
 };
 
-- 
1.7.9.5

--
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 v4 5/5] ARM: exynos: dts: Add FIMD DT binding Documentation

2013-02-14 Thread Vikas Sajjan
Adds FIMD DT binding documentation both SoC and Board, with an example

Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
---
 .../devicetree/bindings/drm/exynos/fimd.txt|   37 
 1 file changed, 37 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/drm/exynos/fimd.txt

diff --git a/Documentation/devicetree/bindings/drm/exynos/fimd.txt 
b/Documentation/devicetree/bindings/drm/exynos/fimd.txt
new file mode 100644
index 000..bec9d07
--- /dev/null
+++ b/Documentation/devicetree/bindings/drm/exynos/fimd.txt
@@ -0,0 +1,37 @@
+Device-Tree bindings for fimd driver
+
+FIMD stands for Fully Interactive Mobile Display, is the Display Controller for
+the Exynos series of SoCs which transfers the image data from a video buffer
+located in the system memory to an external LCD interface.
+
+Required properties:
+- compatible := value should be samsung,exynos5-fimd or 
samsung,exynos4-fimd
+- reg := physical base address of the fimd and length of memory mapped region
+- interrupt-parent := reference to the interrupt combiner node with phandle
+- interrupts := interrupt number from the combiner to the cpu
+- pinctrl := property defining the pinctrl configurations with a phandle
+- pinctrl-names := name of the pinctrl
+
+Optional Properties:
+- samsung,power-domain := power domain property defined with a phandle
+- status := property defining the status of the node
+
+Example:
+
+SoC specific DT Entry:
+
+   fimd@11c0 {
+   compatible = samsung,exynos4-fimd;
+   interrupt-parent = combiner;
+   reg = 0x11c0 0x2;
+   interrupts = 11 1, 11 0, 11 2;
+   };
+
+Board specific DT Entry:
+
+   fimd@11c0 {
+   samsung,power-domain = pd_lcd0;
+   pinctrl-0 = lcd_sync lcd_clk lcd_en lcd0_data pwm1_out;
+   pinctrl-names = default;
+   status = okay;
+   };
-- 
1.7.9.5

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