[PATCH] Samsung Aquila GONI update

2010-07-01 Thread Marek Szyprowski
Hello,

This short patch series adds basic framebuffer defintion to Samsung GONI
board as well as PMIC8998 support for both Samsung Aquila and GONI
boards. MAX8998 PMIC driver has been accepted by regulator subsystem
maintainers and is already available in the 'next' kernel tree (see
commit 8d017ab9f81089cb5ffde0e354d13130c1c1). 

The series contains the following patches:

[PATCH 1/3] arm: s5pv210: GONI: add support for framebuffer
[PATCH 2/3] arm: s5pv210: Aquila: add support for MAX8998 PMIC
[PATCH 3/3] arm: s5pv210: GONI: add support for MAX8998 PMIC

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


[PATCH 2/3] arm: s5pv210: Aquila: add support for MAX8998 PMIC

2010-07-01 Thread Marek Szyprowski
This patch adds required platform definitions for MAX8998 PMIC driver. Power
regulators for LDO and BUCK outputs has been defined as well as a simple
gpio-keys button for power key (to enable wakeup functionality with
external interrupt).

Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 arch/arm/mach-s5pv210/mach-aquila.c |  388 +++
 1 files changed, 388 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s5pv210/mach-aquila.c 
b/arch/arm/mach-s5pv210/mach-aquila.c
index 44db0fc..46e0a23 100644
--- a/arch/arm/mach-s5pv210/mach-aquila.c
+++ b/arch/arm/mach-s5pv210/mach-aquila.c
@@ -13,6 +13,11 @@
 #include linux/init.h
 #include linux/serial_core.h
 #include linux/fb.h
+#include linux/i2c.h
+#include linux/i2c-gpio.h
+#include linux/mfd/max8998.h
+#include linux/gpio_keys.h
+#include linux/input.h
 
 #include asm/mach/arch.h
 #include asm/mach/map.h
@@ -22,7 +27,9 @@
 #include mach/map.h
 #include mach/regs-clock.h
 #include mach/regs-fb.h
+#include mach/gpio.h
 
+#include plat/gpio-cfg.h
 #include plat/regs-serial.h
 #include plat/s5pv210.h
 #include plat/devs.h
@@ -122,7 +129,383 @@ static struct s3c_fb_platdata aquila_lcd_pdata __initdata 
= {
.setup_gpio = s5pv210_fb_gpio_setup_24bpp,
 };
 
+/* MAX8998 regulators */
+#if defined(CONFIG_REGULATOR_MAX8998) || \
+   defined(CONFIG_REGULATOR_MAX8998_MODULE)
+
+static struct regulator_consumer_supply aquila_ldo3_consumers[] = {
+   {   .supply = VMIPI_1.1V, },
+};
+
+static struct regulator_consumer_supply aquila_ldo8_consumers[] = {
+   {   .supply = VADC_3.3V, },
+};
+
+static struct regulator_consumer_supply aquila_ldo11_consumers[] = {
+   {   .supply = CAM_IO_2.8V, },
+};
+
+static struct regulator_consumer_supply aquila_ldo12_consumers[] = {
+   {   .supply = CAM_ISP_1.2V, },
+};
+
+static struct regulator_consumer_supply aquila_ldo13_consumers[] = {
+   {   .supply = CAM_A_2.8V, },
+};
+
+static struct regulator_consumer_supply aquila_ldo14_consumers[] = {
+   {   .supply = CAM_CIF_1.8V, },
+};
+
+static struct regulator_consumer_supply aquila_ldo15_consumers[] = {
+   {   .supply = CAM_AF_3.3V, },
+};
+
+static struct regulator_consumer_supply aquila_ldo16_consumers[] = {
+   {   .supply = VMIPI_1.8V, },
+};
+
+static struct regulator_consumer_supply aquila_ldo17_consumers[] = {
+   {   .supply = CAM_8M_1.8V, },
+};
+
+static struct regulator_init_data aquila_ldo2_data = {
+   .constraints= {
+   .name   = VALIVE_1.1V,
+   .min_uV = 110,
+   .max_uV = 110,
+   .apply_uV   = 1,
+   .always_on  = 1,
+   .boot_on= 0,
+   .state_mem  = {
+   .enabled = 1,
+   },
+   },
+};
+
+static struct regulator_init_data aquila_ldo3_data = {
+   .constraints= {
+   .name   = VUSB/MIPI_1.1V,
+   .min_uV = 110,
+   .max_uV = 110,
+   .apply_uV   = 1,
+   .always_on  = 1,
+   },
+   .num_consumer_supplies  = ARRAY_SIZE(aquila_ldo3_consumers),
+   .consumer_supplies  = aquila_ldo3_consumers,
+};
+
+static struct regulator_init_data aquila_ldo4_data = {
+   .constraints= {
+   .name   = VDAC_3.3V,
+   .min_uV = 330,
+   .max_uV = 330,
+   .apply_uV   = 1,
+   },
+};
+
+static struct regulator_init_data aquila_ldo5_data = {
+   .constraints= {
+   .name   = VTF_2.8V,
+   .min_uV = 280,
+   .max_uV = 280,
+   .apply_uV   = 1,
+   },
+};
+
+static struct regulator_init_data aquila_ldo6_data = {
+   .constraints= {
+   .name   = VCC_3.3V,
+   .min_uV = 330,
+   .max_uV = 330,
+   .apply_uV   = 1,
+   },
+};
+
+static struct regulator_init_data aquila_ldo7_data = {
+   .constraints= {
+   .name   = VCC_3.0V,
+   .min_uV = 300,
+   .max_uV = 300,
+   .apply_uV   = 1,
+   .boot_on= 1,
+   .always_on  = 1,
+   },
+};
+
+static struct regulator_init_data aquila_ldo8_data = {
+   .constraints= {
+   .name   = VUSB/VADC_3.3V,
+   .min_uV = 330,
+   .max_uV = 330,
+   .apply_uV   = 1,
+   .always_on  = 1,
+   },
+   .num_consumer_supplies  = ARRAY_SIZE(aquila_ldo8_consumers),
+   .consumer_supplies  = aquila_ldo8_consumers,
+};
+

[PATCH 3/3] arm: s5pv210: GONI: add support for MAX8998 PMIC

2010-07-01 Thread Marek Szyprowski
This patch adds required platform definitions for MAX8998 PMIC driver. Power
regulators for LDO and BUCK outputs has been defined as well as a simple
gpio-keys button for power key (to enable wakeup functionality with
external interrupt).

Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 arch/arm/mach-s5pv210/mach-goni.c |  391 +
 1 files changed, 391 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s5pv210/mach-goni.c 
b/arch/arm/mach-s5pv210/mach-goni.c
index 05b4a1a..683d2b9 100644
--- a/arch/arm/mach-s5pv210/mach-goni.c
+++ b/arch/arm/mach-s5pv210/mach-goni.c
@@ -13,8 +13,13 @@
 #include linux/init.h
 #include linux/serial_core.h
 #include linux/fb.h
+#include linux/i2c.h
+#include linux/i2c-gpio.h
+#include linux/mfd/max8998.h
 #include linux/delay.h
 #include linux/clk.h
+#include linux/gpio_keys.h
+#include linux/input.h
 
 #include asm/mach/arch.h
 #include asm/mach/map.h
@@ -107,9 +112,391 @@ static struct s3c_fb_platdata goni_lcd_pdata __initdata = 
{
.setup_gpio = s5pv210_fb_gpio_setup_24bpp,
 };
 
+/* MAX8998 regulators */
+#if defined(CONFIG_REGULATOR_MAX8998) || \
+   defined(CONFIG_REGULATOR_MAX8998_MODULE)
+
+static struct regulator_consumer_supply goni_ldo3_consumers[] = {
+   {   .supply = VMIPI_1.1V, },
+};
+
+static struct regulator_consumer_supply sdk_ldo7_consumers[] = {
+   {   .supply = VLCD_1.8V, },
+};
+
+static struct regulator_consumer_supply goni_ldo8_consumers[] = {
+   {   .supply = VADC_3.3V, },
+};
+
+static struct regulator_consumer_supply goni_ldo11_consumers[] = {
+   {   .supply = CAM_IO_2.8V, },
+};
+
+static struct regulator_consumer_supply goni_ldo12_consumers[] = {
+   {   .supply = CAM_ISP_1.2V, },
+};
+
+static struct regulator_consumer_supply goni_ldo13_consumers[] = {
+   {   .supply = CAM_A_2.8V, },
+};
+
+static struct regulator_consumer_supply goni_ldo14_consumers[] = {
+   {   .supply = CAM_CIF_1.8V, },
+};
+
+static struct regulator_consumer_supply goni_ldo15_consumers[] = {
+   {   .supply = CAM_AF_3.3V, },
+};
+
+static struct regulator_consumer_supply goni_ldo16_consumers[] = {
+   {   .supply = VMIPI_1.8V, },
+};
+
+static struct regulator_consumer_supply goni_ldo17_consumers[] = {
+   {   .supply = VCC_3.0V_LCD, },
+};
+
+static struct regulator_init_data goni_ldo2_data = {
+   .constraints= {
+   .name   = VALIVE_1.1V,
+   .min_uV = 110,
+   .max_uV = 110,
+   .apply_uV   = 1,
+   .always_on  = 1,
+   .boot_on= 0,
+   .state_mem  = {
+   .enabled = 1,
+   },
+   },
+};
+
+static struct regulator_init_data goni_ldo3_data = {
+   .constraints= {
+   .name   = VUSB/MIPI_1.1V,
+   .min_uV = 110,
+   .max_uV = 110,
+   .apply_uV   = 1,
+   .always_on  = 1,
+   },
+   .num_consumer_supplies  = ARRAY_SIZE(goni_ldo3_consumers),
+   .consumer_supplies  = goni_ldo3_consumers,
+};
+
+static struct regulator_init_data goni_ldo4_data = {
+   .constraints= {
+   .name   = VDAC_3.3V,
+   .min_uV = 330,
+   .max_uV = 330,
+   .apply_uV   = 1,
+   },
+};
+
+static struct regulator_init_data goni_ldo5_data = {
+   .constraints= {
+   .name   = VTF_2.8V,
+   .min_uV = 280,
+   .max_uV = 280,
+   .apply_uV   = 1,
+   },
+};
+
+static struct regulator_init_data goni_ldo6_data = {
+   .constraints= {
+   .name   = VCC_3.3V,
+   .min_uV = 330,
+   .max_uV = 330,
+   .apply_uV   = 1,
+   },
+};
+
+static struct regulator_init_data goni_ldo7_data = {
+   .constraints= {
+   .name   = VLCD_1.8V,
+   .min_uV = 180,
+   .max_uV = 180,
+   .apply_uV   = 1,
+   .always_on  = 1,
+   },
+   .num_consumer_supplies  = ARRAY_SIZE(sdk_ldo7_consumers),
+   .consumer_supplies  = sdk_ldo7_consumers,
+};
+
+static struct regulator_init_data goni_ldo8_data = {
+   .constraints= {
+   .name   = VUSB/VADC_3.3V,
+   .min_uV = 330,
+   .max_uV = 330,
+   .apply_uV   = 1,
+   .always_on  = 1,
+   },
+   .num_consumer_supplies  = ARRAY_SIZE(goni_ldo8_consumers),
+   .consumer_supplies  = goni_ldo8_consumers,
+};
+
+static struct 

Re: [PATCH 0/8] ARM: S5PV310: Add support for Samsung S5PV310 SoC

2010-07-01 Thread Kyungmin Park
Hi,

How about to start the single kernel preparation from this patch?
Instead of create the new machine directory, we just put the
mach-s5pv210 or create the new one.

and don't you think it's confusing of names.
s5pc110 (same as s5pv210), vs. s5pc210 (same as s5pv310).
maybe someone don't read the chip carefully. it's misleading the chips.

Thank you,
Kyungmin Park

On Fri, Jun 25, 2010 at 11:27 PM, Kukjin Kim kgene@samsung.com wrote:
 This patch set adds support for Samsung S5PV310/S5PC210. The S5PV310
 integrates a ARM Cortex A9 microprocessor with several other peripherals
 to support features such as multimedia, storage, graphics and gaming.
 The S5PV310 can be used in products such as Netbooks and Mobile devices.

 This patch set consists of the following patches.

 [PATCH 1/8] ARM: S5P: Remove fixed uart offset dependent code
 [PATCH 2/8] ARM: S5PV310: Add new CPU initialization support
 [PATCH 3/8] ARM: S5PV310: Add Clock and PLL support
 [PATCH 4/8] ARM: S5PV310: Add IRQ support
 [PATCH 5/8] ARM: S5PV310: Add Timer support
 [PATCH 6/8] ARM: S5PV310: Add new Kconfig and Makefiles
 [PATCH 7/8] ARM: S5PV310: Add Board support file
 [PATCH 8/8] ARM: S5PV310: Add serial port support
 --
 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

--
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 8/8] ARM: S5PV310: Add serial port support

2010-07-01 Thread Kyungmin Park
Hi,

As previous description. it's also same except the udivslot
calculation and clock selection.
How about to just modify current v210 serial codes by just adding the
V310 or C210 type?

Thank you,
Kyungmin Park

On Fri, Jun 25, 2010 at 11:27 PM, Kukjin Kim kgene@samsung.com wrote:
 From: Changhwan Youn chaos.y...@samsung.com

 This patch adds UART serial port support for S5PV310 CPU.

 Signed-off-by: Changhwan Youn chaos.y...@samsung.com
 Signed-off-by: Kukjin Kim kgene@samsung.com
 ---
  drivers/serial/Kconfig   |    8 +++
  drivers/serial/Makefile  |    1 +
  drivers/serial/s5pv310.c |  124 
 ++
  3 files changed, 133 insertions(+), 0 deletions(-)
  create mode 100644 drivers/serial/s5pv310.c

 diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
 index 8b23165..b5ff41f 100644
 --- a/drivers/serial/Kconfig
 +++ b/drivers/serial/Kconfig
 @@ -550,6 +550,14 @@ config SERIAL_S5PV210
        help
          Serial port support for Samsung's S5P Family of SoC's

 +config SERIAL_S5PV310
 +       tristate Samsung S5PV310 Serial port support
 +       depends on SERIAL_SAMSUNG  CPU_S5PV310
 +       select SERIAL_SAMSUNG_UARTS_4
 +       default y
 +       help
 +         Serial port support for Samsung's S5P Family of SoC's
 +
  config SERIAL_MAX3100
        tristate MAX3100 support
        depends on SPI
 diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
 index 208a855..bd32d3f 100644
 --- a/drivers/serial/Makefile
 +++ b/drivers/serial/Makefile
 @@ -45,6 +45,7 @@ obj-$(CONFIG_SERIAL_S3C2440) += s3c2440.o
  obj-$(CONFIG_SERIAL_S3C24A0) += s3c24a0.o
  obj-$(CONFIG_SERIAL_S3C6400) += s3c6400.o
  obj-$(CONFIG_SERIAL_S5PV210) += s5pv210.o
 +obj-$(CONFIG_SERIAL_S5PV310) += s5pv310.o
  obj-$(CONFIG_SERIAL_MAX3100) += max3100.o
  obj-$(CONFIG_SERIAL_IP22_ZILOG) += ip22zilog.o
  obj-$(CONFIG_SERIAL_MUX) += mux.o
 diff --git a/drivers/serial/s5pv310.c b/drivers/serial/s5pv310.c
 new file mode 100644
 index 000..1d466cf
 --- /dev/null
 +++ b/drivers/serial/s5pv310.c
 @@ -0,0 +1,124 @@
 +/* linux/drivers/serial/s5pv310.c
 + *
 + * Copyright (c) 2010 Samsung Electronics Co., Ltd.
 + *             http://www.samsung.com/
 + *
 + * Based on drivers/serial/s5pv210.c
 + *
 + * Driver for Samsung S5PV310 SoC UARTs.
 + *
 + * This program is free software; you can redistribute it and/or modify
 + * it under the terms of the GNU General Public License version 2 as
 + * published by the Free Software Foundation.
 +*/
 +
 +#include linux/module.h
 +#include linux/io.h
 +#include linux/platform_device.h
 +#include linux/serial_core.h
 +
 +#include plat/regs-serial.h
 +#include samsung.h
 +
 +static int s5pv310_serial_setsource(struct uart_port *port,
 +                                   struct s3c24xx_uart_clksrc *clk)
 +{
 +       /* for s5pv310, serial clock source is only uclk1 */
 +       return 0;
 +};
 +
 +static int s5pv310_serial_getsource(struct uart_port *port,
 +                                   struct s3c24xx_uart_clksrc *clk)
 +{
 +       /* for s5pv310, serial clock source is only uclk1 */
 +       clk-divisor = 1;
 +       clk-name = uclk1;
 +       return 0;
 +};
 +
 +static int s5pv310_serial_resetport(struct uart_port *port,
 +                                   struct s3c2410_uartcfg *cfg)
 +{
 +       wr_regl(port, S3C2410_UCON,  cfg-ucon);
 +       wr_regl(port, S3C2410_ULCON, cfg-ulcon);
 +
 +       /* reset both fifos */
 +       wr_regl(port, S3C2410_UFCON, cfg-ufcon | S3C2410_UFCON_RESETBOTH);
 +       wr_regl(port, S3C2410_UFCON, cfg-ufcon);
 +
 +       return 0;
 +}
 +
 +#define S5PV310_UART_DEFAULT_INFO(fifo_size)                   \
 +               .name           = Samsung S5PV310 UART,       \
 +               .type           = PORT_S3C6400,                 \
 +               .fifosize       = fifo_size,                    \
 +               .has_fracval    = 1,                            \
 +               .rx_fifomask    = S5PV210_UFSTAT_RXMASK,        \
 +               .rx_fifoshift   = S5PV210_UFSTAT_RXSHIFT,       \
 +               .rx_fifofull    = S5PV210_UFSTAT_RXFULL,        \
 +               .tx_fifofull    = S5PV210_UFSTAT_TXFULL,        \
 +               .tx_fifomask    = S5PV210_UFSTAT_TXMASK,        \
 +               .tx_fifoshift   = S5PV210_UFSTAT_TXSHIFT,       \
 +               .get_clksrc     = s5pv310_serial_getsource,     \
 +               .set_clksrc     = s5pv310_serial_setsource,     \
 +               .reset_port     = s5pv310_serial_resetport
 +
 +static struct s3c24xx_uart_info s5p_port_fifo256 = {
 +       S5PV310_UART_DEFAULT_INFO(256),
 +};
 +
 +static struct s3c24xx_uart_info s5p_port_fifo64 = {
 +       S5PV310_UART_DEFAULT_INFO(64),
 +};
 +
 +static struct s3c24xx_uart_info s5p_port_fifo16 = {
 +       S5PV310_UART_DEFAULT_INFO(16),
 +};
 +
 +struct s3c24xx_uart_info *s5p_uart_inf[] = {
 +       [0] = s5p_port_fifo256,
 +       [1] = s5p_port_fifo64,
 +       [2] = s5p_port_fifo16,
 +   

[PATCH]Framebuffer fix for SmartQ5

2010-07-01 Thread Patrick Georgi
Hi,

the following change makes the framebuffer work on SmartQ5. There are
still some problems with ADC, so this patch alone won't make the device
run (or even give a working fb), but it's one issue less to think about.

Signed-off-by: Patrick Georgi patr...@georgi-clan.de

diff --git a/arch/arm/mach-s3c64xx/mach-smartq5.c
b/arch/arm/mach-s3c64xx/mach-smartq5.c
index 1d0326e..27c2901 100644
--- a/arch/arm/mach-s3c64xx/mach-smartq5.c
+++ b/arch/arm/mach-s3c64xx/mach-smartq5.c
@@ -136,10 +136,10 @@ static struct s3c_fb_pd_win smartq5_fb_win0 = {
.win_mode   = {
.pixclock   = 1ULL /
((40+1+216+800)*(10+1+35+480)*80),
-   .left_margin= 40,
-   .right_margin   = 216,
-   .upper_margin   = 10,
-   .lower_margin   = 35,
+   .left_margin= 216,
+   .right_margin   = 40,
+   .upper_margin   = 35,
+   .lower_margin   = 10,
.hsync_len  = 1,
.vsync_len  = 1,
.xres   = 800,
--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/3] arm: s5pv210: Aquila: add support for MAX8998 PMIC

2010-07-01 Thread Mark Brown
On Thu, Jul 01, 2010 at 08:07:45AM +0200, Marek Szyprowski wrote:

 +static struct regulator_consumer_supply aquila_ldo3_consumers[] = {
 + {   .supply = VMIPI_1.1V, },
 +};

 +static struct regulator_consumer_supply aquila_ldo8_consumers[] = {
 + {   .supply = VADC_3.3V, },
 +};

Almost all of these regulator supplies should be removed.  Except in
some exceptional cases all supplies should specify a struct device (the
only one that really exists at the minute is CPU core due to lack of
devices for CPUfreq).  In general if you're defining a supply name that
is the same as the rail on the board rather than a pin on a chip you're
not using the API correctly.

If you want to label the supply for userspace do so in the constraints.

 + .constraints= {
 + .name   = VALIVE_1.1V,
 + .min_uV = 110,
 + .max_uV = 110,
 + .apply_uV   = 1,
 + .always_on  = 1,
 + .boot_on= 0,

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


Re: [PATCH 3/3] arm: s5pv210: GONI: add support for MAX8998 PMIC

2010-07-01 Thread Mark Brown
On Thu, Jul 01, 2010 at 08:07:46AM +0200, Marek Szyprowski wrote:

 +static struct regulator_consumer_supply goni_ldo3_consumers[] = {
 + {   .supply = VMIPI_1.1V, },
 +};

A similar issue to the previous patch applies here - you should be
defining consumers using struct device based lookups only.
--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/3] arm: s5pv210: Aquila: add support for MAX8998 PMIC

2010-07-01 Thread Mark Brown
On Thu, Jul 01, 2010 at 03:32:17PM +0200, Marek Szyprowski wrote:

 One more question - should I enable the regulators in the driver itself
 or in the platform callback (like a poweron() callback)?

I don't understand what you mean by platform callback.  Normally the
driver would unconditionally use the regulators.

 If I put regulator enabling into the driver how can one make it working
 on a board without regulators (chip powered all the time)? Should the
 driver ignore errors from regulator_get()?

No, check the errors.  The regulator API will stub itself out if it's
not enabled in Kconfig (which will happen on boards where it's not being
used at all), boards using a mixed configuration can use fixed voltage
regulators for static supplies and REGULATOR_DUMMY can also be used.

 What if one regulator needs enabling other to operate properly 
 (parent-child hierarchy)?

Set up supplies for the child regulators in their constraints.  This
isn't heavily tested at the minute but it should do the right thing for
you automatically in the core; if it doesn't work we can fix it up.
--
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