config DP501
bool"RGB to Display Port transmitter dp501 support"
+
+config TC358768_RGB2MIPI
+ bool "toshiba TC358768 RGB to MIPI DSI"
+ help
+ "a chip that change RGB interface parallel signal into DSI serial signal"
+
+config SSD2828_RGB2MIPI
+ bool "solomon SSD2828 RGB to MIPI DSI"
+ help
+ "a chip that change RGB interface parallel signal into DSI serial signal"
endchoice
-config MIPI_DSI
- bool "RGB to MIPI DSI"
-config TC358768_RGB2MIPI
- bool "toshiba TC358768 RGB to MIPI DSI"
- depends on MIPI_DSI
- help
- "a chip that change RGB interface parallel signal into DSI serial signal"
-config SSD2828_RGB2MIPI
- bool "solomon SSD2828 RGB to MIPI DSI"
- depends on MIPI_DSI
- help
- "a chip that change RGB interface parallel signal into DSI serial signal"
# Makefile for display transmitter like lvds edp mipi
#
obj-$(CONFIG_RK610_LVDS) += rk610_lcd.o
-obj-$(CONFIG_MIPI_DSI) += mipi_dsi.o
-obj-$(CONFIG_TC358768_RGB2MIPI) += tc358768.o
-obj-$(CONFIG_SSD2828_RGB2MIPI) += ssd2828.o
+obj-$(CONFIG_TC358768_RGB2MIPI) += mipi_dsi.o tc358768.o
+obj-$(CONFIG_SSD2828_RGB2MIPI) += mipi_dsi.o ssd2828.o
obj-$(CONFIG_DP_ANX6345) += dp_anx6345.o
obj-$(CONFIG_DP501) += dp501.o
/*
* Copyright (C) 2012 ROCKCHIP, Inc.
- *
+ * drivers/video/display/transmitter/mipi_dsi.c
* author: hhb@rock-chips.com
* create date: 2013-01-17
* This software is licensed under the terms of the GNU General Public
int i = 0, id;
struct mipi_dsi_ops *ops = NULL;
-
+ if(cur_dsi_ops)
+ return 0;
for(i = 0; i < MAX_DSI_CHIPS; i++) {
if(dsi_ops[i]) {
ops = dsi_ops[i];
+//drivers/video/display/transmitter/mipi_dsi.h
+
#ifndef MIPI_DSI_H_
#define MIPI_DSI_H_
#define DTYPE_GEN_SWRITE_1P 0X13
#define DTYPE_GEN_SWRITE_0P 0X03
+
+//iomux
+#define OLD_RK_IOMUX 0
+
struct spi_t {
int cs;
char* cs_mux_name;
/*
* Copyright (C) 2012 ROCKCHIP, Inc.
- *
+ * drivers/video/display/transmitter/ssd2828.c
* author: hhb@rock-chips.com
* create date: 2013-01-17
* This software is licensed under the terms of the GNU General Public
//gpio_free(reset->reset_pin);
printk("%s: request ssd2828_RST_PIN error\n", __func__);
} else {
+#if OLD_RK_IOMUX
if(reset->mux_name)
rk30_mux_api_set(reset->mux_name, 0);
- gpio_direction_output(reset->reset_pin, reset->effect_value);
+#endif
+ gpio_direction_output(reset->reset_pin, !reset->effect_value);
}
}
//gpio_free(vdd->enable_pin);
printk("%s: request ssd2828_vddio_PIN error\n", __func__);
} else {
+#if OLD_RK_IOMUX
if(vdd->mux_name)
rk30_mux_api_set(vdd->mux_name, 0);
+#endif
gpio_direction_output(vdd->enable_pin, !vdd->effect_value);
}
}
//gpio_free(vdd->enable_pin);
printk("%s: request ssd2828_vdd_mipi_PIN error\n", __func__);
} else {
+#if OLD_RK_IOMUX
if(vdd->mux_name)
rk30_mux_api_set(vdd->mux_name, 0);
+#endif
gpio_direction_output(vdd->enable_pin, !vdd->effect_value);
}
}
//gpio_free(spi->cs);
printk("%s: request ssd2828_spi->cs_PIN error\n", __func__);
} else {
+#if OLD_RK_IOMUX
if(spi->cs_mux_name)
rk30_mux_api_set(spi->cs_mux_name, 0);
+#endif
gpio_direction_output(spi->cs, GPIO_HIGH);
}
}
//gpio_free(spi->sck);
printk("%s: request ssd2828_spi->sck_PIN error\n", __func__);
} else {
+#if OLD_RK_IOMUX
if(spi->sck_mux_name)
rk30_mux_api_set(spi->sck_mux_name, 0);
+#endif
gpio_direction_output(spi->sck, GPIO_HIGH);
}
}
//gpio_free(spi->mosi);
printk("%s: request ssd2828_spi->mosi_PIN error\n", __func__);
} else {
+#if OLD_RK_IOMUX
if(spi->mosi_mux_name)
rk30_mux_api_set(spi->mosi_mux_name, 0);
+#endif
gpio_direction_output(spi->mosi, GPIO_HIGH);
}
}
//gpio_free(spi->miso);
printk("%s: request ssd2828_spi->miso_PIN error\n", __func__);
} else {
+#if OLD_RK_IOMUX
if(spi->miso_mux_name)
rk30_mux_api_set(spi->miso_mux_name, 0);
+#endif
gpio_direction_input(spi->miso);
}
}
int ret = 0;
struct ssd2828_t *ssd = (struct ssd2828_t *)ssd2828;
- ssd2828_gpio_init(NULL);
ssd->vdd_mipi.enable(&ssd->vdd_mipi);
ssd->vddio.enable(&ssd->vddio);
ssd->reset.do_reset(&ssd->reset);
ssd->vddio.disable(&ssd->vddio);
ssd->vdd_mipi.disable(&ssd->vdd_mipi);
- ssd2828_gpio_deinit(NULL);
return ret;
}
int ssd_mipi_dsi_send_dcs_packet(unsigned char regs[], int n) {
//unsigned int data = 0, i = 0;
- ssd_set_register(0x00B70363);
+ ssd_set_register(0x00B70343); //
ssd_set_register(0x00B80000);
ssd_set_register(0x00Bc0001);
ssd_set_register(0x00Bf0000 | regs[0]);
msleep(1);
-
+ ssd_set_register(0x00B7034b);
return 0;
}
ssd2828->vdd_mipi.enable = ssd2828_vdd_enable;
if(!ssd2828->vdd_mipi.disable)
ssd2828->vdd_mipi.disable = ssd2828_vdd_disable;
+
+ ssd2828_gpio_init(NULL);
return 0;
}
static int ssd2828_remove(struct platform_device *pdev) {
- if(!ssd2828)
+ if(ssd2828) {
+ ssd2828_gpio_deinit(NULL);
ssd2828 = NULL;
-
+ }
return 0;
}
/*
* Copyright (C) 2012 ROCKCHIP, Inc.
- *
+ * drivers/video/display/transmitter/tc358768.c
* author: hhb@rock-chips.com
* create date: 2012-10-26
* This software is licensed under the terms of the GNU General Public
//gpio_free(reset->reset_pin);
printk("%s: request TC358768_RST_PIN error\n", __func__);
} else {
+#if OLD_RK_IOMUX
if(reset->mux_name)
rk30_mux_api_set(reset->mux_name, reset->mux_mode);
- gpio_direction_output(reset->reset_pin, reset->effect_value);
+#endif
+ gpio_direction_output(reset->reset_pin, !reset->effect_value);
}
}
//gpio_free(vdd->enable_pin);
printk("%s: request TC358768_vddc_PIN error\n", __func__);
} else {
+#if OLD_RK_IOMUX
if(vdd->mux_name)
rk30_mux_api_set(vdd->mux_name, vdd->mux_mode);
+#endif
gpio_direction_output(vdd->enable_pin, !vdd->effect_value);
}
}
//gpio_free(vdd->enable_pin);
printk("%s: request TC358768_vddio_PIN error\n", __func__);
} else {
+#if OLD_RK_IOMUX
if(vdd->mux_name)
rk30_mux_api_set(vdd->mux_name, vdd->mux_mode);
+#endif
gpio_direction_output(vdd->enable_pin, !vdd->effect_value);
}
}
//gpio_free(vdd->enable_pin);
printk("%s: request TC358768_vdd_mipi_PIN error\n", __func__);
} else {
+#if OLD_RK_IOMUX
if(vdd->mux_name)
rk30_mux_api_set(vdd->mux_name, vdd->mux_mode);
+#endif
gpio_direction_output(vdd->enable_pin, !vdd->effect_value);
}
}
int ret = 0;
struct tc358768_t *tc = (struct tc358768_t *)tc358768;
- tc358768_gpio_init(NULL);
tc->vddc.enable(&tc->vddc);
tc->vdd_mipi.enable(&tc->vdd_mipi);
tc->vddio.enable(&tc->vddio);
tc->vddio.disable(&tc->vddio);
tc->vdd_mipi.disable(&tc->vdd_mipi);
tc->vddc.disable(&tc->vddc);
- tc358768_gpio_deinit(NULL);
return ret;
}
tc358768->vdd_mipi.enable = tc358768_vdd_enable;
if(!tc358768->vdd_mipi.disable)
tc358768->vdd_mipi.disable = tc358768_vdd_disable;
-
+
+ tc358768_gpio_init(NULL);
+
return ret;
}
static int tc358768_remove(struct i2c_client *client)
{
+ tc358768_gpio_deinit(NULL);
tc358768_client = NULL;
tc358768 = NULL;
return 0;