exynos: universal_c210: Move to driver model soft_spi
Adjust this board to use the driver model soft_spi implementation. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
This commit is contained in:
parent
6126c8e886
commit
0043b1faa7
@ -41,6 +41,19 @@
|
|||||||
status = "disabled";
|
status = "disabled";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
soft-spi {
|
||||||
|
compatible = "u-boot,soft-spi";
|
||||||
|
cs-gpio = <&gpio 235 0>; /* Y43 */
|
||||||
|
sclk-gpio = <&gpio 225 0>; /* Y31 */
|
||||||
|
mosi-gpio = <&gpio 227 0>; /* Y33 */
|
||||||
|
miso-gpio = <&gpio 224 0>; /* Y30 */
|
||||||
|
spi-delay-us = <1>;
|
||||||
|
#address-cells = <1>;
|
||||||
|
#size-cells = <0>;
|
||||||
|
cs@0 {
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
fimd@11c00000 {
|
fimd@11c00000 {
|
||||||
compatible = "samsung,exynos-fimd";
|
compatible = "samsung,exynos-fimd";
|
||||||
reg = <0x11c00000 0xa4>;
|
reg = <0x11c00000 0xa4>;
|
||||||
|
@ -201,53 +201,6 @@ int exynos_early_init_f(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_SOFT_SPI
|
|
||||||
static void soft_spi_init(void)
|
|
||||||
{
|
|
||||||
gpio_direction_output(CONFIG_SOFT_SPI_GPIO_SCLK,
|
|
||||||
CONFIG_SOFT_SPI_MODE & SPI_CPOL);
|
|
||||||
gpio_direction_output(CONFIG_SOFT_SPI_GPIO_MOSI, 1);
|
|
||||||
gpio_direction_input(CONFIG_SOFT_SPI_GPIO_MISO);
|
|
||||||
gpio_direction_output(CONFIG_SOFT_SPI_GPIO_CS,
|
|
||||||
!(CONFIG_SOFT_SPI_MODE & SPI_CS_HIGH));
|
|
||||||
}
|
|
||||||
|
|
||||||
void spi_cs_activate(struct spi_slave *slave)
|
|
||||||
{
|
|
||||||
gpio_set_value(CONFIG_SOFT_SPI_GPIO_CS,
|
|
||||||
!(CONFIG_SOFT_SPI_MODE & SPI_CS_HIGH));
|
|
||||||
SPI_SCL(1);
|
|
||||||
gpio_set_value(CONFIG_SOFT_SPI_GPIO_CS,
|
|
||||||
CONFIG_SOFT_SPI_MODE & SPI_CS_HIGH);
|
|
||||||
}
|
|
||||||
|
|
||||||
void spi_cs_deactivate(struct spi_slave *slave)
|
|
||||||
{
|
|
||||||
gpio_set_value(CONFIG_SOFT_SPI_GPIO_CS,
|
|
||||||
!(CONFIG_SOFT_SPI_MODE & SPI_CS_HIGH));
|
|
||||||
}
|
|
||||||
|
|
||||||
int spi_cs_is_valid(unsigned int bus, unsigned int cs)
|
|
||||||
{
|
|
||||||
return bus == 0 && cs == 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void universal_spi_scl(int bit)
|
|
||||||
{
|
|
||||||
gpio_set_value(CONFIG_SOFT_SPI_GPIO_SCLK, bit);
|
|
||||||
}
|
|
||||||
|
|
||||||
void universal_spi_sda(int bit)
|
|
||||||
{
|
|
||||||
gpio_set_value(CONFIG_SOFT_SPI_GPIO_MOSI, bit);
|
|
||||||
}
|
|
||||||
|
|
||||||
int universal_spi_read(void)
|
|
||||||
{
|
|
||||||
return gpio_get_value(CONFIG_SOFT_SPI_GPIO_MISO);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static void init_pmic_lcd(void)
|
static void init_pmic_lcd(void)
|
||||||
{
|
{
|
||||||
unsigned char val;
|
unsigned char val;
|
||||||
@ -332,8 +285,6 @@ void exynos_cfg_lcd_gpio(void)
|
|||||||
/* gpio pad configuration for LCD reset. */
|
/* gpio pad configuration for LCD reset. */
|
||||||
gpio_request(EXYNOS4_GPIO_Y45, "lcd_reset");
|
gpio_request(EXYNOS4_GPIO_Y45, "lcd_reset");
|
||||||
gpio_cfg_pin(EXYNOS4_GPIO_Y45, S5P_GPIO_OUTPUT);
|
gpio_cfg_pin(EXYNOS4_GPIO_Y45, S5P_GPIO_OUTPUT);
|
||||||
|
|
||||||
spi_init();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int mipi_power(void)
|
int mipi_power(void)
|
||||||
@ -401,9 +352,6 @@ int exynos_init(void)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_SOFT_SPI
|
|
||||||
soft_spi_init();
|
|
||||||
#endif
|
|
||||||
check_hw_revision();
|
check_hw_revision();
|
||||||
printf("HW Revision:\t0x%x\n", board_rev);
|
printf("HW Revision:\t0x%x\n", board_rev);
|
||||||
|
|
||||||
|
@ -187,16 +187,7 @@
|
|||||||
* SPI Settings
|
* SPI Settings
|
||||||
*/
|
*/
|
||||||
#define CONFIG_SOFT_SPI
|
#define CONFIG_SOFT_SPI
|
||||||
#define CONFIG_SOFT_SPI_MODE SPI_MODE_3
|
|
||||||
#define CONFIG_SOFT_SPI_GPIO_SCLK EXYNOS4_GPIO_Y31
|
|
||||||
#define CONFIG_SOFT_SPI_GPIO_MOSI EXYNOS4_GPIO_Y33
|
|
||||||
#define CONFIG_SOFT_SPI_GPIO_MISO EXYNOS4_GPIO_Y30
|
|
||||||
#define CONFIG_SOFT_SPI_GPIO_CS EXYNOS4_GPIO_Y43
|
|
||||||
|
|
||||||
#define SPI_DELAY udelay(1)
|
|
||||||
#define SPI_SCL(bit) universal_spi_scl(bit)
|
|
||||||
#define SPI_SDA(bit) universal_spi_sda(bit)
|
|
||||||
#define SPI_READ universal_spi_read()
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
void universal_spi_scl(int bit);
|
void universal_spi_scl(int bit);
|
||||||
void universal_spi_sda(int bit);
|
void universal_spi_sda(int bit);
|
||||||
|
Loading…
Reference in New Issue
Block a user