Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DPMS off support. #117

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions arch/arm/configs/sun4i_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,9 @@ CONFIG_DRM=m
CONFIG_DRM_MALI=m
CONFIG_MALI=m
CONFIG_FB=y
CONFIG_FB_SUNXI=m
CONFIG_FB_SUNXI_LCD=m
CONFIG_FB_SUNXI_HDMI=m
CONFIG_FB_SUNXI=y
CONFIG_FB_SUNXI_LCD=y
CONFIG_FB_SUNXI_HDMI=y
CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_SOUND=y
CONFIG_SND=y
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-sun3i/include/mach/gpio_v2.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ extern int gpio_exit(void);
*
************************************************************************************************************
*/
extern unsigned gpio_request (user_gpio_set_t *gpio_list, unsigned group_count_max );
extern unsigned sunxi_gpio_request_array(user_gpio_set_t *gpio_list,
unsigned group_count_max);
extern unsigned gpio_request_ex(char *main_name, const char *sub_name); //设备申请GPIO函数扩展接口
/*
************************************************************************************************************
Expand Down
7 changes: 4 additions & 3 deletions arch/arm/mach-sun3i/pin/pin_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ __s32 gpio_exit(void) //gpio退出函数接口
*
************************************************************************************************************
*/
u32 gpio_request(user_gpio_set_t *gpio_list, __u32 group_count_max) //设备申请GPIO函数接口
u32 sunxi_gpio_request_array(user_gpio_set_t *gpio_list, __u32 group_count_max)
{
char *user_gpio_buf; //按照char类型申请
system_gpio_set_t *user_gpio_set, *tmp_sys_gpio_data; //user_gpio_set将是申请内存的句柄
Expand Down Expand Up @@ -353,7 +353,8 @@ u32 gpio_request_ex(char *main_name, const char *sub_name) //设备申请GPIO
return EGPIO_FAIL;
}
if(!script_parser_mainkey_get_gpio_cfg(main_name,gpio_list,gpio_count)){
gpio_handle = gpio_request(gpio_list, gpio_count);
gpio_handle = sunxi_gpio_request_array(gpio_list,
gpio_count);
CSP_OSAL_FREE(gpio_list);
}else{
return EGPIO_FAIL;
Expand All @@ -362,7 +363,7 @@ u32 gpio_request_ex(char *main_name, const char *sub_name) //设备申请GPIO
if(script_parser_fetch((char *)main_name, (char *)sub_name, (int *)&one_gpio, (sizeof(user_gpio_set_t) >> 2)) < 0){
return EGPIO_FAIL;
}
gpio_handle = gpio_request(&one_gpio, 1);
gpio_handle = sunxi_gpio_request_array(&one_gpio, 1);
}

return gpio_handle;
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-sun3i/pin/pin_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ static int __init aw_pin_test_init(void)

ret = script_parser_mainkey_get_gpio_cfg("uart_para", (void *)gpio_set, 38);
if(!ret) {
gpio_handle = gpio_request(gpio_set, 38);
gpio_handle = sunxi_gpio_request_array(gpio_set, 38);
printk("gpio_handle=0x%08x, ret=%d\n", gpio_handle,ret);

ret = gpio_release(gpio_handle, 2);
Expand Down
23 changes: 0 additions & 23 deletions arch/arm/mach-sun5i/devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,28 +43,6 @@
#include <mach/hardware.h>
#include <mach/i2c.h>

/* uart */
static struct plat_serial8250_port debug_uart_platform_data[] = {
{
.membase = (void __iomem *)SW_VA_UART0_IO_BASE,
.irq = SW_INT_IRQNO_UART0,
.flags = UPF_BOOT_AUTOCONF,
.iotype = UPIO_MEM32,
.regshift = 2,
.uartclk = 24000000,
}, {
.flags = 0
}
};

static struct platform_device debug_uart = {
.name = "serial8250",
.id = PLAT8250_DEV_PLATFORM,
.dev = {
.platform_data = debug_uart_platform_data,
},
};

/* dma */
static struct platform_device sw_pdev_dmac = {
.name = "sw_dmac",
Expand Down Expand Up @@ -192,7 +170,6 @@ struct platform_device sun5i_pmu_device = {
};

static struct platform_device *sw_pdevs[] __initdata = {
&debug_uart,
&sw_pdev_dmac,
&sw_pdev_nand,
&sun5i_twi0_device,
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/plat-sunxi/include/plat/sys_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ extern int script_parser_mainkey_get_gpio_cfg(char *main_name, void *gpio_cfg, i
/* gpio operations */
extern int gpio_init(void);
extern int gpio_exit(void);
extern unsigned gpio_request(user_gpio_set_t *gpio_list, unsigned group_count_max);
extern unsigned sunxi_gpio_request_array(user_gpio_set_t *gpio_list,
unsigned group_count_max);
extern unsigned gpio_request_ex(char *main_name, const char *sub_name);
extern int gpio_release(unsigned p_handler, int if_release_to_default_status);
extern int gpio_get_all_pin_status(unsigned p_handler, user_gpio_set_t *gpio_status, unsigned gpio_count_max, unsigned if_get_from_hardware);
Expand Down
9 changes: 5 additions & 4 deletions arch/arm/plat-sunxi/sys_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ __s32 gpio_exit(void)
*
*
*/
u32 gpio_request(user_gpio_set_t *gpio_list, __u32 group_count_max)
u32 sunxi_gpio_request_array(user_gpio_set_t *gpio_list, __u32 group_count_max)
{
char *user_gpio_buf; /* 按照char类型申请 */
system_gpio_set_t *user_gpio_set, *tmp_sys_gpio_data; /* user_gpio_set将是申请内存的句柄 */
Expand Down Expand Up @@ -455,7 +455,7 @@ u32 gpio_request(user_gpio_set_t *gpio_list, __u32 group_count_max)

return (u32)user_gpio_buf;
}
EXPORT_SYMBOL_GPL(gpio_request);
EXPORT_SYMBOL_GPL(sunxi_gpio_request_array);

/*
* CSP_GPIO_Request_EX
Expand Down Expand Up @@ -490,7 +490,8 @@ u32 gpio_request_ex(char *main_name, const char *sub_name) /* 设备申请GPIO
return 0;
}
if (!script_parser_mainkey_get_gpio_cfg(main_name, gpio_list, gpio_count)) {
gpio_handle = gpio_request(gpio_list, gpio_count);
gpio_handle = sunxi_gpio_request_array(gpio_list,
gpio_count);
kfree(gpio_list);
} else {
return 0;
Expand All @@ -501,7 +502,7 @@ u32 gpio_request_ex(char *main_name, const char *sub_name) /* 设备申请GPIO
return 0;
}

gpio_handle = gpio_request(&one_gpio, 1);
gpio_handle = sunxi_gpio_request_array(&one_gpio, 1);
}

return gpio_handle;
Expand Down
45 changes: 24 additions & 21 deletions drivers/input/touchscreen/ft5x_ts.c
Original file line number Diff line number Diff line change
Expand Up @@ -1413,49 +1413,53 @@ static void ft5x_report_multitouch(void)
switch(event->touch_point) {
case 5:
input_report_abs(data->input_dev, ABS_MT_TRACKING_ID, event->touch_ID5);
input_report_abs(data->input_dev, ABS_MT_TOUCH_MAJOR, event->pressure);
input_report_abs(data->input_dev, ABS_MT_TOUCH_MAJOR, 1);
input_report_abs(data->input_dev, ABS_MT_POSITION_X, event->x5);
input_report_abs(data->input_dev, ABS_MT_POSITION_Y, event->y5);
input_report_abs(data->input_dev, ABS_MT_WIDTH_MAJOR, 1);
input_report_abs(data->input_dev, ABS_MT_PRESSURE, event->pressure);
input_report_key(data->input_dev, BTN_TOUCH, 1);
input_mt_sync(data->input_dev);
print_point_info("===x5 = %d,y5 = %d ====\n",event->x2,event->y2);
print_point_info("===x5 = %d,y5 = %d ====\n",event->x5,event->y5);
case 4:
input_report_abs(data->input_dev, ABS_MT_TRACKING_ID, event->touch_ID4);
input_report_abs(data->input_dev, ABS_MT_TOUCH_MAJOR, event->pressure);
input_report_abs(data->input_dev, ABS_MT_TOUCH_MAJOR, 1);
input_report_abs(data->input_dev, ABS_MT_POSITION_X, event->x4);
input_report_abs(data->input_dev, ABS_MT_POSITION_Y, event->y4);
input_report_abs(data->input_dev, ABS_MT_WIDTH_MAJOR, 1);
input_report_abs(data->input_dev, ABS_MT_PRESSURE, event->pressure);
input_report_key(data->input_dev, BTN_TOUCH, 1);
input_mt_sync(data->input_dev);
print_point_info("===x4 = %d,y4 = %d ====\n",event->x2,event->y2);
print_point_info("===x4 = %d,y4 = %d ====\n",event->x4,event->y4);
case 3:
input_report_abs(data->input_dev, ABS_MT_TRACKING_ID, event->touch_ID3);
input_report_abs(data->input_dev, ABS_MT_TOUCH_MAJOR, event->pressure);
input_report_abs(data->input_dev, ABS_MT_TOUCH_MAJOR, 1);
input_report_abs(data->input_dev, ABS_MT_POSITION_X, event->x3);
input_report_abs(data->input_dev, ABS_MT_POSITION_Y, event->y3);
input_report_abs(data->input_dev, ABS_MT_WIDTH_MAJOR, 1);
input_report_abs(data->input_dev, ABS_MT_PRESSURE, event->pressure);
input_report_key(data->input_dev, BTN_TOUCH, 1);
input_mt_sync(data->input_dev);
print_point_info("===x3 = %d,y3 = %d ====\n",event->x2,event->y2);
print_point_info("===x3 = %d,y3 = %d ====\n",event->x3,event->y3);
case 2:
input_report_abs(data->input_dev, ABS_MT_TRACKING_ID, event->touch_ID2);
input_report_abs(data->input_dev, ABS_MT_TOUCH_MAJOR, event->pressure);
input_report_abs(data->input_dev, ABS_MT_TOUCH_MAJOR, 1);
input_report_abs(data->input_dev, ABS_MT_POSITION_X, event->x2);
input_report_abs(data->input_dev, ABS_MT_POSITION_Y, event->y2);
input_report_abs(data->input_dev, ABS_MT_WIDTH_MAJOR, 1);
input_report_abs(data->input_dev, ABS_MT_PRESSURE, event->pressure);
input_report_key(data->input_dev, BTN_TOUCH, 1);
input_mt_sync(data->input_dev);
print_point_info("===x2 = %d,y2 = %d ====\n",event->x2,event->y2);
case 1:
input_report_abs(data->input_dev, ABS_X, event->x1);
input_report_abs(data->input_dev, ABS_Y, event->y1);
input_report_abs(data->input_dev, ABS_PRESSURE, 1);
input_report_key(data->input_dev, BTN_TOUCH, 1);
input_report_abs(data->input_dev, ABS_PRESSURE, event->pressure);

input_report_abs(data->input_dev, ABS_MT_TRACKING_ID, event->touch_ID1);
input_report_abs(data->input_dev, ABS_MT_TOUCH_MAJOR, event->pressure);
input_report_abs(data->input_dev, ABS_MT_TOUCH_MAJOR, 1);
input_report_abs(data->input_dev, ABS_MT_POSITION_X, event->x1);
input_report_abs(data->input_dev, ABS_MT_POSITION_Y, event->y1);
input_report_abs(data->input_dev, ABS_MT_WIDTH_MAJOR, 1);
input_report_abs(data->input_dev, ABS_MT_PRESSURE, event->pressure);
input_report_key(data->input_dev, BTN_TOUCH, 1);
input_mt_sync(data->input_dev);
print_point_info("===x1 = %d,y1 = %d ====\n",event->x1,event->y1);
print_point_info("===x1 = %d,y1 = %d, pressure = %d ====\n",event->x1,event->y1,event->pressure);
break;
default:
print_point_info("==touch_point default =\n");
Expand Down Expand Up @@ -1689,21 +1693,20 @@ ft5x_ts_probe(struct i2c_client *client, const struct i2c_device_id *id)
input_set_abs_params(input_dev,
ABS_Y, 0, SCREEN_MAX_Y, 0, 0);
input_set_abs_params(input_dev,
ABS_PRESSURE, 0, 1, 0 , 0);
ABS_PRESSURE, 0, PRESS_MAX, 0 , 0);
input_set_abs_params(input_dev,
ABS_MT_PRESSURE, 0, PRESS_MAX, 0 , 0);

set_bit(ABS_MT_TOUCH_MAJOR, input_dev->absbit);
set_bit(ABS_MT_POSITION_X, input_dev->absbit);
set_bit(ABS_MT_POSITION_Y, input_dev->absbit);
set_bit(ABS_MT_WIDTH_MAJOR, input_dev->absbit);

input_set_abs_params(input_dev,
ABS_MT_POSITION_X, 0, SCREEN_MAX_X, 0, 0);
input_set_abs_params(input_dev,
ABS_MT_POSITION_Y, 0, SCREEN_MAX_Y, 0, 0);
input_set_abs_params(input_dev,
ABS_MT_TOUCH_MAJOR, 0, PRESS_MAX, 0, 0);
input_set_abs_params(input_dev,
ABS_MT_WIDTH_MAJOR, 0, 200, 0, 0);
ABS_MT_TOUCH_MAJOR, 0, 1, 0, 0);
input_set_abs_params(input_dev,
ABS_MT_TRACKING_ID, 0, 4, 0, 0);
#ifdef TOUCH_KEY_SUPPORT
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/ethernet/sun4i/sun4i_wemac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1798,7 +1798,8 @@ static int __devinit wemac_probe(struct platform_device *pdev)
(int *)(db->mos_gpio), &t,
sizeof(user_gpio_set_t)/sizeof(int)) &&
t == SCRIPT_PARSER_VALUE_TYPE_GPIO_WORD) {
db->mos_pin_handler = gpio_request(db->mos_gpio, 1);
db->mos_pin_handler =
sunxi_gpio_request_array(db->mos_gpio, 1);
if (0 == db->mos_pin_handler)
printk(KERN_ERR "can't request gpio_port %d, port_num %d\n",
db->mos_gpio->port, db->mos_gpio->port_num);
Expand Down
5 changes: 5 additions & 0 deletions drivers/power/axp_power/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ choice
prompt "AXP PMU type"
default AW_AXP20

config AW_AXP15
bool "AXP15 driver"
---help---
AXP15 driver

config AW_AXP18
bool "AXP18 driver"
---help---
Expand Down
11 changes: 10 additions & 1 deletion drivers/power/axp_power/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ obj-y += axp-mfd.o

#axp 199
#Make this built-in, so that it will be loaded before I2C driver

obj-$(CONFIG_AW_AXP15) += axp15-board.o
obj-$(CONFIG_AW_AXP15) += axp15-gpio.o
obj-$(CONFIG_AW_AXP15) += axp15-regu.o
obj-$(CONFIG_AW_AXP15) += axp15-sply.o
obj-$(CONFIG_AW_AXP15) += virtual15.o
obj-$(CONFIG_AW_AXP15) += virtual15_dev.o


obj-$(CONFIG_AW_AXP18) += axp18-board.o
obj-$(CONFIG_AW_AXP18) += axp18-regu.o
obj-$(CONFIG_AW_AXP18) += axp18-sply.o
Expand All @@ -20,4 +29,4 @@ obj-$(CONFIG_AW_AXP20) += axp20-regu.o
obj-$(CONFIG_AW_AXP20) += axp20-sply.o
obj-$(CONFIG_AW_AXP20) += axp20-gpio.o
obj-$(CONFIG_AW_AXP20) += virtual20.o
obj-$(CONFIG_AW_AXP20) += virtual20_dev.o
obj-$(CONFIG_AW_AXP20) += virtual20_dev.o
13 changes: 12 additions & 1 deletion drivers/power/axp_power/axp-cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,28 @@

#ifndef __LINUX_AXP_CFG_H_
#define __LINUX_AXP_CFG_H_
/*AXP15 addr*/
#define AXP15_ADDR 0x60 >> 1

#define AXP18_ADDR 0x2C >> 1
#define AXP19_ADDR 0x68 >> 1
#define AXP20_ADDR 0x68 >> 1
#define AXP18_I2CBUS 1
#define AXP19_I2CBUS 0
#define AXP15_I2CBUS 0

#define AXP20_I2CBUS 0
#define BATRDC 200 //initial rdc
#define AXP20_IRQNO 0

#define AXP15_IRQNO 0

#define LDO1SET 0 //0: LDO1SET connect AGND, 1: LDO1SET connect AIPS, for axp189 LDOSET bonding to AGND
#define DC2SET 1 //0: DC2SET connect GND, 1: DC2SET connect IPSOUT, for axp189 DC2SET bonding to IPSOUT
#define DC3SET 1 //0:DC3SET connect GND, 1:DC3SET connect IPSOUT ,for axp189 DC3SET to pin

#define AXP19LDO1 1250
#define AXP20LDO1 1300
#define AXP15LDO1 1300


#if !LDO1SET
Expand Down Expand Up @@ -69,6 +74,11 @@
#define LDO3MAX 2600
#endif

#define AXP15_VOL_MAX 50
#define AXP15_TIME_MAX 20
#define AXP15_AVER_MAX 10
#define AXP15_RDC_COUNT 10

#define AXP18_VOL_MAX 50//1200
#define AXP18_TIME_MAX 20//100
#define AXP18_RDC_COUNT 10
Expand All @@ -77,6 +87,7 @@
#define MAX_BAT_CUR 15
#define DISCHARGE_RDC_CAL 53


#define AXP19_VOL_MAX 50
#define AXP19_TIME_MAX 20
#define AXP19_AVER_MAX 10
Expand Down
8 changes: 8 additions & 0 deletions drivers/power/axp_power/axp-gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@
/*
* GPIO Registers.
*/
/*AXP15*/
#define AXP15_GPIO0_CFG (POWER15_GPIO0_CTL)
#define AXP15_GPIO1_CFG (POWER15_GPIO1_CTL)
#define AXP15_GPIO2_CFG (POWER15_GPIO2_CTL)
#define AXP15_GPIO3_CFG (POWER15_GPIO3_CTL)

#define AXP15_GPIO0123_STATE (POWER15_GPIO0123_SIGNAL)

/* AXP19 */
#define AXP19_GPIO0_CFG (POWER19_GPIO0_CTL)
#define AXP19_GPIO1_CFG (POWER19_GPIO1_CTL)
Expand Down
Loading