ODROID-XU4: add odroid32 spi lcd driver.(CS-GPIO Error fix)

Change-Id: I697ab4aa709637bb2bbccab5768798db639292c9
This commit is contained in:
charles.park
2017-01-19 16:12:44 +09:00
parent 9f45809887
commit b2bc11d8fb
2 changed files with 28 additions and 0 deletions

4
drivers/spi/spidev.c Normal file → Executable file
View File

@@ -812,6 +812,10 @@ static int spidev_remove(struct spi_device *spi)
/* make sure ops on existing fds can abort cleanly */
spin_lock_irq(&spidev->spi_lock);
spidev->spi = NULL;
if(spi->master->cleanup)
spi->master->cleanup(spi);
spin_unlock_irq(&spidev->spi_lock);
/* prevent new opens */

24
drivers/staging/fbtft/fbtft_device.c Normal file → Executable file
View File

@@ -867,6 +867,25 @@ static struct fbtft_device_display displays[] = {
},
}
}
}, {
.name = "odroid32",
.spi = &(struct spi_board_info) {
.modalias = "fb_ili9340",
.max_speed_hz = 32000000,
.mode = SPI_MODE_0,
.controller_data = &hktft9340_controller_data,
.platform_data = &(struct fbtft_platform_data) {
.display = {
.buswidth = 8,
},
.bgr = true,
.gpios = (const struct fbtft_gpio []) {
{ "reset", 21 },
{ "dc", 22 },
{},
},
}
}
}, {
.name = "piscreen",
.spi = &(struct spi_board_info) {
@@ -1606,6 +1625,11 @@ static int __init fbtft_device_init(void)
static void __exit fbtft_device_exit(void)
{
if (spi_device) {
if (spi_device->controller_data) {
struct s3c64xx_spi_csinfo *cs = spi_device->controller_data;
if (cs->line)
gpio_free(cs->line);
}
device_del(&spi_device->dev);
kfree(spi_device);
}