backlight: ldim: optimize ldim algorithm for flicker issue

PD#167455: backlight: ldim: optimize ldim algorithm for flicker issue
also add driver and algorithm version recode.

Change-Id: I4b217f6d611c5689366170907db7e90b5a653a5e
Signed-off-by: Evoke Zhang <evoke.zhang@amlogic.com>
This commit is contained in:
Evoke Zhang
2018-06-07 13:12:00 +08:00
committed by Yixun Lan
parent 157284b916
commit 1241edd3bc
10 changed files with 1632 additions and 976 deletions

View File

@@ -14483,6 +14483,10 @@ AMLOGIC TXLX T962E R321 buildroot dts
M: liangzhuo.xie <liangzhuo.xie@amlogic.com>
F: arch/arm64/boot/dts/amlogic/txlx_t962e_r321_buildroot.dts
AMLOGIC BACKLIGHT LOCAL DIMMING
M: evoke.zhang <evoke.zhang@amlogic.com>
F: drivers/amlogic/media/vout/backlight/aml_ldim/iw7027_bl.h
AMLOGIC G12B
M: Yan Wang <yan.wang@amlogic.com>
F: arch/arm64/boot/dts/amlogic/mesong12b.dtsi

View File

@@ -418,11 +418,11 @@ static int bl_pwm_out_level_check(struct bl_pwm_config_s *bl_pwm)
return out_level;
}
static void bl_set_pwm_vs(struct bl_pwm_config_s *bl_pwm, int out_level)
static void bl_set_pwm_vs(struct bl_pwm_config_s *bl_pwm,
unsigned int pol, unsigned int out_level)
{
unsigned int pwm_hi, n, sw;
unsigned int vs[4], ve[4];
unsigned int pol = 0;
int i;
if (bl_debug_print_flag) {
@@ -441,8 +441,6 @@ static void bl_set_pwm_vs(struct bl_pwm_config_s *bl_pwm, int out_level)
ve[i] = 0x1fff;
}
} else {
if (bl_pwm->pwm_method == BL_PWM_NEGATIVE)
pol = 1;
bl_pwm->pwm_level =
(((bl_pwm->pwm_cnt * bl_pwm->pwm_duty / 10) + 5) / 10);
pwm_hi = bl_pwm->pwm_level;
@@ -450,8 +448,10 @@ static void bl_set_pwm_vs(struct bl_pwm_config_s *bl_pwm, int out_level)
sw = (bl_pwm->pwm_cnt * 10 / n + 5) / 10;
pwm_hi = (pwm_hi * 10 / n + 5) / 10;
pwm_hi = (pwm_hi > 1) ? pwm_hi : 1;
if (bl_debug_print_flag)
BLPR("n=%d, sw=%d, pwm_high=%d\n", n, sw, pwm_hi);
if (bl_debug_print_flag) {
BLPR("pwm_vs: n=%d, sw=%d, pwm_high=%d\n",
n, sw, pwm_hi);
}
for (i = 0; i < n; i++) {
vs[i] = 1 + (sw * i);
ve[i] = vs[i] + pwm_hi - 1;
@@ -463,7 +463,7 @@ static void bl_set_pwm_vs(struct bl_pwm_config_s *bl_pwm, int out_level)
}
if (bl_debug_print_flag) {
for (i = 0; i < 4; i++) {
BLPR("vs[%d]=%d, ve[%d]=%d\n",
BLPR("pwm_vs: vs[%d]=%d, ve[%d]=%d\n",
i, vs[i], i, ve[i]);
}
}
@@ -483,81 +483,67 @@ static void bl_set_pwm_vs(struct bl_pwm_config_s *bl_pwm, int out_level)
}
}
static void bl_set_pwm(struct bl_pwm_config_s *bl_pwm)
static void bl_set_pwm_normal(struct bl_pwm_config_s *bl_pwm,
unsigned int pol, unsigned int out_level)
{
unsigned int port = bl_pwm->pwm_port;
unsigned int pol = 0;
unsigned int pwm_period, pwm_duty, out_level = 0xff;
struct pwm_device *pwm = bl_pwm->pwm_data.pwm;
unsigned int pwm_period, pwm_duty, port_index;
out_level = bl_pwm_out_level_check(bl_pwm);
if (bl_pwm->pwm_method == BL_PWM_NEGATIVE)
pol = 1;
if (bl_debug_print_flag) {
BLPR("port %d: pwm_duty=%d, out_level=%d, pol=%s\n",
port, bl_pwm->pwm_duty, out_level,
(pol ? "negative":"positive"));
if (IS_ERR_OR_NULL(bl_pwm->pwm_data.pwm)) {
BLERR("%s: invalid bl_pwm_ch\n", __func__);
return;
}
switch (port) {
case BL_PWM_A:
case BL_PWM_B:
case BL_PWM_C:
case BL_PWM_D:
case BL_PWM_E:
case BL_PWM_F:
pwm_period = 1000000000 / bl_pwm->pwm_freq;
pwm_duty = (pwm_period * bl_pwm->pwm_duty) / 100;
pwm_period = 1000000000 / bl_pwm->pwm_freq;
pwm_duty = (pwm_period * bl_pwm->pwm_duty) / 100;
port_index = bl_pwm->pwm_data.port_index;
if (bl_debug_print_flag) {
pr_info("pwm: pwm=0x%p, port_index=%d, meson_index=%d\n",
bl_pwm->pwm_data.pwm, port_index, bl_pwm->pwm_data.meson_index);
}
if (((port_index % 2) == bl_pwm->pwm_data.meson_index) &&
(port_index == bl_pwm->pwm_port)) {
bl_pwm->pwm_data.state.polarity = pol;
bl_pwm->pwm_data.state.duty_cycle = pwm_duty;
bl_pwm->pwm_data.state.period = pwm_period;
bl_pwm->pwm_data.state.enabled = true;
if (bl_debug_print_flag) {
pr_info("pwm=0x%p, port_index=%d, meson_index=%d\n",
bl_pwm->pwm_data.pwm, bl_pwm->pwm_data.port_index,
bl_pwm->pwm_data.meson_index);
BLPR(
"pwm state: polarity=%d, duty_cycle=%d, period=%d, enabled=%d\n",
bl_pwm->pwm_data.state.polarity,
bl_pwm->pwm_data.state.duty_cycle,
bl_pwm->pwm_data.state.period,
bl_pwm->pwm_data.state.enabled);
}
if ((!IS_ERR_OR_NULL(bl_pwm->pwm_data.pwm)) &&
((bl_pwm->pwm_data.port_index % 2) ==
bl_pwm->pwm_data.meson_index) &&
(bl_pwm->pwm_data.port_index == bl_pwm->pwm_port)) {
bl_pwm->pwm_data.state.polarity = pol;
bl_pwm->pwm_data.state.duty_cycle = pwm_duty;
bl_pwm->pwm_data.state.period = pwm_period;
bl_pwm->pwm_data.state.enabled = true;
if (bl_debug_print_flag) {
BLPR("polarity=%d\n",
bl_pwm->pwm_data.state.polarity);
BLPR("duty_cycle=%d\n",
bl_pwm->pwm_data.state.duty_cycle);
BLPR("period=%d\n",
bl_pwm->pwm_data.state.period);
BLPR("enabled=%d\n",
bl_pwm->pwm_data.state.enabled);
}
if (out_level == 0xff) {
pwm_constant_disable(bl_pwm->pwm_data.meson,
bl_pwm->pwm_data.meson_index);
} else {
/* pwm duty 100% or 0% special control */
pwm_constant_enable(bl_pwm->pwm_data.meson,
bl_pwm->pwm_data.meson_index);
}
pwm_apply_state(pwm, &(bl_pwm->pwm_data.state));
if (out_level == 0xff) {
pwm_constant_disable(bl_pwm->pwm_data.meson,
bl_pwm->pwm_data.meson_index);
} else {
BLERR("%s: invalid bl_pwm_ch\n", __func__);
/* pwm duty 100% or 0% special control */
pwm_constant_enable(bl_pwm->pwm_data.meson,
bl_pwm->pwm_data.meson_index);
}
break;
case BL_PWM_VS:
bl_set_pwm_vs(bl_pwm, out_level);
break;
default:
break;
pwm_apply_state(bl_pwm->pwm_data.pwm,
&(bl_pwm->pwm_data.state));
}
}
void bl_pwm_ctrl(struct bl_pwm_config_s *bl_pwm, int status)
{
struct pwm_state pstate;
unsigned int pol = 0, out_level = 0xff;
if (bl_pwm->pwm_method == BL_PWM_NEGATIVE)
pol = 1;
if (status) {
/* enable pwm */
out_level = bl_pwm_out_level_check(bl_pwm);
if (bl_debug_print_flag) {
BLPR("port %d: pwm_duty=%d, out_level=%d, pol=%s\n",
bl_pwm->pwm_port, bl_pwm->pwm_duty, out_level,
(pol ? "negative":"positive"));
}
switch (bl_pwm->pwm_port) {
case BL_PWM_A:
case BL_PWM_B:
@@ -565,8 +551,10 @@ void bl_pwm_ctrl(struct bl_pwm_config_s *bl_pwm, int status)
case BL_PWM_D:
case BL_PWM_E:
case BL_PWM_F:
bl_set_pwm_normal(bl_pwm, pol, out_level);
break;
case BL_PWM_VS:
bl_set_pwm(bl_pwm);
bl_set_pwm_vs(bl_pwm, pol, out_level);
break;
default:
break;
@@ -580,42 +568,47 @@ void bl_pwm_ctrl(struct bl_pwm_config_s *bl_pwm, int status)
case BL_PWM_D:
case BL_PWM_E:
case BL_PWM_F:
if (!IS_ERR_OR_NULL(bl_pwm->pwm_data.pwm)) {
pwm_get_state(bl_pwm->pwm_data.pwm, &pstate);
pwm_constant_enable(bl_pwm->pwm_data.meson,
bl_pwm->pwm_data.meson_index);
if (bl_pwm->pwm_method)
pstate.polarity = 0;
else
pstate.polarity = 1;
pstate.duty_cycle = 0;
pstate.enabled = 1;
pstate.period = bl_pwm->pwm_data.state.period;
if (bl_debug_print_flag) {
BLPR("polarity=%d\n",
pstate.polarity);
BLPR("duty_cycle=%d\n",
pstate.duty_cycle);
BLPR("period=%d\n",
pstate.period);
BLPR("enabled=%d\n",
pstate.enabled);
}
pwm_apply_state(bl_pwm->pwm_data.pwm,
&(pstate));
}
if (IS_ERR_OR_NULL(bl_pwm->pwm_data.pwm)) {
BLERR("%s: invalid bl_pwm_ch\n", __func__);
return;
}
pwm_get_state(bl_pwm->pwm_data.pwm, &pstate);
pwm_constant_enable(bl_pwm->pwm_data.meson,
bl_pwm->pwm_data.meson_index);
if (bl_pwm->pwm_method)
pstate.polarity = 0;
else
pstate.polarity = 1;
pstate.duty_cycle = 0;
pstate.enabled = 1;
pstate.period = bl_pwm->pwm_data.state.period;
if (bl_debug_print_flag) {
BLPR(
"pwm state: polarity=%d, duty_cycle=%d, period=%d, enabled=%d\n",
pstate.polarity, pstate.duty_cycle,
pstate.period, pstate.enabled);
}
pwm_apply_state(bl_pwm->pwm_data.pwm, &(pstate));
break;
case BL_PWM_VS:
if (bl_pwm->pwm_method == BL_PWM_NEGATIVE)
bl_set_pwm_vs(bl_pwm, 1);
else
bl_set_pwm_vs(bl_pwm, 0);
bl_set_pwm_vs(bl_pwm, pol, 0);
default:
break;
}
}
}
static void bl_set_pwm(struct bl_pwm_config_s *bl_pwm)
{
if (bl_drv->state & BL_STATE_BL_ON) {
bl_pwm_ctrl(bl_pwm, 1);
} else {
if (bl_debug_print_flag)
BLERR("%s: bl_drv state is off\n", __func__);
}
}
static void bl_power_en_ctrl(struct bl_config_s *bconf, int status)
{
if (status) {
@@ -946,22 +939,22 @@ static void bl_set_duty_pwm(struct bl_pwm_config_s *bl_pwm)
if (bl_pwm_duty_free) {
if (bl_pwm->pwm_duty > 100) {
BLERR("pwm_duty %d%% is bigger than 100%%\n",
BLERR(
"pwm_duty %d%% is bigger than 100%%, reset to 100%%\n",
bl_pwm->pwm_duty);
bl_pwm->pwm_duty = 100;
BLPR("reset to 100%%\n");
}
} else {
if (bl_pwm->pwm_duty > bl_pwm->pwm_duty_max) {
BLERR("pwm_duty %d%% is bigger than duty_max %d%%\n",
BLERR(
"pwm_duty %d%% is bigger than duty_max %d%%, reset to duty_max\n",
bl_pwm->pwm_duty, bl_pwm->pwm_duty_max);
bl_pwm->pwm_duty = bl_pwm->pwm_duty_max;
BLPR("reset to duty_max\n");
} else if (bl_pwm->pwm_duty < bl_pwm->pwm_duty_min) {
BLERR("pwm_duty %d%% is smaller than duty_min %d%%\n",
BLERR(
"pwm_duty %d%% is smaller than duty_min %d%%, reset to duty_min\n",
bl_pwm->pwm_duty, bl_pwm->pwm_duty_min);
bl_pwm->pwm_duty = bl_pwm->pwm_duty_min;
BLPR("reset to duty_min\n");
}
}
@@ -997,7 +990,7 @@ static void bl_set_level_pwm(struct bl_pwm_config_s *bl_pwm, unsigned int level)
BLPR("port %d mapping: level=%d, level_max=%d, level_min=%d\n",
bl_pwm->pwm_port, level, max, min);
BLPR("port %d: duty=%d%%, duty_max=%d%%, duty_min=%d%%\n",
bl_pwm->pwm_port, pwm_max, pwm_min, bl_pwm->pwm_level);
bl_pwm->pwm_port, bl_pwm->pwm_duty, pwm_max, pwm_min);
}
bl_set_pwm(bl_pwm);

View File

@@ -34,7 +34,6 @@
#include <linux/amlogic/aml_gpio_consumer.h>
#include <linux/amlogic/media/vout/lcd/aml_ldim.h>
#include <linux/amlogic/media/vout/lcd/aml_bl.h>
#include "iw7027_bl.h"
#include "ldim_drv.h"
#include "ldim_dev_drv.h"
@@ -342,8 +341,8 @@ static inline unsigned int iw7027_get_value(unsigned int level)
static int iw7027_smr(unsigned short *buf, unsigned char len)
{
int i, j;
unsigned int value_flag = 0;
int i;
unsigned int value_flag = 0, temp;
unsigned char val[20];
unsigned short *mapping;
struct aml_ldim_driver_s *ldim_drv = aml_ldim_get_driver();
@@ -371,59 +370,26 @@ static int iw7027_smr(unsigned short *buf, unsigned char len)
dim_max = ldim_drv->ldev_conf->dim_max;
dim_min = ldim_drv->ldev_conf->dim_min;
for (i = 0; i < 10; i++)
value_flag = value_flag || buf[i];
if (value_flag == 0) {
for (j = 0; j < 20; j++)
val[j] = 0;
goto iw7027_smr_end;
}
if (bl_iw7027->test_mode) {
val[0] = (test_brightness[0] & 0xf00) >> 8;
val[1] = test_brightness[0] & 0xff;
val[2] = (test_brightness[1] & 0xf00) >> 8;
val[3] = test_brightness[1] & 0xff;
val[4] = (test_brightness[2] & 0xf00) >> 8;
val[5] = test_brightness[2] & 0xff;
val[6] = (test_brightness[3] & 0xf00) >> 8;
val[7] = test_brightness[3] & 0xff;
val[8] = (test_brightness[4] & 0xf00) >> 8;
val[9] = test_brightness[4] & 0xff;
val[10] = (test_brightness[5] & 0xf00) >> 8;
val[11] = test_brightness[5] & 0xff;
val[12] = (test_brightness[6] & 0xf00) >> 8;
val[13] = test_brightness[6] & 0xff;
val[14] = (test_brightness[7] & 0xf00) >> 8;
val[15] = test_brightness[7] & 0xff;
val[16] = (test_brightness[8] & 0xf00) >> 8;
val[17] = test_brightness[8] & 0xff;
val[18] = (test_brightness[9] & 0xf00) >> 8;
val[19] = test_brightness[9] & 0xff;
for (i = 0; i < 10; i++) {
val[2*i] = (test_brightness[i] >> 8) & 0xf;
val[2*i+1] = test_brightness[i] & 0xff;
}
} else {
val[0] = ((iw7027_get_value(buf[mapping[0]])) & 0xf00) >> 8;
val[1] = (iw7027_get_value(buf[mapping[0]])) & 0xff;
val[2] = ((iw7027_get_value(buf[mapping[1]])) & 0xf00) >> 8;
val[3] = (iw7027_get_value(buf[mapping[1]])) & 0xff;
val[4] = ((iw7027_get_value(buf[mapping[2]])) & 0xf00) >> 8;
val[5] = (iw7027_get_value(buf[mapping[2]])) & 0xff;
val[6] = ((iw7027_get_value(buf[mapping[3]])) & 0xf00) >> 8;
val[7] = (iw7027_get_value(buf[mapping[3]])) & 0xff;
val[8] = ((iw7027_get_value(buf[mapping[4]])) & 0xf00) >> 8;
val[9] = (iw7027_get_value(buf[mapping[4]])) & 0xff;
val[10] = ((iw7027_get_value(buf[mapping[5]])) & 0xf00) >> 8;
val[11] = (iw7027_get_value(buf[mapping[5]])) & 0xff;
val[12] = ((iw7027_get_value(buf[mapping[6]])) & 0xf00) >> 8;
val[13] = (iw7027_get_value(buf[mapping[6]])) & 0xff;
val[14] = ((iw7027_get_value(buf[mapping[7]])) & 0xf00) >> 8;
val[15] = (iw7027_get_value(buf[mapping[7]])) & 0xff;
val[16] = ((iw7027_get_value(buf[mapping[8]])) & 0xf00) >> 8;
val[17] = (iw7027_get_value(buf[mapping[8]])) & 0xff;
val[18] = ((iw7027_get_value(buf[mapping[9]])) & 0xf00) >> 8;
val[19] = (iw7027_get_value(buf[mapping[9]])) & 0xff;
for (i = 0; i < 10; i++)
value_flag += buf[i];
if (value_flag == 0) {
for (i = 0; i < 20; i++)
val[i] = 0;
} else {
for (i = 0; i < 10; i++) {
temp = iw7027_get_value(buf[mapping[i]]);
val[2*i] = (temp >> 8) & 0xf;
val[2*i+1] = temp & 0xff;
}
}
}
iw7027_smr_end:
iw7027_wregs(bl_iw7027->spi, 0x40, val, 20);
iw7027_spi_op_flag = 0;

View File

@@ -1,115 +0,0 @@
/*
* drivers/amlogic/media/vout/backlight/aml_ldim/iw7027_bl.h
*
* Copyright (C) 2017 Amlogic, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
*/
#ifndef __IW7027_HW_H
#define __IW7027_HW_H
#define CHECK_INIT_DONE_MAX_COUNT 10
#define BRIGHTNESS_2D 0x7FF
#define BRIGHTNESS_3D 0x333
#define BRIGHTNESS_2D_MAX 0xFFF
#define BRIGHTNESS_3D_MAX 0x500
/* skyworht 39" */
#define ISET_VALUE_2D_SKY39 0xB43C
#define ISET_VALUE_3D_SKY39 0xB4B4
#define VDAC_VALUE_2D_SKY39 0xE5
#define VDAC_VALUE_3D_SKY39 0x85
#define VDAC_MIN_2D_SKY39 0xB0
#define VDAC_MAX_2D_SKY39 0xF1
#define VDAC_MIN_3D_SKY39 0x00
#define VDAC_MAX_3D_SKY39 0x96
/* skyworht 42" */
#define ISET_VALUE_2D_SKY42 0xA537
#define ISET_VALUE_3D_SKY42 0xA5A5
#define VDAC_VALUE_2D_SKY42 0xE6
#define VDAC_VALUE_3D_SKY42 0x84
#define VDAC_MIN_2D_SKY42 0xB3
#define VDAC_MAX_2D_SKY42 0xF4
#define VDAC_MIN_3D_SKY42 0x3A
#define VDAC_MAX_3D_SKY42 0x97
/* skyworht 50" */
#define ISET_VALUE_2D_SKY50 0xB43C
#define ISET_VALUE_3D_SKY50 0xB4B4
#define VDAC_VALUE_2D_SKY50 0xE1
#define VDAC_VALUE_3D_SKY50 0x77
#define VDAC_MIN_2D_SKY50 0xC0
#define VDAC_MAX_2D_SKY50 0xF5
#define VDAC_MIN_3D_SKY50 0x47
#define VDAC_MAX_3D_SKY50 0xA3
#define EEPROM_ADDR_VDAC_2D 3504 /* 0xDB0 */
#define EEPROM_ADDR_VDAC_3D 3506 /* 0xDB2 */
#define VSYNC_CNT_2D_3D 64
#define VSYNC_CNT_3D_2D 64
#define VSYNC_CNT_SET_BRI_ZERO 49
#define VSYNC_CNT_RAMP 45
#define VSYNC_CNT_SET_BRI_2D 15
#define VSYNC_CNT_SET_BRI_3D 15
#define VSYNC_CNT_WAIT_EN_PROT 0
/* scan timing parameters for 42"*/
#define DEFAULT_TD0_2D 333 /* 0.333ms */
#define DEFAULT_DG1_2D 720 /* 0.720ms */
#define DEFAULT_DELTAT_2D 790 /* 0.790ms */
#define DEFAULT_TD0_3D 333 /* 0.333ms */
#define DEFAULT_DG1_3D 720 /* 0.720ms */
#define DEFAULT_DELTAT_3D 790 /* 0.790ms */
/* scan timing parameters for 39"*/
#define DEFAULT_TD0_2D_SKY39 333 /* 0.333ms */
#define DEFAULT_DG1_2D_SKY39 700 /* 0.700ms */
#define DEFAULT_DELTAT_2D_SKY39 1104 /* 1.104ms */
#define DEFAULT_TD0_3D_SKY39 333 /* 0.333ms */
#define DEFAULT_DG1_3D_SKY39 700 /* 0.700ms */
#define DEFAULT_DELTAT_3D_SKY39 1104 /* 1.104ms */
/* scan timing parameters for 50"*/
#define DEFAULT_TD0_2D_SKY50 333 /* 0.333ms */
#define DEFAULT_DG1_2D_SKY50 720 /* 0.720ms */
#define DEFAULT_DELTAT_2D_SKY50 790 /* 1.120ms */
#define DEFAULT_TD0_3D_SKY50 333 /* 0.333ms */
#define DEFAULT_DG1_3D_SKY50 720 /* 0.720ms */
#define DEFAULT_DELTAT_3D_SKY50 790 /* 1.120ms */
#define EEPROM_ADDR_PANEL 3463
struct iwatt_reg_map {
u16 addr;
u16 val_2d;
u16 val_3d;
};
extern int dirspi_write(struct spi_device *spi, u8 *buf, int len);
extern int dirspi_read(struct spi_device *spi, u8 *buf, int len);
extern void dirspi_start(struct spi_device *spi);
extern void dirspi_stop(struct spi_device *spi);
#endif /* __IW7027_HW_H */

File diff suppressed because it is too large Load Diff

View File

@@ -32,7 +32,9 @@
#define LDIMPR(fmt, args...) pr_info("ldim: "fmt"", ## args)
#define LDIMERR(fmt, args...) pr_err("ldim: error: "fmt"", ## args)
extern unsigned int ldim_debug_print;
#define LDIM_DRV_VER "20180629"
extern unsigned char ldim_debug_print;
/*** GXTVBB & TXLX common use register*/
/* each base has 16 address space */
@@ -110,6 +112,7 @@ extern unsigned int ldim_debug_print;
#define LD_DATA_DEPTH 12
#define LD_DATA_MIN 10
#define LD_DATA_MAX 0xfff
struct LDReg {

View File

@@ -617,6 +617,7 @@ void ldim_set_region(unsigned int resolution, unsigned int blk_height,
}
}
static unsigned int invalid_val_cnt;
void ldim_stts_read_region(unsigned int nrow, unsigned int ncol)
{
unsigned int i, j, k;

View File

@@ -18,8 +18,6 @@
#include <linux/cdev.h>
#include <linux/amlogic/iomap.h>
extern unsigned int invalid_val_cnt;
#define Wr_reg_bits(adr, val, start, len) \
aml_vcbus_update_bits(adr, ((1<<len)-1)<<start, val<<start)
/* #define Rd_reg_bits(adr, start, len) \

View File

@@ -181,8 +181,8 @@ struct aml_bl_drv_s {
struct backlight_device *bldev;
struct workqueue_struct *workqueue;
struct delayed_work bl_delayed_work;
struct resource *res_ldim_irq;
struct resource *res_rdma_irq;
struct resource *res_ldim_vsync_irq;
struct resource *res_ldim_rdma_irq;
};
extern struct aml_bl_drv_s *aml_bl_get_driver(void);

View File

@@ -24,6 +24,11 @@
#include <linux/amlogic/media/vout/lcd/aml_bl.h>
#include <linux/spi/spi.h>
extern int dirspi_write(struct spi_device *spi, u8 *buf, int len);
extern int dirspi_read(struct spi_device *spi, u8 *buf, int len);
extern void dirspi_start(struct spi_device *spi);
extern void dirspi_stop(struct spi_device *spi);
#define _VE_LDIM 'C'
/* VPP.ldim IOCTL command list */