mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 12:17:12 +09:00
board-rk3168-LR097: use new iomux api
This commit is contained in:
@@ -172,10 +172,7 @@ static struct spi_board_info board_spi_devices[] = {
|
||||
************************************************************/
|
||||
#ifdef CONFIG_BACKLIGHT_RK29_BL
|
||||
#define PWM_ID 3
|
||||
#define PWM_MUX_NAME GPIO3D6_PWM3_JTAGTMS_HOSTDRVVBUS_NAME
|
||||
#define PWM_MUX_MODE GPIO3D_PWM3
|
||||
#define PWM_MUX_MODE_GPIO GPIO3D_GPIO3D6
|
||||
#define PWM_GPIO RK30_PIN3_PD6
|
||||
#define PWM_MODE PWM3
|
||||
#define PWM_EFFECT_VALUE 0
|
||||
|
||||
#define LCD_DISP_ON_PIN
|
||||
@@ -187,10 +184,9 @@ static struct spi_board_info board_spi_devices[] = {
|
||||
static int rk29_backlight_io_init(void)
|
||||
{
|
||||
int ret = 0;
|
||||
rk30_mux_api_set(PWM_MUX_NAME, PWM_MUX_MODE);
|
||||
#ifdef LCD_DISP_ON_PIN
|
||||
// rk30_mux_api_set(BL_EN_MUX_NAME, BL_EN_MUX_MODE);
|
||||
|
||||
iomux_set(PWM_MODE);
|
||||
#ifdef LCD_DISP_ON_PIN
|
||||
ret = gpio_request(BL_EN_PIN, NULL);
|
||||
if (ret != 0) {
|
||||
gpio_free(BL_EN_PIN);
|
||||
@@ -204,25 +200,26 @@ static int rk29_backlight_io_init(void)
|
||||
|
||||
static int rk29_backlight_io_deinit(void)
|
||||
{
|
||||
int ret = 0;
|
||||
int ret = 0, pwm_gpio;
|
||||
#ifdef LCD_DISP_ON_PIN
|
||||
gpio_free(BL_EN_PIN);
|
||||
#endif
|
||||
rk30_mux_api_set(PWM_MUX_NAME, PWM_MUX_MODE_GPIO);
|
||||
gpio_request(PWM_GPIO, NULL);
|
||||
gpio_direction_output(PWM_GPIO, GPIO_LOW);
|
||||
pwm_gpio = iomux_mode_to_gpio(PWM_MODE);
|
||||
gpio_request(pwm_gpio, NULL);
|
||||
gpio_direction_output(pwm_gpio, GPIO_LOW);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int rk29_backlight_pwm_suspend(void)
|
||||
{
|
||||
int ret = 0;
|
||||
rk30_mux_api_set(PWM_MUX_NAME, PWM_MUX_MODE_GPIO);
|
||||
if (gpio_request(PWM_GPIO, NULL)) {
|
||||
int ret = 0, pwm_gpio;
|
||||
|
||||
pwm_gpio = iomux_mode_to_gpio(PWM_MODE);
|
||||
if (gpio_request(pwm_gpio, NULL)) {
|
||||
printk("func %s, line %d: request gpio fail\n", __FUNCTION__, __LINE__);
|
||||
return -1;
|
||||
}
|
||||
gpio_direction_output(PWM_GPIO, GPIO_LOW);
|
||||
gpio_direction_output(pwm_gpio, GPIO_LOW);
|
||||
#ifdef LCD_DISP_ON_PIN
|
||||
gpio_direction_output(BL_EN_PIN, 0);
|
||||
gpio_set_value(BL_EN_PIN, !BL_EN_VALUE);
|
||||
@@ -232,8 +229,10 @@ static int rk29_backlight_pwm_suspend(void)
|
||||
|
||||
static int rk29_backlight_pwm_resume(void)
|
||||
{
|
||||
gpio_free(PWM_GPIO);
|
||||
rk30_mux_api_set(PWM_MUX_NAME, PWM_MUX_MODE);
|
||||
int pwm_gpio = iomux_mode_to_gpio(PWM_MODE);
|
||||
|
||||
gpio_free(pwm_gpio);
|
||||
iomux_set(PWM_MODE);
|
||||
#ifdef LCD_DISP_ON_PIN
|
||||
msleep(30);
|
||||
gpio_direction_output(BL_EN_PIN, 1);
|
||||
@@ -1132,7 +1131,7 @@ static struct platform_device rk30_device_adc_battery = {
|
||||
};
|
||||
#endif
|
||||
#ifdef CONFIG_RK30_PWM_REGULATOR
|
||||
const static int pwm_voltage_map[] = {
|
||||
static int pwm_voltage_map[] = {
|
||||
950000, 975000,1000000, 1025000, 1050000, 1075000, 1100000, 1125000, 1150000, 1175000, 1200000, 1225000, 1250000, 1275000, 1300000, 1325000, 1350000, 1375000, 1400000
|
||||
};
|
||||
|
||||
@@ -1161,9 +1160,8 @@ static struct pwm_platform_data pwm_regulator_info[1] = {
|
||||
{
|
||||
.pwm_id = 1,
|
||||
.pwm_gpio = RK30_PIN3_PD4,
|
||||
.pwm_iomux_name = GPIO3D4_PWM1_JTAGTRSTN_NAME,
|
||||
.pwm_iomux_pwm = GPIO3D_PWM1,
|
||||
.pwm_iomux_gpio = GPIO3D_GPIO3D4,
|
||||
.pwm_iomux_pwm = PWM1,
|
||||
.pwm_iomux_gpio = GPIO3_D4,
|
||||
.pwm_voltage = 1100000,
|
||||
.suspend_voltage = 1050000,
|
||||
.min_uV = 950000,
|
||||
@@ -1199,8 +1197,8 @@ static struct rfkill_rk_platform_data rfkill_rk_platdata = {
|
||||
.io = INVALID_GPIO, //RK30_PIN3_PC7,
|
||||
.enable = GPIO_HIGH,
|
||||
.iomux = {
|
||||
.name = GPIO3C7_SDMMC1WRITEPRT_RMIICRS_NAME,
|
||||
.fgpio = GPIO3C_GPIO3C7,
|
||||
.name = "bt_poweron",
|
||||
.fgpio = GPIO3_C7,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1208,8 +1206,8 @@ static struct rfkill_rk_platform_data rfkill_rk_platdata = {
|
||||
.io = RK30_PIN3_PC7, // set io to INVALID_GPIO for disable it
|
||||
.enable = GPIO_LOW,
|
||||
.iomux = {
|
||||
.name = GPIO3C7_SDMMC1WRITEPRT_RMIICRS_NAME,
|
||||
.fgpio = GPIO3C_GPIO3C7,
|
||||
.name = "bt_reset",
|
||||
.fgpio = GPIO3_C7,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1236,9 +1234,9 @@ static struct rfkill_rk_platform_data rfkill_rk_platdata = {
|
||||
.io = RK30_PIN1_PA3, // set io to INVALID_GPIO for disable it
|
||||
.enable = GPIO_LOW,
|
||||
.iomux = {
|
||||
.name = GPIO1A3_UART0RTSN_NAME,
|
||||
.fgpio = GPIO1A_GPIO1A3,
|
||||
.fmux = GPIO1A_UART0RTSN,
|
||||
.name = "bt_rts",
|
||||
.fgpio = GPIO1_A3,
|
||||
.fmux = UART0_RTSN,
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -1870,7 +1868,7 @@ void __sramfunc rk30_pwm_logic_suspend_voltage(void)
|
||||
gpio3d6_dir = grf_readl(GRF_GPIO3H_DIR);
|
||||
gpio3d6_en = grf_readl(GRF_GPIO3H_EN);
|
||||
|
||||
writel_relaxed((1<<28), GRF_GPIO3D_IOMUX);
|
||||
grf_writel((1<<28), GRF_GPIO3D_IOMUX);
|
||||
grf_writel((1<<30)|(1<<14), GRF_GPIO3H_DIR);
|
||||
grf_writel((1<<30)|(1<<14), GRF_GPIO3H_DO);
|
||||
grf_writel((1<<30)|(1<<14), GRF_GPIO3H_EN);
|
||||
@@ -1879,7 +1877,7 @@ void __sramfunc rk30_pwm_logic_suspend_voltage(void)
|
||||
void __sramfunc rk30_pwm_logic_resume_voltage(void)
|
||||
{
|
||||
#ifdef CONFIG_RK30_PWM_REGULATOR
|
||||
writel_relaxed((1<<28)|gpio3d6_iomux, GRF_GPIO3D_IOMUX);
|
||||
grf_writel((1<<28)|gpio3d6_iomux, GRF_GPIO3D_IOMUX);
|
||||
grf_writel((1<<30)|gpio3d6_en, GRF_GPIO3H_EN);
|
||||
grf_writel((1<<30)|gpio3d6_dir, GRF_GPIO3H_DIR);
|
||||
grf_writel((1<<30)|gpio3d6_do, GRF_GPIO3H_DO);
|
||||
|
||||
Reference in New Issue
Block a user