Skip to contentSkip to conversation

ARM: S5PC110: Samsung Goni board update

PATCH New Marek Szyprowski 3 participants 23 messages Sep 20, 2010 – Oct 4, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ARM: S5PC110: Samsung Goni board update

Hello,

This patch series updates the devices supported by Samsung Goni board. The patch series has been prepared against latest kgene/for-next kernel tree.

This is a second version of this patch series. It has been updated to fix the issues reported by Kukjin Kim and Mark Brown.

The complete list of patches:

[PATCHv2 1/7] ARM: S5PC110: update framebuffer setup information for Goni [PATCHv2 2/7] ARM: S5PC110: fb setup for Goni - remove pixel clock [PATCHv2 3/7] ARM: S5PC110: add support for S6E63M0 LCD controller on Goni board [PATCHv2 4/7] ARM: S5PC110: Add si470x radio device to the GONI board [PATCHv2 5/7] ARM: S5PV210: Enable USB HSOTG gadget build
[PATCHv2 6/7] ARM: S5PC110: add support for otg usb gadget on Goni board [PATCHv2 7/7] ARM: S5PC110: add support for MMC regulators on Goni board

Best regards

Signature · 2 lines
Marek Szyprowski
Samsung Poland R&D Center
#1 lore raw

PATCH v2 1/7 ARM: S5PC110: update framebuffer setup information for Goni

Change the default upper_margin and vsync_len to get rid of repeated last line on the display.

---
 arch/arm/mach-s5pv210/mach-goni.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-s5pv210/mach-goni.c +2 -2
index d9fe739..4bd5582 100644
@@ -91,10 +91,10 @@ static struct s3c_fb_pd_win goni_fb_win0 = {
 		.pixclock = 1000000000000ULL / ((16+16+2+480)*(28+3+2+800)*55),
 		.left_margin	= 16,
 		.right_margin	= 16,
-		.upper_margin	= 3,
+		.upper_margin	= 2,
 		.lower_margin	= 28,
 		.hsync_len	= 2,
-		.vsync_len	= 2,
+		.vsync_len	= 1,
 		.xres		= 480,
 		.yres		= 800,
 		.refresh	= 55,
Signature · 1 line
1.7.1.569.g6f426
#2 lore raw

PATCH v2 1/7 ARM: S5PC110: update framebuffer setup information for Goni

Review

Quoted 11 lines · Marek Szyprowski

Change the default upper_margin and vsync_len to get rid of repeated last line on the display.

---
 arch/arm/mach-s5pv210/mach-goni.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
(quoted diff) +0 -0

b/arch/arm/mach-s5pv210/mach-

Quoted 17 lines

goni.c
index d9fe739..4bd5582 100644

arch/arm/mach-s5pv210/mach-goni.c +2 -2
@@ -91,10 +91,10 @@ static struct s3c_fb_pd_win goni_fb_win0 = {
 		.pixclock = 1000000000000ULL /
 ((16+16+2+480)*(28+3+2+800)*55),
 		.left_margin	= 16,
 		.right_margin	= 16,
-		.upper_margin	= 3,
+		.upper_margin	= 2,
 		.lower_margin	= 28,
 		.hsync_len	= 2,
-		.vsync_len	= 2,
+		.vsync_len	= 1,
 		.xres		= 480,
 		.yres		= 800,
Quoted 2 lines

.refresh = 55,
--

This is better than your previous patch to me.

Will apply.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

#3 lore raw

PATCH v2 2/7 ARM: S5PC110: fb setup for Goni - remove pixel clock

In reply to Marek Szyprowski

Since commit 67a38950f0917aecfe1a3e46720d8bbb0020 there is no need to set pixel clock for the s3c-fb driver's window information. The correct pixel clock value can be automatically calculated from the other screen parameters. This patch removes the redundant pixel clock parameter.

---
 arch/arm/mach-s5pv210/mach-goni.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
arch/arm/mach-s5pv210/mach-goni.c +0 -1
index 4bd5582..b0ae208 100644
@@ -88,7 +88,6 @@ static struct s3c2410_uartcfg goni_uartcfgs[] __initdata = {
 /* Frame Buffer */
 static struct s3c_fb_pd_win goni_fb_win0 = {
 	.win_mode = {
-		.pixclock = 1000000000000ULL / ((16+16+2+480)*(28+3+2+800)*55),
 		.left_margin	= 16,
 		.right_margin	= 16,
 		.upper_margin	= 2,
Signature · 1 line
1.7.1.569.g6f426
#4 lore raw

PATCH v2 2/7 ARM: S5PC110: fb setup for Goni - remove pixel clock

Quoted 7 lines · Marek Szyprowski

Since commit 67a38950f0917aecfe1a3e46720d8bbb0020 there is no need to set pixel clock for the s3c-fb driver's window information. The correct pixel clock value can be automatically calculated from the other screen parameters. This patch removes the redundant pixel clock parameter.

Review

Quoted 7 lines
---
 arch/arm/mach-s5pv210/mach-goni.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
(quoted diff) +0 -0

b/arch/arm/mach-s5pv210/mach-

arch/arm/mach-s5pv210/mach-goni.c static struct s3c2410_uartcfg goni_uartcfgs[] __initdata

Quoted 5 lines

goni.c
index 4bd5582..b0ae208 100644

arch/arm/mach-s5pv210/mach-goni.c +0 -0
@@ -88,7 +88,6 @@ static struct s3c2410_uartcfg goni_uartcfgs[] __initdata

= {

Quoted 9 lines
arch/arm/mach-s5pv210/mach-goni.c +0 -1
 /* Frame Buffer */
 static struct s3c_fb_pd_win goni_fb_win0 = {
 	.win_mode = {
-		.pixclock = 1000000000000ULL /
 ((16+16+2+480)*(28+3+2+800)*55),
 		.left_margin	= 16,
 		.right_margin	= 16,

.upper_margin = 2,
--

Ok..will apply.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

#5 lore raw

PATCH v2 3/7 ARM: S5PC110: add support for S6E63M0 LCD controller on Goni board

In reply to Marek Szyprowski

Add required platform definitions for S6E63M0 LCD controller on Samsung Goni board.

---
 arch/arm/mach-s5pv210/mach-goni.c |   71 +++++++++++++++++++++++++++++++++++++
 1 files changed, 71 insertions(+), 0 deletions(-)
arch/arm/mach-s5pv210/mach-goni.c +71 -0
index b0ae208..b263f3a 100644
@@ -16,6 +16,9 @@
 #include <linux/i2c.h>
 #include <linux/i2c-gpio.h>
 #include <linux/mfd/max8998.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/spi_gpio.h>
+#include <linux/lcd.h>
 #include <linux/gpio_keys.h>
 #include <linux/input.h>
 #include <linux/gpio.h>
@@ -111,6 +114,70 @@ static struct s3c_fb_platdata goni_lcd_pdata __initdata = {
 	.setup_gpio	= s5pv210_fb_gpio_setup_24bpp,
 };
 
+static int lcd_power_on(struct lcd_device *ld, int enable)
+{
+	return 1;
+}
+
+static int reset_lcd(struct lcd_device *ld)
+{
+	static unsigned int first = 1;
+	int reset_gpio = -1;
+
+	reset_gpio = S5PV210_MP05(5);
+
+	if (first) {
+		gpio_request(reset_gpio, "MLCD_RST");
+		first = 0;
+	}
+
+	gpio_direction_output(reset_gpio, 1);
+	return 1;
+}
+
+static struct lcd_platform_data s6e63m0_platform_data = {
+	.reset			= reset_lcd,
+	.power_on		= lcd_power_on,
+	.lcd_enabled		= 0,
+
+	.reset_delay		= 120,	/* 120ms */
+	.power_on_delay		= 25,	/* 25ms */
+	.power_off_delay	= 200,	/* 200ms */
+};
+
+#define LCD_BUS_NUM	3
+#define DISPLAY_CS	S5PV210_MP01(1)
+static struct spi_board_info spi_board_info[] __initdata = {
+	{
+		.modalias	= "s6e63m0",
+		.platform_data	= (void *)&s6e63m0_platform_data,
+		.max_speed_hz	= 1200000,
+		.bus_num	= LCD_BUS_NUM,
+		.chip_select	= 0,
+		.mode		= SPI_MODE_3,
+		.controller_data = (void *)DISPLAY_CS,
+	},
+};
+
+#define DISPLAY_CLK	S5PV210_MP04(1)
+#define DISPLAY_SI	S5PV210_MP04(3)
+static struct spi_gpio_platform_data lcd_spi_gpio_data = {
+	.sck	= DISPLAY_CLK,
+	.mosi	= DISPLAY_SI,
+	.miso	= SPI_GPIO_NO_MISO,
+
+	.num_chipselect	= 1,
+};
+
+static struct platform_device goni_spi_gpio = {
+	.name	= "spi_gpio",
+	.id	= LCD_BUS_NUM,
+	.dev	= {
+		.parent		= &s3c_device_fb.dev,
+		.platform_data	= &lcd_spi_gpio_data,
+	},
+};
+
 /* KEYPAD */
 static uint32_t keymap[] __initdata = {
 	/* KEY(row, col, keycode) */
@@ -479,6 +546,7 @@ static void goni_setup_sdhci(void)
 static struct platform_device *goni_devices[] __initdata = {
 	&s3c_device_fb,
 	&s5p_device_onenand,
+	&goni_spi_gpio,
 	&goni_i2c_gpio_pmic,
 	&goni_device_gpiokeys,
 	&s5p_device_fimc0,
@@ -509,6 +577,9 @@ static void __init goni_machine_init(void)
 	/* FB */
 	s3c_fb_set_platdata(&goni_lcd_pdata);
 
+	/* SPI */
+	spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
+
 	/* KEYPAD */
 	samsung_keypad_set_platdata(&keypad_data);
 
Signature · 1 line
1.7.1.569.g6f426
#6 lore raw

PATCH v2 3/7 ARM: S5PC110: add support for S6E63M0 LCD controller on Goni board

Quoted 4 lines · Marek Szyprowski

Add required platform definitions for S6E63M0 LCD controller on Samsung Goni board.

Review

Quoted 8 lines
---
 arch/arm/mach-s5pv210/mach-goni.c |   71
+++++++++++++++++++++++++++++++++++++
 1 files changed, 71 insertions(+), 0 deletions(-)
(quoted diff) +0 -0

b/arch/arm/mach-s5pv210/mach-

arch/arm/mach-s5pv210/mach-goni.c static struct s3c_fb_platdata goni_lcd_pdata

Quoted 15 lines

goni.c
index b0ae208..b263f3a 100644

arch/arm/mach-s5pv210/mach-goni.c +3 -0
@@ -16,6 +16,9 @@
 #include <linux/i2c.h>
 #include <linux/i2c-gpio.h>
 #include <linux/mfd/max8998.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/spi_gpio.h>
+#include <linux/lcd.h>
 #include <linux/gpio_keys.h>
 #include <linux/input.h>
 #include <linux/gpio.h>
@@ -111,6 +114,70 @@ static struct s3c_fb_platdata goni_lcd_pdata

__initdata =

arch/arm/mach-s5pv210/mach-goni.c static struct s3c_fb_platdata goni_lcd_pdata __initdata = { · line 119

Quoted 7 lines
arch/arm/mach-s5pv210/mach-goni.c +3 -0
 {
 	.setup_gpio	= s5pv210_fb_gpio_setup_24bpp,
 };
 
+static int lcd_power_on(struct lcd_device *ld, int enable)
+{
+	return 1;

Always 1?

Quoted 7 lines
arch/arm/mach-s5pv210/mach-goni.c +7 -0
+}
+
+static int reset_lcd(struct lcd_device *ld)
+{
+	static unsigned int first = 1;
+	int reset_gpio = -1;
+

arch/arm/mach-s5pv210/mach-goni.c static struct s3c_fb_platdata goni_lcd_pdata __initdata = { · line 136

Quoted 10 lines
arch/arm/mach-s5pv210/mach-goni.c +10 -0
+	reset_gpio = S5PV210_MP05(5);
+
+	if (first) {
+		gpio_request(reset_gpio, "MLCD_RST");
+		first = 0;
+	}
+
+	gpio_direction_output(reset_gpio, 1);
+	return 1;
+}

Hmm...
Could you please explain about the functionality of above reset_lcd()?

Quoted 7 lines
arch/arm/mach-s5pv210/mach-goni.c +7 -0
+
+static struct lcd_platform_data s6e63m0_platform_data = {
+	.reset			= reset_lcd,
+	.power_on		= lcd_power_on,
+	.lcd_enabled		= 0,
+
+	.reset_delay		= 120,	/* 120ms */

arch/arm/mach-s5pv210/mach-goni.c static struct s3c_fb_platdata goni_lcd_pdata __initdata = { · line 153

Quoted 10 lines
arch/arm/mach-s5pv210/mach-goni.c +10 -0
+	.power_on_delay		= 25,	/* 25ms */
+	.power_off_delay	= 200,	/* 200ms */
+};
+
+#define LCD_BUS_NUM	3
+#define DISPLAY_CS	S5PV210_MP01(1)
+static struct spi_board_info spi_board_info[] __initdata = {
+	{
+		.modalias	= "s6e63m0",
+		.platform_data	= (void *)&s6e63m0_platform_data,
                                  ^^^^^^^^

No need.

Quoted 6 lines
arch/arm/mach-s5pv210/mach-goni.c +5 -0
+		.max_speed_hz	= 1200000,
+		.bus_num	= LCD_BUS_NUM,
+		.chip_select	= 0,
+		.mode		= SPI_MODE_3,
+		.controller_data = (void *)DISPLAY_CS,
 

arch/arm/mach-s5pv210/mach-goni.c static struct s3c_fb_platdata goni_lcd_pdata __initdata = { · line 166

Quoted 10 lines
arch/arm/mach-s5pv210/mach-goni.c +8 -0
 
 
+	},
+};
+
+#define DISPLAY_CLK	S5PV210_MP04(1)
+#define DISPLAY_SI	S5PV210_MP04(3)
+static struct spi_gpio_platform_data lcd_spi_gpio_data = {
+	.sck	= DISPLAY_CLK,
+	.mosi	= DISPLAY_SI,

How about use the S5PV210_MPXX directly with comment?

Quoted 26 lines
arch/arm/mach-s5pv210/mach-goni.c +15 -0
+	.miso	= SPI_GPIO_NO_MISO,
+
+	.num_chipselect	= 1,
+};
+
+static struct platform_device goni_spi_gpio = {
+	.name	= "spi_gpio",
+	.id	= LCD_BUS_NUM,
+	.dev	= {
+		.parent		= &s3c_device_fb.dev,
+		.platform_data	= &lcd_spi_gpio_data,
+	},
+};
+
 /* KEYPAD */
 static uint32_t keymap[] __initdata = {
 	/* KEY(row, col, keycode) */
@@ -479,6 +546,7 @@ static void goni_setup_sdhci(void)
 static struct platform_device *goni_devices[] __initdata = {
 	&s3c_device_fb,
 	&s5p_device_onenand,
+	&goni_spi_gpio,
 	&goni_i2c_gpio_pmic,
 	&goni_device_gpiokeys,
 	&s5p_device_fimc0,

arch/arm/mach-s5pv210/mach-goni.c static void __init goni_machine_init(void)

Quoted 10 lines
arch/arm/mach-s5pv210/mach-goni.c +3 -1
@@ -509,6 +577,9 @@ static void __init goni_machine_init(void)
 	/* FB */
 	s3c_fb_set_platdata(&goni_lcd_pdata);
 
+	/* SPI */
+	spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
+
 	/* KEYPAD */
 	samsung_keypad_set_platdata(&keypad_data);
 
--

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

#7 lore raw

PATCH v2 3/7 ARM: S5PC110: add support for S6E63M0 LCD controller on Goni board

Hello,

Quoted 34 lines · On Tuesday, September 28, 2010 9:39 AM wrote:
Quoted 4 lines · Marek Szyprowski

Add required platform definitions for S6E63M0 LCD controller on Samsung Goni board.

Review

Quoted 8 lines
---
 arch/arm/mach-s5pv210/mach-goni.c |   71
+++++++++++++++++++++++++++++++++++++
 1 files changed, 71 insertions(+), 0 deletions(-)
(quoted diff) +0 -0

b/arch/arm/mach-s5pv210/mach-

arch/arm/mach-s5pv210/mach-goni.c static struct s3c_fb_platdata goni_lcd_pdata

Quoted 15 lines

goni.c
index b0ae208..b263f3a 100644

arch/arm/mach-s5pv210/mach-goni.c +3 -0
@@ -16,6 +16,9 @@
 #include <linux/i2c.h>
 #include <linux/i2c-gpio.h>
 #include <linux/mfd/max8998.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/spi_gpio.h>
+#include <linux/lcd.h>
 #include <linux/gpio_keys.h>
 #include <linux/input.h>
 #include <linux/gpio.h>
@@ -111,6 +114,70 @@ static struct s3c_fb_platdata goni_lcd_pdata

__initdata =

Quoted 4 lines
arch/arm/mach-s5pv210/mach-goni.c +0 -0
 {
 	.setup_gpio	= s5pv210_fb_gpio_setup_24bpp,
 };
 
Quoted 5 lines

arch/arm/mach-s5pv210/mach-goni.c static struct s3c_fb_platdata goni_lcd_pdata __initdata = { · line 119

Quoted 3 lines
arch/arm/mach-s5pv210/mach-goni.c +3 -0
+static int lcd_power_on(struct lcd_device *ld, int enable)
+{
+	return 1;

Always 1?

Yes, currently LCD panel is always powered, so this function is just a stub. Lack of it would cause a different driver behavior.

Quoted 12 lines
Quoted 12 lines
arch/arm/mach-s5pv210/mach-goni.c +12 -0
+}
+
+static int reset_lcd(struct lcd_device *ld)
+{
+	static unsigned int first = 1;
+	int reset_gpio = -1;
+
+	reset_gpio = S5PV210_MP05(5);
+
+	if (first) {
+		gpio_request(reset_gpio, "MLCD_RST");
+		first = 0;
Quoted 8 lines

arch/arm/mach-s5pv210/mach-goni.c static struct s3c_fb_platdata goni_lcd_pdata __initdata = { · line 136

Quoted 5 lines
arch/arm/mach-s5pv210/mach-goni.c +5 -0
+	}
+
+	gpio_direction_output(reset_gpio, 1);
+	return 1;
+}

Hmm...
Could you please explain about the functionality of above reset_lcd()?

It sets the S5PV210_MP05(5) pin to value 1. This function can be called many times by the driver so a simple singleton template has been used.

Quoted 18 lines
Quoted 7 lines
arch/arm/mach-s5pv210/mach-goni.c +7 -0
+
+static struct lcd_platform_data s6e63m0_platform_data = {
+	.reset			= reset_lcd,
+	.power_on		= lcd_power_on,
+	.lcd_enabled		= 0,
+
+	.reset_delay		= 120,	/* 120ms */

arch/arm/mach-s5pv210/mach-goni.c static struct s3c_fb_platdata goni_lcd_pdata __initdata = { · line 153

Quoted 10 lines
arch/arm/mach-s5pv210/mach-goni.c +10 -0
+	.power_on_delay		= 25,	/* 25ms */
+	.power_off_delay	= 200,	/* 200ms */
+};
+
+#define LCD_BUS_NUM	3
+#define DISPLAY_CS	S5PV210_MP01(1)
+static struct spi_board_info spi_board_info[] __initdata = {
+	{
+		.modalias	= "s6e63m0",
+		.platform_data	= (void *)&s6e63m0_platform_data,
                                  ^^^^^^^^
Quoted 1 line

No need.

Right.

Quoted 9 lines
Quoted 6 lines
arch/arm/mach-s5pv210/mach-goni.c +5 -0
+		.max_speed_hz	= 1200000,
+		.bus_num	= LCD_BUS_NUM,
+		.chip_select	= 0,
+		.mode		= SPI_MODE_3,
+		.controller_data = (void *)DISPLAY_CS,
Quoted 10 lines

arch/arm/mach-s5pv210/mach-goni.c static struct s3c_fb_platdata goni_lcd_pdata __initdata = { · line 166

Quoted 8 lines
arch/arm/mach-s5pv210/mach-goni.c +8 -0
+	},
+};
+
+#define DISPLAY_CLK	S5PV210_MP04(1)
+#define DISPLAY_SI	S5PV210_MP04(3)
+static struct spi_gpio_platform_data lcd_spi_gpio_data = {
+	.sck	= DISPLAY_CLK,
+	.mosi	= DISPLAY_SI,

How about use the S5PV210_MPXX directly with comment?

Ok, no problem, I will resend a new version.

Quoted 30 lines
Quoted 30 lines
arch/arm/mach-s5pv210/mach-goni.c +14 -0
+	.miso	= SPI_GPIO_NO_MISO,
+
+	.num_chipselect	= 1,
+};
+
+static struct platform_device goni_spi_gpio = {
+	.name	= "spi_gpio",
+	.id	= LCD_BUS_NUM,
+	.dev	= {
+		.parent		= &s3c_device_fb.dev,
+		.platform_data	= &lcd_spi_gpio_data,
+	},
+};
+
 /* KEYPAD */
 static uint32_t keymap[] __initdata = {
arch/arm/mach-s5pv210/mach-goni.c +1 -0
 	/* KEY(row, col, keycode) */
@@ -479,6 +546,7 @@ static void goni_setup_sdhci(void)
 static struct platform_device *goni_devices[] __initdata = {
 	&s3c_device_fb,
 	&s5p_device_onenand,
+	&goni_spi_gpio,
 	&goni_i2c_gpio_pmic,
 	&goni_device_gpiokeys,
 	&s5p_device_fimc0,
@@ -509,6 +577,9 @@ static void __init goni_machine_init(void)
 	/* FB */
 	s3c_fb_set_platdata(&goni_lcd_pdata);
 
Quoted 5 lines

arch/arm/mach-s5pv210/mach-goni.c static void __init goni_machine_init(void) · line 584

Quoted 5 lines
arch/arm/mach-s5pv210/mach-goni.c +3 -0
+	/* SPI */
+	spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
+
 	/* KEYPAD */
 	samsung_keypad_set_platdata(&keypad_data);

Best regards
--
Marek Szyprowski
Samsung Poland R&D Center

#8 lore raw

PATCH v3 1/1 ARM: S5PC110: add support for S6E63M0 LCD controller on Goni board

In reply to Kukjin Kim

Add required platform definitions for S6E63M0 LCD controller on Samsung Goni board.

---

Changes since v2:
- removed defines for lcd pin names

 arch/arm/mach-s5pv210/mach-goni.c |   66 +++++++++++++++++++++++++++++++++++++
 1 files changed, 66 insertions(+), 0 deletions(-)
arch/arm/mach-s5pv210/mach-goni.c +66 -0
index b0ae208..ac6ebab 100644
@@ -16,6 +16,9 @@
 #include <linux/i2c.h>
 #include <linux/i2c-gpio.h>
 #include <linux/mfd/max8998.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/spi_gpio.h>
+#include <linux/lcd.h>
 #include <linux/gpio_keys.h>
 #include <linux/input.h>
 #include <linux/gpio.h>
@@ -111,6 +114,65 @@ static struct s3c_fb_platdata goni_lcd_pdata __initdata = {
 	.setup_gpio	= s5pv210_fb_gpio_setup_24bpp,
 };
 
+static int lcd_power_on(struct lcd_device *ld, int enable)
+{
+	return 1;
+}
+
+static int reset_lcd(struct lcd_device *ld)
+{
+	static unsigned int first = 1;
+	int reset_gpio = -1;
+
+	reset_gpio = S5PV210_MP05(5);
+
+	if (first) {
+		gpio_request(reset_gpio, "MLCD_RST");
+		first = 0;
+	}
+
+	gpio_direction_output(reset_gpio, 1);
+	return 1;
+}
+
+static struct lcd_platform_data s6e63m0_platform_data = {
+	.reset			= reset_lcd,
+	.power_on		= lcd_power_on,
+	.lcd_enabled		= 0,
+	.reset_delay		= 120,	/* 120ms */
+	.power_on_delay		= 25,	/* 25ms */
+	.power_off_delay	= 200,	/* 200ms */
+};
+
+#define LCD_BUS_NUM	3
+static struct spi_board_info spi_board_info[] __initdata = {
+	{
+		.modalias	= "s6e63m0",
+		.platform_data	= &goni_lcd_platform_data,
+		.max_speed_hz	= 1200000,
+		.bus_num	= LCD_BUS_NUM,
+		.chip_select	= 0,
+		.mode		= SPI_MODE_3,
+		.controller_data = (void *)S5PV210_MP01(1), /* DISPLAY_CS */
+	},
+};
+
+static struct spi_gpio_platform_data lcd_spi_gpio_data = {
+	.sck	= S5PV210_MP04(1), /* DISPLAY_CLK */
+	.mosi	= S5PV210_MP04(3), /* DISPLAY_SI */
+	.miso	= SPI_GPIO_NO_MISO,
+	.num_chipselect	= 1,
+};
+
+static struct platform_device goni_spi_gpio = {
+	.name	= "spi_gpio",
+	.id	= LCD_BUS_NUM,
+	.dev	= {
+		.parent		= &s3c_device_fb.dev,
+		.platform_data	= &lcd_spi_gpio_data,
+	},
+};
+
 /* KEYPAD */
 static uint32_t keymap[] __initdata = {
 	/* KEY(row, col, keycode) */
@@ -479,6 +541,7 @@ static void goni_setup_sdhci(void)
 static struct platform_device *goni_devices[] __initdata = {
 	&s3c_device_fb,
 	&s5p_device_onenand,
+	&goni_spi_gpio,
 	&goni_i2c_gpio_pmic,
 	&goni_device_gpiokeys,
 	&s5p_device_fimc0,
@@ -509,6 +572,9 @@ static void __init goni_machine_init(void)
 	/* FB */
 	s3c_fb_set_platdata(&goni_lcd_pdata);
 
+	/* SPI */
+	spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
+
 	/* KEYPAD */
 	samsung_keypad_set_platdata(&keypad_data);
 
Signature · 1 line
1.7.1.569.g6f426
#9 lore raw

PATCH v3 1/1 ARM: S5PC110: add support for S6E63M0 LCD controller on Goni board

Quoted 8 lines · Marek Szyprowski

Add required platform definitions for S6E63M0 LCD controller on Samsung Goni board.

---

Review

Quoted 8 lines

Changes since v2:
- removed defines for lcd pin names

 arch/arm/mach-s5pv210/mach-goni.c |   66
+++++++++++++++++++++++++++++++++++++
 1 files changed, 66 insertions(+), 0 deletions(-)
(quoted diff) +0 -0

b/arch/arm/mach-s5pv210/mach-

Quoted 4 lines

goni.c
index b0ae208..ac6ebab 100644

arch/arm/mach-s5pv210/mach-goni.c +0 -0

(snip)

Quoted 4 lines
arch/arm/mach-s5pv210/mach-goni.c +4 -0
+static struct lcd_platform_data s6e63m0_platform_data = {
+	.reset			= reset_lcd,
+	.power_on		= lcd_power_on,
+	.lcd_enabled		= 0,

arch/arm/mach-s5pv210/mach-goni.c static struct s3c_fb_platdata goni_lcd_pdata __initdata = { · line 151

Quoted 10 lines
arch/arm/mach-s5pv210/mach-goni.c +10 -0
+	.reset_delay		= 120,	/* 120ms */
+	.power_on_delay		= 25,	/* 25ms */
+	.power_off_delay	= 200,	/* 200ms */
+};
+
+#define LCD_BUS_NUM	3
+static struct spi_board_info spi_board_info[] __initdata = {
+	{
+		.modalias	= "s6e63m0",
+		.platform_data	= &goni_lcd_platform_data,

Happened following build error. arch/arm/mach-s5pv210/mach-goni.c:153: error: 'goni_lcd_platform_data' undeclared here (not in a function)

should be 's6e63m0_platform_data'?..let me know your preferred name. Will apply with changing it.

arch/arm/mach-s5pv210/mach-goni.c static struct s3c_fb_platdata goni_lcd_pdata __initdata = { · line 158

Quoted 7 lines
arch/arm/mach-s5pv210/mach-goni.c +7 -0
+		.max_speed_hz	= 1200000,
+		.bus_num	= LCD_BUS_NUM,
+		.chip_select	= 0,
+		.mode		= SPI_MODE_3,
+		.controller_data = (void *)S5PV210_MP01(1), /* DISPLAY_CS */
+	},
+};

(snip)

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

#10 lore raw

PATCH v3 1/1 ARM: S5PC110: add support for S6E63M0 LCD controller on Goni board

Hello,

Quoted 44 lines · Kukjin Kim
Quoted 8 lines · Marek Szyprowski

Add required platform definitions for S6E63M0 LCD controller on Samsung Goni board.

---

Review

Quoted 8 lines

Changes since v2:
- removed defines for lcd pin names

 arch/arm/mach-s5pv210/mach-goni.c |   66
+++++++++++++++++++++++++++++++++++++
 1 files changed, 66 insertions(+), 0 deletions(-)
(quoted diff) +0 -0

b/arch/arm/mach-s5pv210/mach-

Quoted 4 lines

goni.c
index b0ae208..ac6ebab 100644

arch/arm/mach-s5pv210/mach-goni.c +0 -0

(snip)

Quoted 4 lines
arch/arm/mach-s5pv210/mach-goni.c +4 -0
+static struct lcd_platform_data s6e63m0_platform_data = {
+	.reset			= reset_lcd,
+	.power_on		= lcd_power_on,
+	.lcd_enabled		= 0,

arch/arm/mach-s5pv210/mach-goni.c static struct s3c_fb_platdata goni_lcd_pdata __initdata = { · line 151

Quoted 10 lines
arch/arm/mach-s5pv210/mach-goni.c +10 -0
+	.reset_delay		= 120,	/* 120ms */
+	.power_on_delay		= 25,	/* 25ms */
+	.power_off_delay	= 200,	/* 200ms */
+};
+
+#define LCD_BUS_NUM	3
+static struct spi_board_info spi_board_info[] __initdata = {
+	{
+		.modalias	= "s6e63m0",
+		.platform_data	= &goni_lcd_platform_data,

Happened following build error. arch/arm/mach-s5pv210/mach-goni.c:153: error: 'goni_lcd_platform_data' undeclared here (not in a function)

Quoted 2 lines

should be 's6e63m0_platform_data'?..let me know your preferred name. Will apply with changing it.

goni_lcd_platform_data is ihmo more appropriate. I'm sorry again for a problem, looks that I mixed something up and I've sent a patch before final cleaning.

Quoted 9 lines
Quoted 7 lines
arch/arm/mach-s5pv210/mach-goni.c +7 -0
+		.max_speed_hz	= 1200000,
+		.bus_num	= LCD_BUS_NUM,
+		.chip_select	= 0,
+		.mode		= SPI_MODE_3,
+		.controller_data = (void *)S5PV210_MP01(1), /* DISPLAY_CS */
+	},
+};

(snip)

Best regards
--
Marek Szyprowski
Samsung Poland R&D Center

#11 lore raw

PATCH v2 4/7 ARM: S5PC110: Add si470x radio device to the GONI board

In reply to Marek Szyprowski

Add required platform definitions for si470x radio device on Samsung Goni board.

---
 arch/arm/mach-s5pv210/Kconfig     |    2 ++
 arch/arm/mach-s5pv210/mach-goni.c |   30 ++++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+), 0 deletions(-)
arch/arm/mach-s5pv210/Kconfig +2 -0
index b46925b..b1f671d 100644
@@ -83,9 +83,11 @@ config MACH_GONI
 	select S3C_DEV_HSMMC
 	select S3C_DEV_HSMMC1
 	select S3C_DEV_HSMMC2
+	select S3C_DEV_I2C1
 	select S5P_DEV_ONENAND
 	select SAMSUNG_DEV_KEYPAD
 	select S5PV210_SETUP_FB_24BPP
+	select S5PV210_SETUP_I2C1
 	select S5PV210_SETUP_KEYPAD
 	select S5PV210_SETUP_SDHCI
 	help
arch/arm/mach-s5pv210/mach-goni.c +30 -0
index b263f3a..5677c4d 100644
@@ -38,6 +38,7 @@
 #include <plat/devs.h>
 #include <plat/cpu.h>
 #include <plat/fb.h>
+#include <plat/iic.h>
 #include <plat/keypad.h>
 #include <plat/sdhci.h>
 
@@ -200,6 +201,27 @@ static struct samsung_keypad_platdata keypad_data __initdata = {
 	.cols		= 3,
 };
 
+/* Radio */
+static struct i2c_board_info i2c1_devs[] __initdata = {
+	{
+		I2C_BOARD_INFO("si470x", 0x10),
+	},
+};
+
+static void __init goni_radio_init(void)
+{
+	int gpio;
+
+	gpio = S5PV210_GPJ2(4);			/* XMSMDATA_4 */
+	gpio_request(gpio, "FM_INT");
+	s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf));
+	i2c1_devs[0].irq = gpio_to_irq(gpio);
+
+	gpio = S5PV210_GPJ2(5);			/* XMSMDATA_5 */
+	gpio_request(gpio, "FM_RST");
+	gpio_direction_output(gpio, 1);
+}
+
 /* MAX8998 regulators */
 #if defined(CONFIG_REGULATOR_MAX8998) || defined(CONFIG_REGULATOR_MAX8998_MODULE)
 
@@ -556,6 +578,7 @@ static struct platform_device *goni_devices[] __initdata = {
 	&s3c_device_hsmmc1,
 	&s3c_device_hsmmc2,
 	&samsung_device_keypad,
+	&s3c_device_i2c1,
 };
 
 static void __init goni_map_io(void)
@@ -567,6 +590,13 @@ static void __init goni_map_io(void)
 
 static void __init goni_machine_init(void)
 {
+	/* Radio: call before I2C 1 registeration */
+	goni_radio_init();
+
+	/* I2C1 */
+	s3c_i2c1_set_platdata(NULL);
+	i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs));
+
 	/* PMIC */
 	goni_pmic_init();
 	i2c_register_board_info(AP_I2C_GPIO_PMIC_BUS_4, i2c_gpio_pmic_devs,
Signature · 1 line
1.7.1.569.g6f426
#12 lore raw

PATCH v2 4/7 ARM: S5PC110: Add si470x radio device to the GONI board

Review

Quoted 30 lines · Marek Szyprowski

Add required platform definitions for si470x radio device on Samsung Goni board.

---
 arch/arm/mach-s5pv210/Kconfig     |    2 ++
 arch/arm/mach-s5pv210/mach-goni.c |   30
++++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+), 0 deletions(-)
arch/arm/mach-s5pv210/Kconfig +2 -0
index b46925b..b1f671d 100644
@@ -83,9 +83,11 @@ config MACH_GONI
 	select S3C_DEV_HSMMC
 	select S3C_DEV_HSMMC1
 	select S3C_DEV_HSMMC2
+	select S3C_DEV_I2C1
 	select S5P_DEV_ONENAND
 	select SAMSUNG_DEV_KEYPAD
 	select S5PV210_SETUP_FB_24BPP
+	select S5PV210_SETUP_I2C1
 	select S5PV210_SETUP_KEYPAD
 	select S5PV210_SETUP_SDHCI
 	help
(quoted diff) +0 -0

b/arch/arm/mach-s5pv210/mach-

Quoted 20 lines

goni.c
index b263f3a..5677c4d 100644

arch/arm/mach-s5pv210/mach-goni.c +4 -0
@@ -38,6 +38,7 @@
 #include <plat/devs.h>
 #include <plat/cpu.h>
 #include <plat/fb.h>
+#include <plat/iic.h>
 #include <plat/keypad.h>
 #include <plat/sdhci.h>
 
@@ -200,6 +201,27 @@ static struct samsung_keypad_platdata keypad_data
 __initdata = {
 	.cols		= 3,
 };
 
+/* Radio */
+static struct i2c_board_info i2c1_devs[] __initdata = {
+	{

arch/arm/mach-s5pv210/mach-goni.c static struct samsung_keypad_platdata keypad_data · line 217

Quoted 10 lines
arch/arm/mach-s5pv210/mach-goni.c +10 -0
+		I2C_BOARD_INFO("si470x", 0x10),
+	},
+};
+
+static void __init goni_radio_init(void)
+{
+	int gpio;
+
+	gpio = S5PV210_GPJ2(4);			/* XMSMDATA_4 */
+	gpio_request(gpio, "FM_INT");

If returned fail?

arch/arm/mach-s5pv210/mach-goni.c static struct samsung_keypad_platdata keypad_data __initdata = { · line 218

Quoted 2 lines
arch/arm/mach-s5pv210/mach-goni.c +2 -0
+	s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf));
+	i2c1_devs[0].irq = gpio_to_irq(gpio);

Need to sort out gpio interrupt stuff for this.

Anyway, will check it soon.

arch/arm/mach-s5pv210/mach-goni.c static struct samsung_keypad_platdata keypad_data __initdata = { · line 221

Quoted 3 lines
arch/arm/mach-s5pv210/mach-goni.c +3 -0
+
+	gpio = S5PV210_GPJ2(5);			/* XMSMDATA_5 */
+	gpio_request(gpio, "FM_RST");

Same.

arch/arm/mach-s5pv210/mach-goni.c static struct platform_device *goni_devices[]

Quoted 8 lines
arch/arm/mach-s5pv210/mach-goni.c +3 -0
+	gpio_direction_output(gpio, 1);
+}
+
 /* MAX8998 regulators */
 #if defined(CONFIG_REGULATOR_MAX8998) ||

defined(CONFIG_REGULATOR_MAX8998_MODULE)

arch/arm/mach-s5pv210/mach-goni.c +0 -0
@@ -556,6 +578,7 @@ static struct platform_device *goni_devices[]

__initdata = {

Quoted 21 lines
arch/arm/mach-s5pv210/mach-goni.c +8 -0
 	&s3c_device_hsmmc1,
 	&s3c_device_hsmmc2,
 	&samsung_device_keypad,
+	&s3c_device_i2c1,
 };
 
 static void __init goni_map_io(void)
@@ -567,6 +590,13 @@ static void __init goni_map_io(void)
 
 static void __init goni_machine_init(void)
 {
+	/* Radio: call before I2C 1 registeration */
+	goni_radio_init();
+
+	/* I2C1 */
+	s3c_i2c1_set_platdata(NULL);
+	i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs));
+
 	/* PMIC */
 	goni_pmic_init();
 	i2c_register_board_info(AP_I2C_GPIO_PMIC_BUS_4,
Quoted 2 lines

i2c_gpio_pmic_devs,
--

Others, looks ok.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

#13 lore raw

PATCH v2 4/7 ARM: S5PC110: Add si470x radio device to the GONI board

Hello,

Quoted 49 lines · Kukjin Kim

Review

Quoted 30 lines · Marek Szyprowski

Add required platform definitions for si470x radio device on Samsung Goni board.

---
 arch/arm/mach-s5pv210/Kconfig     |    2 ++
 arch/arm/mach-s5pv210/mach-goni.c |   30
++++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+), 0 deletions(-)
arch/arm/mach-s5pv210/Kconfig +2 -0
index b46925b..b1f671d 100644
@@ -83,9 +83,11 @@ config MACH_GONI
 	select S3C_DEV_HSMMC
 	select S3C_DEV_HSMMC1
 	select S3C_DEV_HSMMC2
+	select S3C_DEV_I2C1
 	select S5P_DEV_ONENAND
 	select SAMSUNG_DEV_KEYPAD
 	select S5PV210_SETUP_FB_24BPP
+	select S5PV210_SETUP_I2C1
 	select S5PV210_SETUP_KEYPAD
 	select S5PV210_SETUP_SDHCI
 	help
(quoted diff) +0 -0

b/arch/arm/mach-s5pv210/mach-

Quoted 17 lines

goni.c
index b263f3a..5677c4d 100644

arch/arm/mach-s5pv210/mach-goni.c +1 -0
@@ -38,6 +38,7 @@
 #include <plat/devs.h>
 #include <plat/cpu.h>
 #include <plat/fb.h>
+#include <plat/iic.h>
 #include <plat/keypad.h>
 #include <plat/sdhci.h>
 
@@ -200,6 +201,27 @@ static struct samsung_keypad_platdata keypad_data
 __initdata = {
 	.cols		= 3,
 };
 
Quoted 15 lines

arch/arm/mach-s5pv210/mach-goni.c static struct samsung_keypad_platdata keypad_data __initdata = { · line 216

Quoted 13 lines
arch/arm/mach-s5pv210/mach-goni.c +13 -0
+/* Radio */
+static struct i2c_board_info i2c1_devs[] __initdata = {
+	{
+		I2C_BOARD_INFO("si470x", 0x10),
+	},
+};
+
+static void __init goni_radio_init(void)
+{
+	int gpio;
+
+	gpio = S5PV210_GPJ2(4);			/* XMSMDATA_4 */
+	gpio_request(gpio, "FM_INT");

If returned fail?

Then there is something seriously wrong either with the platform or machine startup code.

It is quite common to omit a check in the machine init code. Just take a look at mach-s3c64xx/mach-smdk6410.c, smdk6410_machine_init() function. Lack of checks here doesn't really have ANY impact on the stability of the kernel imho.

Quoted 4 lines

arch/arm/mach-s5pv210/mach-goni.c static struct samsung_keypad_platdata keypad_data __initdata = { · line 218

Quoted 2 lines
arch/arm/mach-s5pv210/mach-goni.c +2 -0
+	s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf));
+	i2c1_devs[0].irq = gpio_to_irq(gpio);

Need to sort out gpio interrupt stuff for this.

Right, forgot that this also requires interrupt support for gpio. This definitely shows how important the gpio interrupt patches are and how much is blocked because they are still no merged or even commented yet.

Quoted 27 lines

Anyway, will check it soon.

arch/arm/mach-s5pv210/mach-goni.c static struct samsung_keypad_platdata keypad_data __initdata = { · line 221

Quoted 3 lines
arch/arm/mach-s5pv210/mach-goni.c +3 -0
+
+	gpio = S5PV210_GPJ2(5);			/* XMSMDATA_5 */
+	gpio_request(gpio, "FM_RST");

Same.

arch/arm/mach-s5pv210/mach-goni.c static struct platform_device *goni_devices[]

Quoted 8 lines
arch/arm/mach-s5pv210/mach-goni.c +3 -0
+	gpio_direction_output(gpio, 1);
+}
+
 /* MAX8998 regulators */
 #if defined(CONFIG_REGULATOR_MAX8998) ||

defined(CONFIG_REGULATOR_MAX8998_MODULE)

arch/arm/mach-s5pv210/mach-goni.c +0 -0
@@ -556,6 +578,7 @@ static struct platform_device *goni_devices[]

__initdata = {

Quoted 9 lines
arch/arm/mach-s5pv210/mach-goni.c +1 -0
 	&s3c_device_hsmmc1,
 	&s3c_device_hsmmc2,
 	&samsung_device_keypad,
+	&s3c_device_i2c1,
 };
 
 static void __init goni_map_io(void)
@@ -567,6 +590,13 @@ static void __init goni_map_io(void)
 
Quoted 17 lines
Quoted 12 lines
arch/arm/mach-s5pv210/mach-goni.c +7 -0
 static void __init goni_machine_init(void)
 {
+	/* Radio: call before I2C 1 registeration */
+	goni_radio_init();
+
+	/* I2C1 */
+	s3c_i2c1_set_platdata(NULL);
+	i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs));
+
 	/* PMIC */
 	goni_pmic_init();
 	i2c_register_board_info(AP_I2C_GPIO_PMIC_BUS_4,
Quoted 2 lines

i2c_gpio_pmic_devs,
--

Others, looks ok.

Best regards
--
Marek Szyprowski
Samsung Poland R&D Center

#14 lore raw

PATCH v2 4/7 ARM: S5PC110: Add si470x radio device to the GONI board

Quoted 3 lines · Marek Szyprowski

Hello,

Hi ;-)

Quoted 16 lines · Kukjin Kim
Quoted 15 lines
Quoted 13 lines · Marek Szyprowski

Add required platform definitions for si470x radio device on Samsung Goni board.

---
 arch/arm/mach-s5pv210/Kconfig     |    2 ++
 arch/arm/mach-s5pv210/mach-goni.c |   30
++++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+), 0 deletions(-)
Quoted 1 line
Quoted 1 line

Review

Quoted 1 line
(quoted diff) +0 -0

b/arch/arm/mach-s5pv210/Kconfig

Quoted 50 lines
Quoted 34 lines

Review

Quoted 16 lines

index b46925b..b1f671d 100644

arch/arm/mach-s5pv210/Kconfig +2 -0
@@ -83,9 +83,11 @@ config MACH_GONI
 	select S3C_DEV_HSMMC
 	select S3C_DEV_HSMMC1
 	select S3C_DEV_HSMMC2
+	select S3C_DEV_I2C1
 	select S5P_DEV_ONENAND
 	select SAMSUNG_DEV_KEYPAD
 	select S5PV210_SETUP_FB_24BPP
+	select S5PV210_SETUP_I2C1
 	select S5PV210_SETUP_KEYPAD
 	select S5PV210_SETUP_SDHCI
 	help
(quoted diff) +0 -0

b/arch/arm/mach-s5pv210/mach-

Quoted 17 lines

goni.c
index b263f3a..5677c4d 100644

arch/arm/mach-s5pv210/mach-goni.c +1 -0
@@ -38,6 +38,7 @@
 #include <plat/devs.h>
 #include <plat/cpu.h>
 #include <plat/fb.h>
+#include <plat/iic.h>
 #include <plat/keypad.h>
 #include <plat/sdhci.h>
 
@@ -200,6 +201,27 @@ static struct samsung_keypad_platdata keypad_data
 __initdata = {
 	.cols		= 3,
 };
 
Quoted 15 lines

arch/arm/mach-s5pv210/mach-goni.c static struct samsung_keypad_platdata keypad_data __initdata = { · line 216

Quoted 13 lines
arch/arm/mach-s5pv210/mach-goni.c +13 -0
+/* Radio */
+static struct i2c_board_info i2c1_devs[] __initdata = {
+	{
+		I2C_BOARD_INFO("si470x", 0x10),
+	},
+};
+
+static void __init goni_radio_init(void)
+{
+	int gpio;
+
+	gpio = S5PV210_GPJ2(4);			/* XMSMDATA_4 */
+	gpio_request(gpio, "FM_INT");

If returned fail?

Quoted 1 line

Then there is something seriously wrong either with the platform or

machine

Quoted 3 lines

startup code.

It is quite common to omit a check in the machine init code. Just take a

look

Quoted 2 lines

at mach-s3c64xx/mach-smdk6410.c, smdk6410_machine_init() function. Lack of checks here doesn't really have ANY impact on the stability of the kernel

imho.

Quoted 1 line

Yeah...right now in our codes, something checked the returning of gpio_request, and others not and the board designer already know where it is used.

Hmm...I'm not sure which is better to us...but is it better there is exception/error handling?
Or...is it useless code?

Quoted 9 lines
Quoted 4 lines

arch/arm/mach-s5pv210/mach-goni.c static struct samsung_keypad_platdata keypad_data __initdata = { · line 218

Quoted 2 lines
arch/arm/mach-s5pv210/mach-goni.c +2 -0
+	s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf));
+	i2c1_devs[0].irq = gpio_to_irq(gpio);

Need to sort out gpio interrupt stuff for this.

Right, forgot that this also requires interrupt support for gpio. This definitely shows how important the gpio interrupt patches are and how much is blocked because they are still no merged or even commented yet.

Yes, I'm reviewing your '[PATCH 1/6] ARM: Samsung: Add common s5p gpio interrupt support'...and not finished yet..
But I have to leave office now...it's late here...

I will continue it tomorrow morning.

Quoted 36 lines
Quoted 36 lines

Anyway, will check it soon.

arch/arm/mach-s5pv210/mach-goni.c static struct samsung_keypad_platdata keypad_data __initdata = { · line 221

Quoted 3 lines
arch/arm/mach-s5pv210/mach-goni.c +3 -0
+
+	gpio = S5PV210_GPJ2(5);			/* XMSMDATA_5 */
+	gpio_request(gpio, "FM_RST");

Same.

arch/arm/mach-s5pv210/mach-goni.c static struct platform_device *goni_devices[]

Quoted 8 lines
arch/arm/mach-s5pv210/mach-goni.c +3 -0
+	gpio_direction_output(gpio, 1);
+}
+
 /* MAX8998 regulators */
 #if defined(CONFIG_REGULATOR_MAX8998) ||

defined(CONFIG_REGULATOR_MAX8998_MODULE)

arch/arm/mach-s5pv210/mach-goni.c +0 -0
@@ -556,6 +578,7 @@ static struct platform_device *goni_devices[]

__initdata = {

Quoted 18 lines
arch/arm/mach-s5pv210/mach-goni.c +8 -0
 	&s3c_device_hsmmc1,
 	&s3c_device_hsmmc2,
 	&samsung_device_keypad,
+	&s3c_device_i2c1,
 };
 
 static void __init goni_map_io(void)
@@ -567,6 +590,13 @@ static void __init goni_map_io(void)
 
 static void __init goni_machine_init(void)
 {
+	/* Radio: call before I2C 1 registeration */
+	goni_radio_init();
+
+	/* I2C1 */
+	s3c_i2c1_set_platdata(NULL);
+	i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs));
+
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
arch/arm/mach-s5pv210/mach-goni.c +0 -0
 	/* PMIC */
 	goni_pmic_init();
 	i2c_register_board_info(AP_I2C_GPIO_PMIC_BUS_4,

i2c_gpio_pmic_devs,
--

Others, looks ok.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

#15 lore raw

PATCH v2 4/7 ARM: S5PC110: Add si470x radio device to the GONI board

Hello,

Quoted 78 lines · Kukjin Kim
Quoted 16 lines · Kukjin Kim
Quoted 15 lines
Quoted 13 lines · Marek Szyprowski

Add required platform definitions for si470x radio device on Samsung Goni board.

---
 arch/arm/mach-s5pv210/Kconfig     |    2 ++
 arch/arm/mach-s5pv210/mach-goni.c |   30
++++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+), 0 deletions(-)
Quoted 1 line
Quoted 1 line

Review

Quoted 1 line
(quoted diff) +0 -0

b/arch/arm/mach-s5pv210/Kconfig

Quoted 50 lines
Quoted 34 lines

Review

Quoted 16 lines

index b46925b..b1f671d 100644

arch/arm/mach-s5pv210/Kconfig +2 -0
@@ -83,9 +83,11 @@ config MACH_GONI
 	select S3C_DEV_HSMMC
 	select S3C_DEV_HSMMC1
 	select S3C_DEV_HSMMC2
+	select S3C_DEV_I2C1
 	select S5P_DEV_ONENAND
 	select SAMSUNG_DEV_KEYPAD
 	select S5PV210_SETUP_FB_24BPP
+	select S5PV210_SETUP_I2C1
 	select S5PV210_SETUP_KEYPAD
 	select S5PV210_SETUP_SDHCI
 	help
(quoted diff) +0 -0

b/arch/arm/mach-s5pv210/mach-

Quoted 17 lines

goni.c
index b263f3a..5677c4d 100644

arch/arm/mach-s5pv210/mach-goni.c +1 -0
@@ -38,6 +38,7 @@
 #include <plat/devs.h>
 #include <plat/cpu.h>
 #include <plat/fb.h>
+#include <plat/iic.h>
 #include <plat/keypad.h>
 #include <plat/sdhci.h>
 
@@ -200,6 +201,27 @@ static struct samsung_keypad_platdata keypad_data
 __initdata = {
 	.cols		= 3,
 };
 
Quoted 15 lines

arch/arm/mach-s5pv210/mach-goni.c static struct samsung_keypad_platdata keypad_data __initdata = { · line 216

Quoted 13 lines
arch/arm/mach-s5pv210/mach-goni.c +13 -0
+/* Radio */
+static struct i2c_board_info i2c1_devs[] __initdata = {
+	{
+		I2C_BOARD_INFO("si470x", 0x10),
+	},
+};
+
+static void __init goni_radio_init(void)
+{
+	int gpio;
+
+	gpio = S5PV210_GPJ2(4);			/* XMSMDATA_4 */
+	gpio_request(gpio, "FM_INT");

If returned fail?

Quoted 1 line

Then there is something seriously wrong either with the platform or

machine

Quoted 3 lines

startup code.

It is quite common to omit a check in the machine init code. Just take a

look

Quoted 2 lines

at mach-s3c64xx/mach-smdk6410.c, smdk6410_machine_init() function. Lack of checks here doesn't really have ANY impact on the stability of the kernel

imho.

Quoted 1 line
Quoted 7 lines

Yeah...right now in our codes, something checked the returning of gpio_request, and others not and the board designer already know where it is used.

Hmm...I'm not sure which is better to us...but is it better there is exception/error handling?
Or...is it useless code?

IMHO such code is useless. If requesting a gpio fails then the kernel will throw an ops or warning on the first use of that gpio pin, so the board designer will know that something is really wrong there.

Best regards
--
Marek Szyprowski
Samsung Poland R&D Center

#16 lore raw

PATCH v2 5/7 ARM: S5PV210: Enable USB HSOTG gadget build

In reply to Marek Szyprowski

Add the necessary definitions and mapping information to enable the s3c-hsotg gadget to build.

s5pv210 otg

---
 arch/arm/mach-s5pv210/cpu.c                   |    5 +++++
 arch/arm/mach-s5pv210/include/mach/map.h      |    4 ++++
 arch/arm/mach-s5pv210/include/mach/regs-sys.h |   19 +++++++++++++++++++
 arch/arm/plat-s5p/include/plat/map-s5p.h      |    1 +
 4 files changed, 29 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-s5pv210/include/mach/regs-sys.h
arch/arm/mach-s5pv210/cpu.c +5 -0
index c551ab1..8e4a39f 100644
@@ -84,6 +84,11 @@ static struct map_desc s5pv210_iodesc[] __initdata = {
 		.pfn		= __phys_to_pfn(S5PV210_PA_SROMC),
 		.length		= SZ_4K,
 		.type		= MT_DEVICE,
+	}, {
+		.virtual	= (unsigned long)S3C_VA_USB_HSPHY,
+		.pfn		=__phys_to_pfn(S5PV210_PA_HSPHY),
+		.length		= SZ_4K,
+		.type		= MT_DEVICE,
 	}
 };
 
arch/arm/mach-s5pv210/include/mach/map.h +4 -0
index b86d040..abe20d0 100644
@@ -73,6 +73,9 @@
 
 #define S5PV210_PA_HSMMC(x)	(0xEB000000 + ((x) * 0x100000))
 
+#define S5PV210_PA_HSOTG	(0xEC000000)
+#define S5PV210_PA_HSPHY	(0xEC100000)
+
 #define S5PV210_PA_VIC0		(0xF2000000)
 #define S5PV210_PA_VIC1		(0xF2100000)
 #define S5PV210_PA_VIC2		(0xF2200000)
@@ -108,6 +111,7 @@
 #define S3C_PA_FB		S5PV210_PA_FB
 #define S3C_PA_RTC		S5PV210_PA_RTC
 #define S3C_PA_WDT		S5PV210_PA_WATCHDOG
+#define S3C_PA_USB_HSOTG	S5PV210_PA_HSOTG
 #define S5P_PA_FIMC0		S5PV210_PA_FIMC0
 #define S5P_PA_FIMC1		S5PV210_PA_FIMC1
 #define S5P_PA_FIMC2		S5PV210_PA_FIMC2
arch/arm/mach-s5pv210/include/mach/regs-sys.h new file +19 -0
new file mode 100644
index 0000000..26691d3
@@ -0,0 +1,19 @@
+/* arch/arm/mach-s5pv210/include/mach/regs-sys.h
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com/
+ *
+ * S5PV210 - System registers definitions
+ *
+ * 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.
+*/
+
+#define S5PV210_USB_PHY_CON	(S3C_VA_SYS + 0xE80C)
+#define S5PV210_USB_PHY0_EN	(1 << 0)
+#define S5PV210_USB_PHY1_EN	(1 << 1)
+
+/* compatibility defines for s3c-hsotg driver */
+#define S3C64XX_OTHERS		S5PV210_USB_PHY_CON
+#define S3C64XX_OTHERS_USBMASK	S5PV210_USB_PHY0_EN
arch/arm/plat-s5p/include/plat/map-s5p.h +1 -0
index c4ff88b..dc5bce9 100644
@@ -18,6 +18,7 @@
 #define S5P_VA_SYSTIMER		S3C_ADDR(0x01200000)
 #define S5P_VA_SROMC		S3C_ADDR(0x01100000)
 #define S5P_VA_SYSRAM		S3C_ADDR(0x01180000)
+#define S3C_VA_USB_HSPHY	S3C_ADDR(0x02000000)
 
 #define S5P_VA_COMBINER_BASE	S3C_ADDR(0x00600000)
 #define S5P_VA_COMBINER(x)	(S5P_VA_COMBINER_BASE + ((x) >> 2) * 0x10)
Signature · 1 line
1.7.1.569.g6f426
#17 lore raw

PATCH v2 5/7 ARM: S5PV210: Enable USB HSOTG gadget build

Quoted 8 lines · Marek

Add the necessary definitions and mapping information to enable the s3c-hsotg gadget to build.

s5pv210 otg

Maybe miss typing? ;-)

Review

Quoted 49 lines
---
 arch/arm/mach-s5pv210/cpu.c                   |    5 +++++
 arch/arm/mach-s5pv210/include/mach/map.h      |    4 ++++
 arch/arm/mach-s5pv210/include/mach/regs-sys.h |   19
+++++++++++++++++++
 arch/arm/plat-s5p/include/plat/map-s5p.h      |    1 +
 4 files changed, 29 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-s5pv210/include/mach/regs-sys.h
arch/arm/mach-s5pv210/cpu.c +5 -0
index c551ab1..8e4a39f 100644
@@ -84,6 +84,11 @@ static struct map_desc s5pv210_iodesc[] __initdata = {
 		.pfn		= __phys_to_pfn(S5PV210_PA_SROMC),
 		.length		= SZ_4K,
 		.type		= MT_DEVICE,
+	}, {
+		.virtual	= (unsigned long)S3C_VA_USB_HSPHY,
+		.pfn		=__phys_to_pfn(S5PV210_PA_HSPHY),
+		.length		= SZ_4K,
+		.type		= MT_DEVICE,
 	}
 };
 
arch/arm/mach- renamed from arch/arm/mach-s5pv210/include/mach/map.h +0 -0

s5pv210/include/mach/map.h
index b86d040..abe20d0 100644

arch/arm/mach-s5pv210/include/mach/map.h +4 -0
@@ -73,6 +73,9 @@
 
 #define S5PV210_PA_HSMMC(x)	(0xEB000000 + ((x) * 0x100000))
 
+#define S5PV210_PA_HSOTG	(0xEC000000)
+#define S5PV210_PA_HSPHY	(0xEC100000)
+
 #define S5PV210_PA_VIC0		(0xF2000000)
 #define S5PV210_PA_VIC1		(0xF2100000)
 #define S5PV210_PA_VIC2		(0xF2200000)
@@ -108,6 +111,7 @@
 #define S3C_PA_FB		S5PV210_PA_FB
 #define S3C_PA_RTC		S5PV210_PA_RTC
 #define S3C_PA_WDT		S5PV210_PA_WATCHDOG
+#define S3C_PA_USB_HSOTG	S5PV210_PA_HSOTG
 #define S5P_PA_FIMC0		S5PV210_PA_FIMC0
 #define S5P_PA_FIMC1		S5PV210_PA_FIMC1
 #define S5P_PA_FIMC2		S5PV210_PA_FIMC2
(quoted diff) +0 -0

b/arch/arm/mach-

Quoted 38 lines

s5pv210/include/mach/regs-sys.h
new file mode 100644
index 0000000..26691d3

arch/arm/mach-s5pv210/include/mach/regs-sys.h new file +19 -0
@@ -0,0 +1,19 @@
+/* arch/arm/mach-s5pv210/include/mach/regs-sys.h
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com/
+ *
+ * S5PV210 - System registers definitions
+ *
+ * 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.
+*/
+
+#define S5PV210_USB_PHY_CON	(S3C_VA_SYS + 0xE80C)
+#define S5PV210_USB_PHY0_EN	(1 << 0)
+#define S5PV210_USB_PHY1_EN	(1 << 1)
+
+/* compatibility defines for s3c-hsotg driver */
+#define S3C64XX_OTHERS		S5PV210_USB_PHY_CON
+#define S3C64XX_OTHERS_USBMASK	S5PV210_USB_PHY0_EN
arch/arm/plat- renamed from arch/arm/plat-s5p/include/plat/map-s5p.h +0 -0

s5p/include/plat/map-s5p.h
index c4ff88b..dc5bce9 100644

arch/arm/plat-s5p/include/plat/map-s5p.h +1 -0
@@ -18,6 +18,7 @@
 #define S5P_VA_SYSTIMER		S3C_ADDR(0x01200000)
 #define S5P_VA_SROMC		S3C_ADDR(0x01100000)
 #define S5P_VA_SYSRAM		S3C_ADDR(0x01180000)
+#define S3C_VA_USB_HSPHY	S3C_ADDR(0x02000000)
 
 #define S5P_VA_COMBINER_BASE	S3C_ADDR(0x00600000)
 #define S5P_VA_COMBINER(x)	(S5P_VA_COMBINER_BASE + ((x) >> 2) *
Quoted 2 lines

0x10)
--

Looks ok...will apply with removing above miss typing.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

#18 lore raw

PATCH v2 6/7 ARM: S5PC110: add support for otg usb gadget on Goni board

In reply to Marek Szyprowski

Add required platform definitions for s3c-hsotg driver to enable usb gadget support on Samsung Goni board.

---
 arch/arm/mach-s5pv210/Kconfig     |    1 +
 arch/arm/mach-s5pv210/mach-goni.c |    4 ++++
 2 files changed, 5 insertions(+), 0 deletions(-)
arch/arm/mach-s5pv210/Kconfig +1 -0
index b1f671d..f8bac5a 100644
@@ -85,6 +85,7 @@ config MACH_GONI
 	select S3C_DEV_HSMMC2
 	select S3C_DEV_I2C1
 	select S5P_DEV_ONENAND
+	select S3C_DEV_USB_HSOTG
 	select SAMSUNG_DEV_KEYPAD
 	select S5PV210_SETUP_FB_24BPP
 	select S5PV210_SETUP_I2C1
arch/arm/mach-s5pv210/mach-goni.c +4 -0
index 5677c4d..68e22f2 100644
@@ -41,6 +41,7 @@
 #include <plat/iic.h>
 #include <plat/keypad.h>
 #include <plat/sdhci.h>
+#include <plat/clock.h>
 
 /* Following are default values for UCON, ULCON and UFCON UART registers */
 #define GONI_UCON_DEFAULT	(S3C2410_UCON_TXILEVEL |	\
@@ -569,6 +570,7 @@ static struct platform_device *goni_devices[] __initdata = {
 	&s3c_device_fb,
 	&s5p_device_onenand,
 	&goni_spi_gpio,
+	&s3c_device_usb_hsotg,
 	&goni_i2c_gpio_pmic,
 	&goni_device_gpiokeys,
 	&s5p_device_fimc0,
@@ -614,6 +616,8 @@ static void __init goni_machine_init(void)
 	samsung_keypad_set_platdata(&keypad_data);
 
 	platform_add_devices(goni_devices, ARRAY_SIZE(goni_devices));
+
+	clk_xusbxti.rate = 24000000;
 }
 
 MACHINE_START(GONI, "GONI")
Signature · 1 line
1.7.1.569.g6f426
#19 lore raw

PATCH v2 6/7 ARM: S5PC110: add support for otg usb gadget on Goni board

Review

Quoted 24 lines · Marek Szyprowski

Add required platform definitions for s3c-hsotg driver to enable usb gadget support on Samsung Goni board.

---
 arch/arm/mach-s5pv210/Kconfig     |    1 +
 arch/arm/mach-s5pv210/mach-goni.c |    4 ++++
 2 files changed, 5 insertions(+), 0 deletions(-)
arch/arm/mach-s5pv210/Kconfig +1 -0
index b1f671d..f8bac5a 100644
@@ -85,6 +85,7 @@ config MACH_GONI
 	select S3C_DEV_HSMMC2
 	select S3C_DEV_I2C1
 	select S5P_DEV_ONENAND
+	select S3C_DEV_USB_HSOTG
 	select SAMSUNG_DEV_KEYPAD
 	select S5PV210_SETUP_FB_24BPP
 	select S5PV210_SETUP_I2C1
(quoted diff) +0 -0

b/arch/arm/mach-s5pv210/mach-

arch/arm/mach-s5pv210/mach-goni.c line 46

Quoted 11 lines

goni.c
index 5677c4d..68e22f2 100644

arch/arm/mach-s5pv210/mach-goni.c +1 -0
@@ -41,6 +41,7 @@
 #include <plat/iic.h>
 #include <plat/keypad.h>
 #include <plat/sdhci.h>
+#include <plat/clock.h>
 
 /* Following are default values for UCON, ULCON and UFCON UART registers

*/

arch/arm/mach-s5pv210/mach-goni.c static struct platform_device *goni_devices[]

Quoted 2 lines
arch/arm/mach-s5pv210/mach-goni.c +0 -0
 #define GONI_UCON_DEFAULT	(S3C2410_UCON_TXILEVEL |	\
@@ -569,6 +570,7 @@ static struct platform_device *goni_devices[]

__initdata = {

Quoted 8 lines
arch/arm/mach-s5pv210/mach-goni.c +1 -0
 	&s3c_device_fb,
 	&s5p_device_onenand,
 	&goni_spi_gpio,
+	&s3c_device_usb_hsotg,
 	&goni_i2c_gpio_pmic,
 	&goni_device_gpiokeys,
 	&s5p_device_fimc0,

arch/arm/mach-s5pv210/mach-goni.c static void __init goni_machine_init(void)

Quoted 9 lines
arch/arm/mach-s5pv210/mach-goni.c +2 -1
@@ -614,6 +616,8 @@ static void __init goni_machine_init(void)
 	samsung_keypad_set_platdata(&keypad_data);
 
 	platform_add_devices(goni_devices, ARRAY_SIZE(goni_devices));
+
+	clk_xusbxti.rate = 24000000;
 }
 
 MACHINE_START(GONI, "GONI")
--

Ok...will apply.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

#20 lore raw

PATCH v2 7/7 ARM: S5PC110: add support for MMC regulators on Goni board

In reply to Marek Szyprowski

Add required platform definitions for MMC power regulators on Samsung Goni board. GPIO pin GONI_EXT_FLASH_EN has been transferred from machine startup code to fixed voltage regulator.

---
 arch/arm/mach-s5pv210/mach-goni.c |   40 ++++++++++++++++++++++++++++++++++--
 1 files changed, 37 insertions(+), 3 deletions(-)
arch/arm/mach-s5pv210/mach-goni.c +37 -3
index 68e22f2..a7fbe08 100644
@@ -16,6 +16,7 @@
 #include <linux/i2c.h>
 #include <linux/i2c-gpio.h>
 #include <linux/mfd/max8998.h>
+#include <linux/regulator/fixed.h>
 #include <linux/spi/spi.h>
 #include <linux/spi/spi_gpio.h>
 #include <linux/lcd.h>
@@ -226,6 +227,10 @@ static void __init goni_radio_init(void)
 /* MAX8998 regulators */
 #if defined(CONFIG_REGULATOR_MAX8998) || defined(CONFIG_REGULATOR_MAX8998_MODULE)
 
+static struct regulator_consumer_supply goni_ldo5_consumers[] = {
+	REGULATOR_SUPPLY("vmmc", "s3c-sdhci.0"),
+};
+
 static struct regulator_init_data goni_ldo2_data = {
 	.constraints	= {
 		.name		= "VALIVE_1.1V",
@@ -265,6 +270,8 @@ static struct regulator_init_data goni_ldo5_data = {
 		.max_uV		= 2800000,
 		.apply_uV	= 1,
 	},
+	.num_consumer_supplies = ARRAY_SIZE(goni_ldo5_consumers),
+	.consumer_supplies = goni_ldo5_consumers,
 };
 
 static struct regulator_init_data goni_ldo6_data = {
@@ -556,11 +563,37 @@ static struct s3c_sdhci_platdata goni_hsmmc2_data __initdata = {
 	.ext_cd_gpio_invert	= 1,
 };
 
+static struct regulator_consumer_supply mmc2_supplies[] = {
+	REGULATOR_SUPPLY("vmmc", "s3c-sdhci.2"),
+};
+
+static struct regulator_init_data mmc2_fixed_voltage_init_data = {
+	.constraints		= {
+		.name		= "V_TF_2.8V",
+		.valid_ops_mask	= REGULATOR_CHANGE_STATUS,
+	},
+	.num_consumer_supplies	= ARRAY_SIZE(mmc2_supplies),
+	.consumer_supplies	= mmc2_supplies,
+};
+
+static struct fixed_voltage_config mmc2_fixed_voltage_config = {
+	.supply_name		= "EXT_FLASH_EN",
+	.microvolts		= 2800000,
+	.gpio			= GONI_EXT_FLASH_EN,
+	.enable_high		= true,
+	.init_data		= &mmc2_fixed_voltage_init_data,
+};
+
+static struct platform_device mmc2_fixed_voltage = {
+	.name		= "reg-fixed-voltage",
+	.id		= 2,
+	.dev		= {
+		.platform_data	= &mmc2_fixed_voltage_config,
+	},
+};
+
 static void goni_setup_sdhci(void)
 {
-	gpio_request(GONI_EXT_FLASH_EN, "FLASH_EN");
-	gpio_direction_output(GONI_EXT_FLASH_EN, 1);
-
 	s3c_sdhci0_set_platdata(&goni_hsmmc0_data);
 	s3c_sdhci1_set_platdata(&goni_hsmmc1_data);
 	s3c_sdhci2_set_platdata(&goni_hsmmc2_data);
@@ -572,6 +605,7 @@ static struct platform_device *goni_devices[] __initdata = {
 	&goni_spi_gpio,
 	&s3c_device_usb_hsotg,
 	&goni_i2c_gpio_pmic,
+	&mmc2_fixed_voltage,
 	&goni_device_gpiokeys,
 	&s5p_device_fimc0,
 	&s5p_device_fimc1,
Signature · 1 line
1.7.1.569.g6f426
#21 lore raw

PATCH v2 7/7 ARM: S5PC110: add support for MMC regulators on Goni board

Quoted 7 lines · Marek Szyprowski

Add required platform definitions for MMC power regulators on Samsung Goni board. GPIO pin GONI_EXT_FLASH_EN has been transferred from machine startup code to fixed voltage regulator.

Looks good from a regulator API point of view:

#22 lore raw

PATCH v2 7/7 ARM: S5PC110: add support for MMC regulators on Goni board

In reply to Marek Szyprowski
Quoted 8 lines · Marek Szyprowski

Add required platform definitions for MMC power regulators on Samsung Goni board. GPIO pin GONI_EXT_FLASH_EN has been transferred from machine startup code to fixed voltage regulator.

Review

Quoted 6 lines
---
 arch/arm/mach-s5pv210/mach-goni.c |   40
++++++++++++++++++++++++++++++++++--
 1 files changed, 37 insertions(+), 3 deletions(-)
(quoted diff) +0 -0

b/arch/arm/mach-s5pv210/mach-

arch/arm/mach-s5pv210/mach-goni.c static struct platform_device *goni_devices[]

Quoted 76 lines

goni.c
index 68e22f2..a7fbe08 100644

arch/arm/mach-s5pv210/mach-goni.c +5 -0
@@ -16,6 +16,7 @@
 #include <linux/i2c.h>
 #include <linux/i2c-gpio.h>
 #include <linux/mfd/max8998.h>
+#include <linux/regulator/fixed.h>
 #include <linux/spi/spi.h>
 #include <linux/spi/spi_gpio.h>
 #include <linux/lcd.h>
@@ -226,6 +227,10 @@ static void __init goni_radio_init(void)
 /* MAX8998 regulators */
 #if defined(CONFIG_REGULATOR_MAX8998) ||
 defined(CONFIG_REGULATOR_MAX8998_MODULE)
 
+static struct regulator_consumer_supply goni_ldo5_consumers[] = {
+	REGULATOR_SUPPLY("vmmc", "s3c-sdhci.0"),
+};
+
 static struct regulator_init_data goni_ldo2_data = {
 	.constraints	= {
arch/arm/mach-s5pv210/mach-goni.c +31 -3
 		.name		= "VALIVE_1.1V",
@@ -265,6 +270,8 @@ static struct regulator_init_data goni_ldo5_data = {
 		.max_uV		= 2800000,
 		.apply_uV	= 1,
 	},
+	.num_consumer_supplies = ARRAY_SIZE(goni_ldo5_consumers),
+	.consumer_supplies = goni_ldo5_consumers,
 };
 
 static struct regulator_init_data goni_ldo6_data = {
@@ -556,11 +563,37 @@ static struct s3c_sdhci_platdata goni_hsmmc2_data
 __initdata = {
 	.ext_cd_gpio_invert	= 1,
 };
 
+static struct regulator_consumer_supply mmc2_supplies[] = {
+	REGULATOR_SUPPLY("vmmc", "s3c-sdhci.2"),
+};
+
+static struct regulator_init_data mmc2_fixed_voltage_init_data = {
+	.constraints		= {
+		.name		= "V_TF_2.8V",
+		.valid_ops_mask	= REGULATOR_CHANGE_STATUS,
+	},
+	.num_consumer_supplies	= ARRAY_SIZE(mmc2_supplies),
+	.consumer_supplies	= mmc2_supplies,
+};
+
+static struct fixed_voltage_config mmc2_fixed_voltage_config = {
+	.supply_name		= "EXT_FLASH_EN",
+	.microvolts		= 2800000,
+	.gpio			= GONI_EXT_FLASH_EN,
+	.enable_high		= true,
+	.init_data		= &mmc2_fixed_voltage_init_data,
+};
+
+static struct platform_device mmc2_fixed_voltage = {
+	.name		= "reg-fixed-voltage",
+	.id		= 2,
+	.dev		= {
+		.platform_data	= &mmc2_fixed_voltage_config,
+	},
+};
+
 static void goni_setup_sdhci(void)
 {
-	gpio_request(GONI_EXT_FLASH_EN, "FLASH_EN");
-	gpio_direction_output(GONI_EXT_FLASH_EN, 1);
-
 	s3c_sdhci0_set_platdata(&goni_hsmmc0_data);
 	s3c_sdhci1_set_platdata(&goni_hsmmc1_data);
arch/arm/mach-s5pv210/mach-goni.c +0 -0
 	s3c_sdhci2_set_platdata(&goni_hsmmc2_data);
@@ -572,6 +605,7 @@ static struct platform_device *goni_devices[]

__initdata = {

arch/arm/mach-s5pv210/mach-goni.c static struct platform_device *goni_devices[] __initdata = {

Quoted 8 lines
arch/arm/mach-s5pv210/mach-goni.c +1 -1
 	&goni_spi_gpio,
 	&s3c_device_usb_hsotg,
 	&goni_i2c_gpio_pmic,
+	&mmc2_fixed_voltage,
 	&goni_device_gpiokeys,
 	&s5p_device_fimc0,
 	&s5p_device_fimc1,
--

Ok...will apply with Mark Brown's reviewed-by.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.