Last active
December 25, 2022 10:30
-
-
Save bakueikozo/87c9e1a05ce775de773658a47b0fb3d4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -r 1/linux-z7213/.gitignore 2/linux-z7213/.gitignore | |
100a101,106 | |
> | |
> # for yocto recipes-kernel build | |
> arch/arm/boot/vmlinux | |
> oe-logs | |
> oe-workdir | |
> source | |
diff -r 1/linux-z7213/arch/arm/include/asm/uaccess.h 2/linux-z7213/arch/arm/include/asm/uaccess.h | |
162c162 | |
< register const typeof(*(p)) __r2 asm("r2") = (x); \ | |
--- | |
> register typeof(*(p)) __r2 asm("r2") = (x); \ | |
diff -r 1/linux-z7213/arch/arm/mach-sunxi/sun8i.c 2/linux-z7213/arch/arm/mach-sunxi/sun8i.c | |
179c179 | |
< #if defined(CONFIG_KEYBOARD_GPIO) | |
--- | |
> #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_POLLED) | |
182,266d181 | |
< #if 0 | |
< static struct gpio_keys_button gpio_buttons[] = { | |
< { | |
< .gpio = GPIOG(0), | |
< .code = KEY_UP, | |
< .desc = "Up", | |
< .active_low = 1, | |
< .debounce_interval = 5, | |
< .type = EV_KEY, | |
< }, | |
< { | |
< .gpio = GPIOG(1), | |
< .code = KEY_LEFT, | |
< .desc = "Left", | |
< .active_low = 1, | |
< .debounce_interval = 5, | |
< .type = EV_KEY, | |
< }, | |
< { | |
< .gpio = GPIOG(2), | |
< .code = KEY_DOWN, | |
< .desc = "Down", | |
< .active_low = 1, | |
< .debounce_interval = 5, | |
< .type = EV_KEY, | |
< }, | |
< { | |
< .gpio = GPIOG(3), | |
< .code = KEY_RIGHT, | |
< .desc = "Right", | |
< .active_low = 1, | |
< .debounce_interval = 5, | |
< .type = EV_KEY, | |
< }, | |
< { | |
< .gpio = GPIOG(4), | |
< .code = BTN_SELECT, | |
< .desc = "Select", | |
< .active_low = 1, | |
< .debounce_interval = 5, | |
< .type = EV_KEY, | |
< }, | |
< { | |
< .gpio = GPIOG(5), | |
< .code = KEY_ENTER, | |
< .desc = "Start", | |
< .active_low = 1, | |
< .debounce_interval = 5, | |
< .type = EV_KEY, | |
< }, | |
< { | |
< .gpio = GPIOG(6), | |
< .code = KEY_S, | |
< .desc = "densya_D", | |
< .active_low = 1, | |
< .debounce_interval = 5, | |
< .type = EV_KEY, | |
< }, | |
< { | |
< .gpio = GPIOG(7), | |
< .code = KEY_A, | |
< .desc = "densya_A", | |
< .active_low = 1, | |
< .debounce_interval = 5, | |
< .type = EV_KEY, | |
< }, | |
< { | |
< .gpio = GPIOG(8), | |
< .code = KEY_Z, | |
< .desc = "densya_B", | |
< .active_low = 1, | |
< .debounce_interval = 5, | |
< .type = EV_KEY, | |
< }, | |
< { | |
< .gpio = GPIOG(9), | |
< .code = KEY_X, | |
< .desc = "densya_C", | |
< .active_low = 1, | |
< .debounce_interval = 5, | |
< .type = EV_KEY, | |
< }, | |
< | |
< }; | |
< #endif | |
274a190 | |
> #if defined(CONFIG_KEYBOARD_GPIO) | |
275a192,194 | |
> #elif defined(CONFIG_KEYBOARD_GPIO_POLLED) | |
> .name = "gpio-keys-polled", | |
> #endif | |
282a202 | |
> #endif // defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_POLLED) | |
291c211 | |
< #if defined(CONFIG_KEYBOARD_GPIO) | |
--- | |
> #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_POLLED) | |
295d214 | |
< #endif | |
442,443c361 | |
< //int key_cnt = 0; | |
< char key_io[16], key_code[16]; | |
--- | |
> char buf[25]; | |
451a370,371 | |
> | |
> #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_POLLED) | |
453a374,382 | |
> | |
> type = script_get_item("gpiokey_para", "poll_interval", &val); | |
> if(SCIRPT_ITEM_VALUE_TYPE_INT != type){ | |
> pr_err("%s: get poll_interval err! \n", __func__); | |
> return; | |
> } | |
> gpio_buttons_data.poll_interval = val.val; | |
> printk("%s %d gpio_buttons_data.poll_interval=%d \n", __func__, __LINE__, gpio_buttons_data.poll_interval); | |
> | |
455,457c384,385 | |
< #if 1 | |
< sprintf(key_io, "key%d_io", i); | |
< type = script_get_item("gpiokey_para", key_io, &val); | |
--- | |
> sprintf(buf, "key%d_io", i); | |
> type = script_get_item("gpiokey_para", buf, &val); | |
459c387 | |
< pr_err("%s: get %s err! \n", __func__, key_io); | |
--- | |
> pr_err("%s: get %s err! \n", __func__, buf); | |
465,466c393,394 | |
< sprintf(key_code, "key%d_code", i); | |
< type = script_get_item("gpiokey_para", key_code, &val); | |
--- | |
> sprintf(buf, "key%d_code", i); | |
> type = script_get_item("gpiokey_para", buf, &val); | |
468c396 | |
< pr_err("%s: get %s err! \n", __func__, key_code); | |
--- | |
> pr_err("%s: get %s err! \n", __func__, buf); | |
473c401,410 | |
< | |
--- | |
> | |
> sprintf(buf, "key%d_debounce_interval", i); | |
> type = script_get_item("gpiokey_para", buf, &val); | |
> if(SCIRPT_ITEM_VALUE_TYPE_INT != type){ | |
> pr_err("%s: get %s err! \n", __func__, buf); | |
> return; | |
> } | |
> | |
> gpio_buttons[i].debounce_interval = val.val; | |
> | |
475d411 | |
< gpio_buttons[i].debounce_interval = 5; | |
478,479c414 | |
< #endif | |
< printk("%s %d gpio_buttons[i].gpio=%d gpio_buttons[i].code=%d \n", __func__, __LINE__, gpio_buttons[i].gpio, gpio_buttons[i].code); | |
--- | |
> printk("%s %d gpio_buttons[i].gpio=%d gpio_buttons[i].code=%d gpio_buttons[i].debounce_interval=%d\n", __func__, __LINE__, gpio_buttons[i].gpio, gpio_buttons[i].code, gpio_buttons[i].debounce_interval); | |
481a417,419 | |
> | |
> #endif // defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_POLLED) | |
> | |
diff -r 1/linux-z7213/drivers/clk/sunxi/clk-sun8iw5.c 2/linux-z7213/drivers/clk/sunxi/clk-sun8iw5.c | |
74c74 | |
< SUNXI_CLK_FACTORS(pll_audio, 8, 7, 0, 0, 0, 5, 16, 4, 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, 0, 0); | |
--- | |
> SUNXI_CLK_FACTORS(pll_audio, 8, 7, 0, 0, 0, 5, 16, 4, 0, 0, 0, 0, 0, 0, 0, 31, 24, 1, PLL_AUDIOPAT,0xc00121ff); | |
146,153c146,155 | |
< if(rate == 22579200) { | |
< factor->factorn = 78; | |
< factor->factorm = 20; | |
< factor->factorp = 3; | |
< } else if(rate == 24576000) { | |
< factor->factorn = 85; | |
< factor->factorm = 20; | |
< factor->factorp = 3; | |
--- | |
> if (rate == 22579200) { | |
> factor->factorn = 6; | |
> factor->factorm = 0; | |
> factor->factorp = 7; | |
> sunxi_clk_factor_pll_audio.sdmval = 0xc0010d84; | |
> } else if (rate == 24576000) { | |
> factor->factorn = 13; | |
> factor->factorm = 0; | |
> factor->factorp = 13; | |
> sunxi_clk_factor_pll_audio.sdmval = 0xc000ac08; | |
350,360c352,361 | |
< u64 tmp_rate = (parent_rate?parent_rate:24000000); | |
< if((factor->factorn == 78) && (factor->factorm == 20) && (factor->factorp == 3)) | |
< return 22579200; | |
< else if((factor->factorn == 85) && (factor->factorm == 20) && (factor->factorp == 3)) | |
< return 24576000; | |
< else | |
< { | |
< tmp_rate = tmp_rate * (factor->factorn+1); | |
< do_div(tmp_rate, (factor->factorm+1) * (factor->factorp+1)); | |
< return (unsigned long)tmp_rate; | |
< } | |
--- | |
> u64 tmp_rate = (parent_rate ? parent_rate : 24000000); | |
> if ((factor->factorn == 6) && (factor->factorm == 0) && (factor->factorp == 7)) | |
> return 22579200; | |
> else if ((factor->factorn == 13) && (factor->factorm == 0) && (factor->factorp == 13)) | |
> return 24576000; | |
> else { | |
> tmp_rate = tmp_rate * (factor->factorn+1); | |
> do_div(tmp_rate, (factor->factorm+1) * (factor->factorp+1)); | |
> return (unsigned long)tmp_rate; | |
> } | |
diff -r 1/linux-z7213/drivers/clk/sunxi/clk-sun8iw5.h 2/linux-z7213/drivers/clk/sunxi/clk-sun8iw5.h | |
72a73 | |
> #define PLL_AUDIOPAT 0x0284 | |
diff -r 1/linux-z7213/drivers/hid/hid-core.c 2/linux-z7213/drivers/hid/hid-core.c | |
95d94 | |
< static int hid_num=0; | |
1972,1974d1970 | |
< if (hid_num > HID_NUM_MAX) | |
< goto unlock; | |
< | |
1996d1991 | |
< hid_num++; | |
2018,2020d2012 | |
< | |
< if(hid_num > HID_NUM_MIN) | |
< hid_num--; | |
diff -r 1/linux-z7213/drivers/input/evdev.c 2/linux-z7213/drivers/input/evdev.c | |
1012,1014c1012 | |
< for (minor = 0; minor < EVDEV_MINORS; minor++) { | |
< if(minor >3 && minor < 14) //event4~event13 reserved for joystick | |
< continue; | |
--- | |
> for (minor = 0; minor < EVDEV_MINORS; minor++) | |
1017,1080d1014 | |
< } | |
< | |
< if(dev->dev.parent) { | |
< if (!strncmp(dev_name(dev->dev.parent),"1-1.2:",6)) { | |
< minor = 4; | |
< } | |
< else if (!strncmp(dev_name(dev->dev.parent),"1-1.4:",6)) { | |
< minor = 5; | |
< } | |
< else if (!strncmp(dev_name(dev->dev.parent),"1-1.2.1:",8)) { | |
< minor = 6; | |
< } | |
< else if (!strncmp(dev_name(dev->dev.parent),"1-1.2.2:",8)) { | |
< minor = 7; | |
< } | |
< else if (!strncmp(dev_name(dev->dev.parent),"1-1.2.3:",8)) { | |
< minor = 8; | |
< } | |
< else if (!strncmp(dev_name(dev->dev.parent),"1-1.2.4:",8)) { | |
< minor = 9; | |
< } | |
< else if (!strncmp(dev_name(dev->dev.parent),"1-1.4.1:",8)) { | |
< minor = 10; | |
< } | |
< else if (!strncmp(dev_name(dev->dev.parent),"1-1.4.2:",8)) { | |
< minor = 11; | |
< } | |
< else if (!strncmp(dev_name(dev->dev.parent),"1-1.4.3:",8)) { | |
< minor = 12; | |
< } | |
< else if (!strncmp(dev_name(dev->dev.parent),"1-1.4.4:",8)) { | |
< minor = 13; | |
< } | |
< #if 1 | |
< /* Update full-speed hub #1877 */ | |
< else if (!strncmp(dev_name(dev->dev.parent),"2-1.2.1:",8)) { | |
< // printk("[evdev.c] Update full-speed hub.(2-1.2.1)\n"); | |
< minor = 6; | |
< } | |
< else if (!strncmp(dev_name(dev->dev.parent),"2-1.2.2:",8)) { | |
< minor = 7; | |
< } | |
< else if (!strncmp(dev_name(dev->dev.parent),"2-1.2.3:",8)) { | |
< minor = 8; | |
< } | |
< else if (!strncmp(dev_name(dev->dev.parent),"2-1.2.4:",8)) { | |
< minor = 9; | |
< } | |
< else if (!strncmp(dev_name(dev->dev.parent),"2-1.4.1:",8)) { | |
< // printk("[evdev.c] Update full-speed hub.(2-1.4.1)\n"); | |
< minor = 10; | |
< } | |
< else if (!strncmp(dev_name(dev->dev.parent),"2-1.4.2:",8)) { | |
< minor = 11; | |
< } | |
< else if (!strncmp(dev_name(dev->dev.parent),"2-1.4.3:",8)) { | |
< minor = 12; | |
< } | |
< else if (!strncmp(dev_name(dev->dev.parent),"2-1.4.4:",8)) { | |
< minor = 13; | |
< } | |
< #endif | |
< | |
< } | |
diff -r 1/linux-z7213/drivers/input/keyboard/Makefile 2/linux-z7213/drivers/input/keyboard/Makefile | |
58c58 | |
< obj-m += sunxi-knob.o | |
\ No newline at end of file | |
--- | |
> #obj-m += sunxi-knob.o | |
diff -r 1/linux-z7213/drivers/input/keyboard/gpio_keys_polled.c 2/linux-z7213/drivers/input/keyboard/gpio_keys_polled.c | |
55d54 | |
< | |
diff -r 1/linux-z7213/drivers/input/keyboard/sunxi-keyboard.c 2/linux-z7213/drivers/input/keyboard/sunxi-keyboard.c | |
44a45 | |
> #include <mach/sys_config.h> | |
90a92,95 | |
> #define KEYADC_PARA_MAX_LEN 25 | |
> static unsigned int *g_scankeycodes = NULL; | |
> static int g_key_max_count = 0; | |
> | |
448c453 | |
< input_report_key(sunxikbd_dev, sunxi_scankeycodes[scancode], 0); | |
--- | |
> input_report_key(sunxikbd_dev, g_scankeycodes[scancode], 0); | |
450c455 | |
< input_report_key(sunxikbd_dev, sunxi_scankeycodes[scancode], 1); | |
--- | |
> input_report_key(sunxikbd_dev, g_scankeycodes[scancode], 1); | |
457c462 | |
< input_report_key(sunxikbd_dev, sunxi_scankeycodes[transfer_code], 0); | |
--- | |
> input_report_key(sunxikbd_dev, g_scankeycodes[transfer_code], 0); | |
459c464 | |
< input_report_key(sunxikbd_dev, sunxi_scankeycodes[scancode], 1); | |
--- | |
> input_report_key(sunxikbd_dev, g_scankeycodes[scancode], 1); | |
465c470 | |
< input_report_key(sunxikbd_dev, sunxi_scankeycodes[scancode], 1); | |
--- | |
> input_report_key(sunxikbd_dev, g_scankeycodes[scancode], 1); | |
479c484 | |
< input_report_key(sunxikbd_dev, sunxi_scankeycodes[transfer_code], 0); | |
--- | |
> input_report_key(sunxikbd_dev, g_scankeycodes[transfer_code], 0); | |
496c501 | |
< int i; | |
--- | |
> int i, map_start, map_end; | |
498a504,556 | |
> script_item_value_type_e type; | |
> script_item_u val; | |
> char buf[KEYADC_PARA_MAX_LEN]; | |
> | |
> dprintk(DEBUG_INIT, "sunxikbd_init \n"); | |
> | |
> type = script_get_item("adckey_para", "key_cnt", &val); | |
> if (SCIRPT_ITEM_VALUE_TYPE_INT == type) { | |
> g_key_max_count = val.val; | |
> } | |
> if (g_key_max_count == 0) { | |
> g_scankeycodes = sunxi_scankeycodes; | |
> g_key_max_count = KEY_MAX_CNT; | |
> } else { | |
> g_scankeycodes = kzalloc(sizeof(unsigned int) * g_key_max_count, GFP_KERNEL); | |
> if (!g_scankeycodes) { | |
> err = -ENOMEM; | |
> goto fail1; | |
> } | |
> for (i = 0; i < g_key_max_count; i++) { | |
> snprintf(buf, KEYADC_PARA_MAX_LEN, "key%d_code", i); | |
> type = script_get_item("adckey_para", buf, &val); | |
> if(SCIRPT_ITEM_VALUE_TYPE_INT != type){ | |
> printk(KERN_DEBUG "sunxikbd: get %s err!\n", buf); | |
> err = -EINVAL; | |
> goto fail1; | |
> } | |
> g_scankeycodes[i] = val.val; | |
> | |
> snprintf(buf, KEYADC_PARA_MAX_LEN, "key%d_index_start", i); | |
> type = script_get_item("adckey_para", buf, &val); | |
> if(SCIRPT_ITEM_VALUE_TYPE_INT != type){ | |
> printk(KERN_DEBUG "sunxikbd: get %s err!\n", buf); | |
> err = -EINVAL; | |
> goto fail1; | |
> } | |
> map_start = val.val; | |
> | |
> snprintf(buf, KEYADC_PARA_MAX_LEN, "key%d_index_end", i); | |
> type = script_get_item("adckey_para", buf, &val); | |
> if(SCIRPT_ITEM_VALUE_TYPE_INT != type){ | |
> printk(KERN_DEBUG "sunxikbd: get %s err!\n", buf); | |
> err = -EINVAL; | |
> goto fail1; | |
> } | |
> map_end = val.val; | |
> | |
> while (map_start <= map_end) { | |
> keypad_mapindex[map_start] = i; | |
> ++map_start; | |
> } | |
> } | |
> } | |
500,501d557 | |
< dprintk(DEBUG_INIT, "sunxikbd_init \n"); | |
< | |
523,524c579,580 | |
< for (i = 0; i < KEY_MAX_CNT; i++) | |
< set_bit(sunxi_scankeycodes[i], sunxikbd_dev->keybit); | |
--- | |
> for (i = 0; i < g_key_max_count; i++) | |
> set_bit(g_scankeycodes[i], sunxikbd_dev->keybit); | |
Only in 2/linux-z7213/drivers/input/touchscreen/ft5x: ft_app.i | |
Only in 2/linux-z7213/drivers/media/video/sunxi-fd: lib | |
Only in 2/linux-z7213/drivers/media/video/sunxi-vfe: lib | |
diff -r 1/linux-z7213/drivers/misc/Kconfig 2/linux-z7213/drivers/misc/Kconfig | |
535a536,542 | |
> config USB_HUB_MA8601 | |
> tristate "MA8601 Reset and PowerOn" | |
> depends on ARCH_SUN8I | |
> default y | |
> ---help--- | |
> This option can allow control ma8601 power on and reset. | |
> | |
diff -r 1/linux-z7213/drivers/misc/Makefile 2/linux-z7213/drivers/misc/Makefile | |
57a58 | |
> obj-$(CONFIG_USB_HUB_MA8601) += ma8601.o | |
59c60 | |
< obj-$(CONFIG_AW_RF_PM) += rf_pm/ | |
\ No newline at end of file | |
--- | |
> obj-$(CONFIG_AW_RF_PM) += rf_pm/ | |
Only in 2/linux-z7213/drivers/misc: ma8601.c | |
diff -r 1/linux-z7213/drivers/pwm/Makefile 2/linux-z7213/drivers/pwm/Makefile | |
2c2 | |
< obj-$(CONFIG_PWM_SUNXI) += pwm-sunxi.o | |
\ No newline at end of file | |
--- | |
> obj-$(CONFIG_PWM_SUNXI) += pwm-sunxi.o | |
diff -r 1/linux-z7213/drivers/pwm/pwm-sunxi.c 2/linux-z7213/drivers/pwm/pwm-sunxi.c | |
35,36c35,36 | |
< #define PWM_NUM 2 | |
< #define PWM_REG_NUM 3 | |
--- | |
> #define PWM_NUM 3 //by yaowenjun support S_PWM(R_PWM) | |
> #define PWM_REG_NUM 5 //pwm0 + pwm 1 | |
88a89,106 | |
> //s_pwm (R_pwm) | |
> static __u32 sunxi_r_pwm_read_reg(__u32 offset) | |
> { | |
> __u32 value = 0; | |
> | |
> value = sys_get_wvalue(SUNXI_R_PWM_VBASE + offset); | |
> | |
> return value; | |
> } | |
> | |
> //s_pwm(R_pwm) | |
> static __u32 sunxi_r_pwm_write_reg(__u32 offset, __u32 value) | |
> { | |
> sys_put_wvalue(SUNXI_R_PWM_VBASE + offset, value); | |
> | |
> return 0; | |
> } | |
> | |
124c142,146 | |
< temp = sunxi_pwm_read_reg(0); | |
--- | |
> if (pwm->pwm == 0 || pwm->pwm == 1) { | |
> temp = sunxi_pwm_read_reg(0); | |
> } else //pwm->pwm == 2 //s_pwm | |
> temp = sunxi_r_pwm_read_reg(0); | |
> | |
127c149 | |
< if(pwm->pwm == 0) | |
--- | |
> if(pwm->pwm == 0 || pwm->pwm ==2 ) | |
133c155 | |
< if(pwm->pwm == 0) | |
--- | |
> if(pwm->pwm == 0 || pwm->pwm ==2) | |
139,140c161,164 | |
< sunxi_pwm_write_reg(0, temp); | |
< | |
--- | |
> if (pwm->pwm == 0 || pwm->pwm == 1) { | |
> sunxi_pwm_write_reg(0, temp); | |
> } else | |
> sunxi_r_pwm_write_reg(0, temp); | |
235c259,262 | |
< temp = sunxi_pwm_read_reg(0); | |
--- | |
> if (pwm->pwm == 0 || pwm->pwm == 1) | |
> temp = sunxi_pwm_read_reg(0); | |
> else | |
> temp = sunxi_r_pwm_read_reg(0); | |
237c264 | |
< if(pwm->pwm == 0) | |
--- | |
> if(pwm->pwm == 0 || pwm->pwm == 2) | |
242,244c269,275 | |
< sunxi_pwm_write_reg(0, temp); | |
< | |
< sunxi_pwm_write_reg((pwm->pwm + 1) * 0x04, ((entire_cycles - 1)<< 16) | active_cycles); | |
--- | |
> if (pwm->pwm == 0 || pwm->pwm == 1) { | |
> sunxi_pwm_write_reg(0, temp); | |
> sunxi_pwm_write_reg((pwm->pwm + 1) * 0x04, ((entire_cycles - 1)<< 16) | active_cycles); | |
> } else { | |
> sunxi_r_pwm_write_reg(0, temp); | |
> sunxi_r_pwm_write_reg(0x04, ((entire_cycles - 1)<< 16) | active_cycles); | |
> } | |
294,296c325,330 | |
< temp = sunxi_pwm_read_reg(0); | |
< | |
< if(pwm->pwm == 0) { | |
--- | |
> if (pwm->pwm == 0 || pwm->pwm == 1) | |
> temp = sunxi_pwm_read_reg(0); | |
> else | |
> temp = sunxi_r_pwm_read_reg(0); | |
> | |
> if(pwm->pwm == 0 || pwm->pwm == 2) { | |
299c333 | |
< } else { | |
--- | |
> } else { | |
303,304c337,340 | |
< | |
< sunxi_pwm_write_reg(0, temp); | |
--- | |
> if (pwm->pwm == 0 || pwm->pwm == 1) | |
> sunxi_pwm_write_reg(0, temp); | |
> else | |
> sunxi_r_pwm_write_reg(0, temp); | |
352c388,391 | |
< temp = sunxi_pwm_read_reg(0); | |
--- | |
> if (pwm->pwm == 0 || pwm->pwm == 1) | |
> temp = sunxi_pwm_read_reg(0); | |
> else | |
> temp = sunxi_r_pwm_read_reg(0); | |
354c393 | |
< if(pwm->pwm == 0) { | |
--- | |
> if(pwm->pwm == 0 || pwm->pwm == 2) { | |
423c462,464 | |
< | |
--- | |
> | |
> record_reg[3] = sunxi_r_pwm_read_reg(0); | |
> record_reg[4] = sunxi_r_pwm_read_reg(0x4); | |
446c487,489 | |
< | |
--- | |
> | |
> sunxi_r_pwm_write_reg(0, record_reg[3]); | |
> sunxi_r_pwm_write_reg(0x4, record_reg[4]); | |
diff -r 1/linux-z7213/drivers/usb/core/Kconfig 2/linux-z7213/drivers/usb/core/Kconfig | |
156c156,166 | |
< if you say Y here,then only support special device!!! | |
--- | |
> If you say Y here, then only support special device!!! | |
> | |
> config USB_SPECIAL_DEVICE_WITHOUT_USB_MOUSE | |
> bool "Pass all USB mouse" | |
> depends on USB_SPECIAL_DEVICE | |
> default n | |
> help | |
> If you say Y here, all USB mouse device will passed | |
> even the device is not on the special device list. | |
> | |
> If you are unsure about this, say N here. | |
diff -r 1/linux-z7213/drivers/usb/core/hub.c 2/linux-z7213/drivers/usb/core/hub.c | |
41d40 | |
< #define USED_MA8601 | |
89a89 | |
> #include <mach/sys_config.h> | |
99,112c99,286 | |
< static const struct device_id special_id_list[] = { | |
< { SPECIAL_USB_DEVICE(0x14cd, 0x8601) }, | |
< { SPECIAL_USB_DEVICE(0x0ca3, 0x24) }, | |
< { SPECIAL_USB_DEVICE(0x0ca3, 0x25) }, | |
< { SPECIAL_USB_DEVICE(0x0bda, 0x5411) }, | |
< { SPECIAL_USB_DEVICE(0x05e3, 0x0608) }, | |
< { SPECIAL_USB_DEVICE(0x2109, 0x2817) }, | |
< { SPECIAL_USB_DEVICE(0x1a40, 0x0101) }, | |
< { SPECIAL_USB_DEVICE(0x1dd8, 0x000f) }, | |
< { SPECIAL_USB_DEVICE(0x1dd8, 0x000b) }, | |
< { SPECIAL_USB_DEVICE(0x0079, 0x0011) }, | |
< {} | |
< }; | |
< #endif | |
--- | |
> static struct device_id *special_id_list; | |
> static struct device_id *support_vendor_id_list; | |
> | |
> static int g_feature_enable = 1; | |
> static void set_hub_id_filter(unsigned int enable) | |
> { | |
> if (enable) g_feature_enable = 1; | |
> else g_feature_enable = 0; | |
> } | |
> | |
> static s32 set_special_id_list() | |
> { | |
> int i; | |
> char name[24] = {0}; | |
> script_item_u val; | |
> script_item_value_type_e type; | |
> int device_count; | |
> struct device_id dev_id; | |
> | |
> type = script_get_item("usb_special_device", "device_count", &val); | |
> if (SCIRPT_ITEM_VALUE_TYPE_INT != type) { | |
> return -ENODEV; | |
> } | |
> device_count = val.val; | |
> | |
> special_id_list=(struct device_id *) kmalloc(sizeof(struct device_id) * device_count, GFP_ATOMIC); | |
> if (NULL == special_id_list) | |
> { | |
> return -ENOMEM; | |
> } | |
> | |
> for (i = 0; i <= device_count; i++) { | |
> snprintf(name, sizeof(name), "device%d_vid", i); | |
> type = script_get_item("usb_special_device", name, &val); | |
> if (SCIRPT_ITEM_VALUE_TYPE_INT != type) { | |
> return -ENODEV; | |
> } | |
> dev_id.idVendor = val.val; | |
> | |
> snprintf(name, sizeof(name), "device%d_pid", i); | |
> type = script_get_item("usb_special_device", name, &val); | |
> if (SCIRPT_ITEM_VALUE_TYPE_INT != type) { | |
> return -ENODEV; | |
> } | |
> dev_id.idProduct = val.val; | |
> | |
> *(special_id_list + i) = dev_id; | |
> } | |
> | |
> return 0; | |
> } | |
> | |
> static int special_match_id(struct usb_device *udev, | |
> const struct device_id *id) | |
> { | |
> script_item_u val; | |
> script_item_value_type_e type; | |
> int device_count; | |
> | |
> type = script_get_item("usb_special_device", "device_count", &val); | |
> if (SCIRPT_ITEM_VALUE_TYPE_INT != type) { | |
> return -ENODEV; | |
> } | |
> device_count = val.val; | |
> | |
> while (device_count > 0) { | |
> if ((udev->descriptor.idVendor == id->idVendor) && (udev->descriptor.idProduct == id->idProduct)) { | |
> return 0; | |
> } | |
> device_count--; | |
> id++; | |
> } | |
> | |
> return 1; | |
> } | |
> | |
> static s32 set_support_vendor_id_list() | |
> { | |
> int i; | |
> char name[24] = {0}; | |
> script_item_u val; | |
> script_item_value_type_e type; | |
> int device_count; | |
> struct device_id dev_id; | |
> | |
> type = script_get_item("usb_special_device", "vendor_support_count", &val); | |
> if (SCIRPT_ITEM_VALUE_TYPE_INT != type) { | |
> return -ENODEV; | |
> } | |
> device_count = val.val; | |
> | |
> support_vendor_id_list=(struct device_id *) kmalloc(sizeof(struct device_id) * device_count, GFP_ATOMIC); | |
> if (NULL == support_vendor_id_list) | |
> { | |
> return -ENOMEM; | |
> } | |
> | |
> for (i = 0; i <= device_count; i++) { | |
> snprintf(name, sizeof(name), "vendor_support_%d", i); | |
> type = script_get_item("usb_special_device", name, &val); | |
> if (SCIRPT_ITEM_VALUE_TYPE_INT != type) { | |
> return -ENODEV; | |
> } | |
> // support_vendor_id_list only care about vendor id | |
> dev_id.idVendor = val.val; | |
> dev_id.idProduct = 0; | |
> | |
> *(support_vendor_id_list + i) = dev_id; | |
> } | |
> | |
> return 0; | |
> } | |
> | |
> static int support_vendor_match_id(struct usb_device *udev, | |
> const struct device_id *id) | |
> { | |
> script_item_u val; | |
> script_item_value_type_e type; | |
> int device_count; | |
> | |
> type = script_get_item("usb_special_device", "vendor_support_count", &val); | |
> if (SCIRPT_ITEM_VALUE_TYPE_INT != type) { | |
> return -ENODEV; | |
> } | |
> device_count = val.val; | |
> | |
> while (device_count > 0) { | |
> if (udev->descriptor.idVendor == id->idVendor) { | |
> return 0; | |
> } | |
> device_count--; | |
> id++; | |
> } | |
> | |
> return 1; | |
> } | |
> | |
> #ifdef CONFIG_USB_SPECIAL_DEVICE_WITHOUT_USB_MOUSE | |
> #include <linux/hid.h> | |
> int match_mouse_device(struct usb_device *udev) | |
> { | |
> int ret = 1; | |
> | |
> /* | |
> * Before you read this function | |
> * you need to know the USB descriptor architecture : | |
> * | |
> * USB descriptor architecture | |
> * Device Descriptor | |
> * |-> Configuration Descriptor | |
> * |-> Interface Descritor | |
> * |-> Alternate Settings | |
> * |-> Endpoint Descripor | |
> * | |
> * to check if a usb_device is a mouse device | |
> * we must traverse all alternate settings(cintfc->altsetting) | |
> * | |
> * ret : 1 if udev is a mouse device, 0 if its not | |
> * also return 1 if there is any problem during traversing | |
> */ | |
> | |
> int cfgno = 0; | |
> for (cfgno = 0; cfgno < udev->descriptor.bNumConfigurations; ++cfgno) { | |
> struct usb_host_config *cfg = &udev->config[cfgno]; | |
> if (!cfg) return ret; | |
> | |
> int cintfno = 0; | |
> for (cintfno = 0; cintfno < cfg->desc.bNumInterfaces; ++cintfno) { | |
> struct usb_interface_cache *cintfc = cfg->intf_cache[cintfno]; | |
> if (!cintfc) return ret; | |
> | |
> int interfaceno = 0; | |
> for (interfaceno = 0; interfaceno < cintfc->num_altsetting; ++interfaceno) { | |
> struct usb_host_interface *interface = &cintfc->altsetting[interfaceno]; | |
> if (!interface) return ret; | |
> | |
> // check if device is USB mouse or not | |
> if ((interface->desc.bInterfaceClass == USB_INTERFACE_CLASS_HID) && \ | |
> (interface->desc.bInterfaceProtocol == USB_INTERFACE_PROTOCOL_MOUSE)) | |
> ret = 0; | |
> } | |
> } | |
> } | |
> | |
> return ret; | |
> } | |
> #endif //CONFIG_USB_SPECIAL_DEVICE_WITHOUT_USB_MOUSE | |
> #endif //CONFIG_USB_SPECIAL_DEVICE | |
188,200d361 | |
< #ifdef CONFIG_USB_SPECIAL_DEVICE | |
< static int special_match_id(struct usb_device *udev, | |
< const struct device_id *id) | |
< { | |
< for (; id->idVendor; id++) { | |
< if ((udev->descriptor.idVendor == id->idVendor) && (udev->descriptor.idProduct == id->idProduct)) | |
< return 0; | |
< } | |
< | |
< return 1; | |
< } | |
< #endif | |
< | |
1475,1492c1636 | |
< if(hdev->level == 2) { //level deep | |
< //USB HUB只支持指定的厂商 | |
< dev_info(&hdev->dev, "New USB device found, idVendor=%04x, idProduct=%04x\n", | |
< le16_to_cpu(hdev->descriptor.idVendor), | |
< le16_to_cpu(hdev->descriptor.idProduct)); | |
< #if 0 //需要根据hub的ID 再填写 | |
< if((le16_to_cpu(hdev->descriptor.idVendor) != 0x1a40) || | |
< le16_to_cpu(hdev->descriptor.idProduct) != 0x0101) { | |
< dev_err(&hdev->dev, "ignoring external hub\n"); | |
< return -ENODEV; | |
< } | |
< #endif | |
< } else if(hdev->level > 2){ | |
< dev_err(&intf->dev,"Unsupported hub:hub nested too deep \n"); | |
< return -E2BIG; | |
< } | |
< | |
< if (hdev->level == MAX_TOPO_LEVEL) { | |
--- | |
> if (hdev->level > MAX_TOPO_LEVEL) { | |
1582c1726,1734 | |
< | |
--- | |
> break; | |
> #ifdef CONFIG_USB_SPECIAL_DEVICE | |
> case USBDEVFS_SET_HUB_ID_FILTER: { | |
> unsigned int *enable = user_data; | |
> set_hub_id_filter(*(enable)); | |
> return 0; | |
> } | |
> break; | |
> #endif | |
1584a1737 | |
> break; | |
2103a2257,2269 | |
> #ifdef CONFIG_USB_SPECIAL_DEVICE | |
> if (udev->parent && | |
> g_feature_enable && | |
> special_match_id(udev, special_id_list) && | |
> support_vendor_match_id(udev, support_vendor_id_list) && | |
> #ifdef CONFIG_USB_SPECIAL_DEVICE_WITHOUT_USB_MOUSE | |
> match_mouse_device(udev) | |
> #endif //CONFIG_USB_SPECIAL_DEVICE_WITHOUT_USB_MOUSE | |
> ) { | |
> err = -EINVAL; | |
> goto fail; | |
> } | |
> #endif //CONFIG_USB_SPECIAL_DEVICE | |
3390,3396c3556 | |
< #ifdef CONFIG_USB_SPECIAL_DEVICE | |
< if(special_match_id(udev, special_id_list)) { | |
< if (retval >= 0) | |
< retval = -EINVAL; | |
< goto fail; | |
< } | |
< #endif | |
--- | |
> | |
3504,3505d3663 | |
< int count=0; | |
< int retry_count = 3; | |
3507d3664 | |
< retry: | |
3722,3728d3878 | |
< #ifdef USED_MA8601 | |
< hub_port_status(hub, port1,&portstatus, &portchange); | |
< if(count < retry_count) { | |
< count++; | |
< goto retry; | |
< } | |
< #endif | |
4077a4228,4231 | |
> #ifdef CONFIG_USB_SPECIAL_DEVICE | |
> set_special_id_list(); | |
> set_support_vendor_id_list(); | |
> #endif | |
diff -r 1/linux-z7213/drivers/usb/sunxi_usb/Kconfig 2/linux-z7213/drivers/usb/sunxi_usb/Kconfig | |
66a67,89 | |
> config USB_SUNXI_USB0_OTG_WITHOUT_ID_PIN | |
> boolean "otg without ID pin support" | |
> depends on USB_SUNXI_USB0_OTG | |
> default n | |
> help | |
> usb0 can only switch device/host/null modes manually. | |
> beware ID pin's value will be ignored if this is enabled. | |
> If unsure, say N. | |
> | |
> config USB_SUNXI_USB0_OTG_HOST_BULK_TRANSFER | |
> boolean "enable usb0 otg/host bulk transfer ability" | |
> depends on (USB_SUNXI_USB0_OTG || USB_SUNXI_USB0_HOST_ONLY) | |
> default y | |
> help | |
> usb0 have only 6 pair EndPoints for data transfer in host mode. | |
> following is the arrangement of EndPoints: | |
> 1 pair for usb0 controller | |
> 1 pair for bulk transfer | |
> 4 pait for interrupt transfer | |
> this means you can only make 4 interrupt transfer at the same time. | |
> disable this will drop the bulk transfer ability for 1 more interrupt transfer. | |
> beware disable this will cause usb0 lose all bulk abilities like data transfer between usb drive etc. | |
> If unsure, say Y. | |
diff -r 1/linux-z7213/drivers/usb/sunxi_usb/hcd/core/sunxi_hcd_host.c 2/linux-z7213/drivers/usb/sunxi_usb/hcd/core/sunxi_hcd_host.c | |
2329a2330 | |
> #ifdef USB_SUNXI_USB0_OTG_HOST_BULK_TRANSFER | |
2334a2336 | |
> #endif | |
diff -r 1/linux-z7213/drivers/usb/sunxi_usb/manager/usb_hw_scan.c 2/linux-z7213/drivers/usb/sunxi_usb/manager/usb_hw_scan.c | |
148a149 | |
> | |
402,403c403,404 | |
< #ifdef SUNXI_USB_FPGA | |
< static u32 usb_vbus_id_state = 1; | |
--- | |
> #if defined (SUNXI_USB_FPGA) || defined (CONFIG_USB_SUNXI_USB0_OTG_WITHOUT_ID_PIN) | |
> static u32 usb_vbus_id_state = 3; | |
425d425 | |
< | |
diff -r 1/linux-z7213/drivers/usb/sunxi_usb/manager/usbc0_platform.c 2/linux-z7213/drivers/usb/sunxi_usb/manager/usbc0_platform.c | |
138c138 | |
< #ifdef SUNXI_USB_FPGA | |
--- | |
> #if defined (SUNXI_USB_FPGA) || defined (CONFIG_USB_SUNXI_USB0_OTG_WITHOUT_ID_PIN) | |
210c210 | |
< #ifdef SUNXI_USB_FPGA | |
--- | |
> #if defined (SUNXI_USB_FPGA) || defined (CONFIG_USB_SUNXI_USB0_OTG_WITHOUT_ID_PIN) | |
diff -r 1/linux-z7213/drivers/video/sunxi/Kconfig 2/linux-z7213/drivers/video/sunxi/Kconfig | |
13a14,19 | |
> config SUN8IW5P1_CLOCK_DRC0 | |
> int "SUN8IW5P1 CLOCK DRC0" | |
> depends on (ARCH_SUN8IW5P1 && FB_SUNXI) | |
> default 156000000 | |
> ---help--- | |
> | |
21a28,39 | |
> config EXTERNAL_HDMI | |
> tristate "external hdmi(ep952) driver for SUNXI" | |
> depends on (ARCH_SUN8IW5P1 && FB_SUNXI) | |
> default m | |
> ---help--- | |
> | |
> config SUNXI_FB_DRAW_BOOTLOGO | |
> bool "draw bootlogo on fb while boot" | |
> depends on (ARCH_SUN8IW5P1 && FB_SUNXI) | |
> default n | |
> ---help--- | |
> | |
26a45,52 | |
> | |
> config SUNXI_LCD_SC7705_MIPI_2_LANE | |
> bool "LCD Driver SC7705 support mipi 2 lane(sunxi)" | |
> depends on (ARCH_SUN8IW5P1 && LCD_SUNXI) | |
> default n | |
> help | |
> Say N here if you not sure how many lane will be used for LCD SC7705 | |
> it set 3/4 lane by default. | |
diff -r 1/linux-z7213/drivers/video/sunxi/Makefile 2/linux-z7213/drivers/video/sunxi/Makefile | |
6a7 | |
> obj-$(CONFIG_EXTERNAL_HDMI) += hdmi_ep952/ | |
9d9 | |
< obj-y += hdmi_ep952/ | |
diff -r 1/linux-z7213/drivers/video/sunxi/disp/OSAL/OSAL_Pin.c 2/linux-z7213/drivers/video/sunxi/disp/OSAL/OSAL_Pin.c | |
84a85 | |
> EXPORT_SYMBOL(OSAL_GPIO_Request); | |
103a105 | |
> EXPORT_SYMBOL(OSAL_GPIO_Release); | |
diff -r 1/linux-z7213/drivers/video/sunxi/disp/OSAL/OSAL_Power.c 2/linux-z7213/drivers/video/sunxi/disp/OSAL/OSAL_Power.c | |
30a31 | |
> EXPORT_SYMBOL(OSAL_Power_Enable); | |
56a58 | |
> EXPORT_SYMBOL(OSAL_Power_Disable); | |
diff -r 1/linux-z7213/drivers/video/sunxi/disp/OSAL/OSAL_Pwm.c 2/linux-z7213/drivers/video/sunxi/disp/OSAL/OSAL_Pwm.c | |
11a12 | |
> pwm_dev = NULL; | |
diff -r 1/linux-z7213/drivers/video/sunxi/disp/de/disp_display.c 2/linux-z7213/drivers/video/sunxi/disp/de/disp_display.c | |
994c994 | |
< if(lcd && lcd->pwm_disable) { | |
--- | |
> if(lcd && lcd->power_disable) { | |
1119a1120 | |
> EXPORT_SYMBOL(bsp_extern_hdmi_register); | |
1251a1253 | |
> char drv_name[32]; | |
1254,1255c1256,1262 | |
< if(lcd && lcd->set_hdmi_ep952_mode) { | |
< return lcd->set_hdmi_ep952_mode(lcd, mode); | |
--- | |
> if(lcd && (lcd->get_panel_driver_name) && (lcd->set_panel_func)) { | |
> lcd->get_panel_driver_name(lcd, drv_name); | |
> if(!strcmp("EP952", drv_name)) { | |
> if(lcd && lcd->set_hdmi_ep952_mode) { | |
> return lcd->set_hdmi_ep952_mode(lcd, mode); | |
> } | |
> } | |
1257c1264,1265 | |
< return DIS_FAIL; | |
--- | |
> | |
> return DIS_SUCCESS; | |
diff -r 1/linux-z7213/drivers/video/sunxi/disp/de/disp_lcd.c 2/linux-z7213/drivers/video/sunxi/disp/de/disp_lcd.c | |
2a3,6 | |
> /* for switching LCD display feature */ | |
> extern disp_switch_enable; | |
> extern lcd_para; | |
> | |
32a37,41 | |
> | |
> /*0:no reset process;1:reset request;2:resetting*/ | |
> atomic_t lcd_resetting; | |
> struct work_struct reflush_work; | |
> struct disp_lcd_esd_info esd_inf; | |
93,94d101 | |
< sprintf(primary_key, "lcd%d_para", screen_id); | |
< | |
892c899,903 | |
< sprintf(primary_key, "lcd%d_para", lcd->channel_id); | |
--- | |
> if ( disp_switch_enable ) { | |
> sprintf(primary_key, "lcd%d_para", lcd_para); | |
> } else { | |
> sprintf(primary_key, "lcd%d_para", lcd->channel_id); | |
> } | |
1028,1029c1039 | |
< printk("%s111 ======lcd ddddclk = %u\n", __func__, lcdp->panel_info.lcd_dclk_freq); | |
< #if defined(CONFIG_ARCH_SUN8IW5P1) && defined(SUPPORT_EXTERNAL_HDMI) | |
--- | |
> #if defined(CONFIG_ARCH_SUN8IW5P1) && defined(SUPPORT_EP952) | |
1037c1047 | |
< #if defined(CONFIG_ARCH_SUN8IW5P1) && defined(SUPPORT_EXTERNAL_HDMI) | |
--- | |
> #if defined(CONFIG_ARCH_SUN8IW5P1) && defined(SUPPORT_EP952) | |
1235c1245 | |
< extern s32 ep952_get_video_timing_info(disp_video_timing **video_info); | |
--- | |
> //extern s32 ep952_get_video_timing_info(disp_video_timing **video_info); | |
1272c1282 | |
< extern s32 ep952_set_mode(disp_tv_mode hdmi_mode); | |
--- | |
> //extern s32 ep952_set_mode(disp_tv_mode hdmi_mode); | |
1286c1296,1302 | |
< ep952_set_mode(tv_mode); | |
--- | |
> | |
> if(lcdp->lcd_panel_fun.lcd_user_defined_func) { | |
> lcdp->lcd_panel_fun.lcd_user_defined_func(channel_id, 1, tv_mode, 0); | |
> lcdp->lcd_panel_fun.lcd_user_defined_func(channel_id, 4, 0, &t); | |
> } | |
> | |
> //ep952_set_mode(tv_mode); | |
1288,1289c1304,1305 | |
< ep952_get_video_timing_info(&t); | |
< if (t) | |
--- | |
> // ep952_get_video_timing_info(&t); | |
> if (t) { | |
1291c1307 | |
< else | |
--- | |
> }else | |
1294d1309 | |
< printk("%s...pixel_clk = %u", __func__, timing.pixel_clk); | |
1309,1311c1324,1326 | |
< if(!lcdp->lcd_panel_fun.lcd_user_defined_func) { | |
< lcdp->lcd_panel_fun.lcd_user_defined_func(channel_id, 1, tv_mode, 0); | |
< } | |
--- | |
> //if(!lcdp->lcd_panel_fun.lcd_user_defined_func) { | |
> // lcdp->lcd_panel_fun.lcd_user_defined_func(channel_id, 1, tv_mode, 0); | |
> //} | |
1387a1403,1405 | |
> lcdp->lcd_panel_fun.esd_check = lcd_cfg->esd_check; | |
> lcdp->lcd_panel_fun.reset_panel = lcd_cfg->reset_panel; | |
> lcdp->lcd_panel_fun.set_esd_info = lcd_cfg->set_esd_info; | |
1471,1472c1489 | |
< | |
< printk("%s: ====\n", __func__); | |
--- | |
> atomic_set(&lcdp->lcd_resetting, 2); | |
1519a1537,1546 | |
> if (lcdp->lcd_panel_fun.set_esd_info) { | |
> lcdp->lcd_panel_fun.set_esd_info(&lcdp->esd_inf); | |
> } else { | |
> /*default value*/ | |
> lcdp->esd_inf.level = 0; | |
> lcdp->esd_inf.freq = 60; | |
> lcdp->esd_inf.esd_check_func_pos = 0; | |
> lcdp->esd_inf.cnt = 0; | |
> } | |
> atomic_set(&lcdp->lcd_resetting, 0); | |
1561a1589,1591 | |
> | |
> lcdp->esd_inf.cnt = 0; | |
> atomic_set(&lcdp->lcd_resetting, 2); | |
1885a1916,1931 | |
> /* in case disp_lcd_init is called before pwm is ready */ | |
> if(disp_lcd_is_used(lcd) && !lcdp->pwm_info.dev) { | |
> if(lcdp->panel_info.lcd_pwm_used) { | |
> lcdp->pwm_info.channel = lcdp->panel_info.lcd_pwm_ch; | |
> lcdp->pwm_info.polarity = lcdp->panel_info.lcd_pwm_pol; | |
> lcdp->pwm_info.dev = OSAL_Pwm_request(lcdp->panel_info.lcd_pwm_ch); | |
> } | |
> | |
> if(lcdp->panel_info.lcd_pwm_freq != 0) { | |
> lcdp->pwm_info.period_ns = 1000*1000*1000 / lcdp->panel_info.lcd_pwm_freq; | |
> } else { | |
> DE_WRN("lcd%d.lcd_pwm_freq is ZERO\n", lcd->channel_id); | |
> lcdp->pwm_info.period_ns = 1000*1000*1000 / 1000; //default 1khz | |
> } | |
> } | |
> | |
1900a1947 | |
> OSAL_Pwm_Set_Polarity(lcdp->pwm_info.dev, lcdp->pwm_info.polarity); | |
1995c2042 | |
< #if defined(CONFIG_ARCH_SUN8IW5P1) && defined(SUPPORT_EXTERNAL_HDMI) | |
--- | |
> #if defined(CONFIG_ARCH_SUN8IW5P1) && defined(SUPPORT_EP952) | |
2043a2091,2106 | |
> int cur_line = disp_al_lcd_get_cur_line(screen_id); | |
> lcd = disp_get_lcd(screen_id); | |
> if(lcd) { | |
> lcdp = disp_lcd_get_priv(lcd); | |
> if (lcdp->lcd_panel_fun.esd_check && lcdp->lcd_panel_fun.reset_panel) { | |
> ++lcdp->esd_inf.cnt; | |
> if(cur_line < 2 && !atomic_read(&lcdp->lcd_resetting) && lcdp->esd_inf.cnt >= lcdp->esd_inf.freq) { | |
> if (!lcdp->esd_inf.esd_check_func_pos || lcdp->lcd_panel_fun.esd_check(screen_id)) { | |
> /*request reset*/ | |
> atomic_set(&lcdp->lcd_resetting, 1); | |
> schedule_work(&lcdp->reflush_work); | |
> } | |
> lcdp->esd_inf.cnt = 0; | |
> } | |
> } | |
> } | |
2248,2250c2311,2318 | |
< | |
< lcd_get_sys_config(lcd->channel_id, &lcdp->lcd_cfg); | |
< lcd_parse_panel_para(lcd->channel_id, &lcdp->panel_info); | |
--- | |
> | |
> if ( disp_switch_enable ) { | |
> lcd_get_sys_config(lcd_para, &lcdp->lcd_cfg); | |
> lcd_parse_panel_para(lcd_para, &lcdp->panel_info); | |
> } else { | |
> lcd_get_sys_config(lcd->channel_id, &lcdp->lcd_cfg); | |
> lcd_parse_panel_para(lcd->channel_id, &lcdp->panel_info); | |
> } | |
2359a2428,2521 | |
> static s32 disp_lcd_get_esd_info(struct disp_device *dispdev, | |
> struct disp_lcd_esd_info *p_esd_info) | |
> { | |
> s32 ret = -1; | |
> struct disp_lcd_private_data *lcdp = NULL; | |
> | |
> if (!dispdev || !p_esd_info) | |
> goto OUT; | |
> lcdp = disp_lcd_get_priv(dispdev); | |
> if (!lcdp) | |
> goto OUT; | |
> | |
> memcpy(p_esd_info, &lcdp->esd_inf, sizeof(struct disp_lcd_esd_info)); | |
> ret = 0; | |
> | |
> OUT: | |
> return ret; | |
> } | |
> | |
> static void disp_lcd_reflush_work(struct work_struct *work) | |
> { | |
> struct disp_lcd_private_data *lcdp = | |
> container_of(work, struct disp_lcd_private_data, reflush_work); | |
> struct disp_lcd *lcd = disp_get_lcd(0); | |
> unsigned long flags; | |
> | |
> if (!lcdp || !lcd) { | |
> DE_WRN("lcdp is null\n"); | |
> return; | |
> } | |
> | |
> /*lcd is not enabled or is enabling*/ | |
> if (disp_lcd_is_enabled(lcd) == 0 || lcdp->enabling == 1) | |
> return; | |
> | |
> /*lcd is resetting*/ | |
> if (atomic_read(&lcdp->lcd_resetting) == 2) | |
> return; | |
> | |
> if (!lcdp->esd_inf.esd_check_func_pos) | |
> if (lcdp->lcd_panel_fun.esd_check) | |
> if (!lcdp->lcd_panel_fun.esd_check(lcd->channel_id)) { | |
> atomic_set(&lcdp->lcd_resetting, 0); | |
> return; /*everything is just fine*/ | |
> } | |
> | |
> if (lcdp->esd_inf.level == 1) { | |
> spin_lock_irqsave(&lcd_data_lock, flags); | |
> lcdp->enabled = 0; | |
> lcdp->enabling = 1; | |
> spin_unlock_irqrestore(&lcd_data_lock, flags); | |
> | |
> atomic_set(&lcdp->lcd_resetting, 2); | |
> | |
> disp_lcd_tcon_disable(lcd); | |
> disp_al_lcd_cfg(lcd->channel_id, &lcdp->panel_info); | |
> } else | |
> atomic_set(&lcdp->lcd_resetting, 2); | |
> | |
> ++lcdp->esd_inf.rst_cnt; | |
> if (lcdp->lcd_panel_fun.reset_panel) | |
> lcdp->lcd_panel_fun.reset_panel(lcd->channel_id); | |
> | |
> if (lcdp->esd_inf.level == 1) { | |
> disp_lcd_tcon_enable(lcd); | |
> spin_lock_irqsave(&lcd_data_lock, flags); | |
> lcdp->enabled = 1; | |
> lcdp->enabling = 0; | |
> spin_unlock_irqrestore(&lcd_data_lock, flags); | |
> } | |
> | |
> bsp_disp_delay_ms(300); | |
> | |
> /*lcd reset finish*/ | |
> atomic_set(&lcdp->lcd_resetting, 0); | |
> } | |
> | |
> /* for switching LCD display feature */ | |
> void reinit_lcd0(void) | |
> { | |
> struct disp_lcd *lcd; | |
> struct disp_lcd_private_data *lcdp; | |
> lcd = disp_get_lcd(0); | |
> | |
> /* set bright to 0 before switching LCD */ | |
> disp_lcd_set_bright(lcd, 0); | |
> | |
> /* release pwm before switching LCD*/ | |
> lcdp = disp_lcd_get_priv(lcd); | |
> OSAL_Pwm_free(lcdp->pwm_info.dev); | |
> | |
> lcd->init(lcd); | |
> } | |
> | |
2490c2652 | |
< lcd->post_enable = disp_lcd_post_enable;; | |
--- | |
> lcd->post_enable = disp_lcd_post_enable; | |
2504c2666,2667 | |
< #if defined(CONFIG_ARCH_SUN8IW5P1) && defined(SUPPORT_EXTERNAL_HDMI) | |
--- | |
> //TODO:CONFIG_EXTERNAL_HDMI | |
> #if defined(CONFIG_ARCH_SUN8IW5P1) && defined(SUPPORT_EP952) | |
2508a2672,2673 | |
> lcd->get_esd_info = disp_lcd_get_esd_info; | |
> | |
2509a2675,2677 | |
> | |
> INIT_WORK(&lcdp->reflush_work, disp_lcd_reflush_work); | |
> atomic_set(&lcdp->lcd_resetting, 0); | |
diff -r 1/linux-z7213/drivers/video/sunxi/disp/de/disp_private.h 2/linux-z7213/drivers/video/sunxi/disp/de/disp_private.h | |
184a185 | |
> s32 (*get_esd_info)(struct disp_device *dispdev, struct disp_lcd_esd_info *p_esd_info); | |
diff -r 1/linux-z7213/drivers/video/sunxi/disp/de/lowlevel_sun8iw5/de_clock.c 2/linux-z7213/drivers/video/sunxi/disp/de/lowlevel_sun8iw5/de_clock.c | |
19c19 | |
< disp_clk_inf(MOD_CLK_IEPDRC0, "drc0", "pll_de", 156000000), | |
--- | |
> disp_clk_inf(MOD_CLK_IEPDRC0, "drc0", "pll_de", CONFIG_SUN8IW5P1_CLOCK_DRC0), | |
diff -r 1/linux-z7213/drivers/video/sunxi/disp/de/lowlevel_sun8iw5/de_dsi.c 2/linux-z7213/drivers/video/sunxi/disp/de/lowlevel_sun8iw5/de_dsi.c | |
178a179,195 | |
> __s32 dsi_open_panel(__u32 sel) | |
> { | |
> //dsi_irq_enable(sel,DSI_IRQ_VIDEO_VBLK); | |
> dsi_dev[sel]->dsi_inst_jump_cfg[0].bits.jump_cfg_en = 0; | |
> dsi_start(sel,DSI_START_HSTX); | |
> | |
> return 0; | |
> } | |
> | |
> __s32 dsi_close_panel(__u32 sel) | |
> { | |
> //dsi_irq_disable(sel,DSI_IRQ_VIDEO_VBLK); | |
> dsi_dev[sel]->dsi_inst_jump_cfg[0].bits.jump_cfg_en = 1; | |
> //bsp_disp_lcd_delay_ms(30); | |
> return 0; | |
> } | |
> | |
1062a1080,1081 | |
> EXPORT_SYMBOL(dsi_close_panel); | |
> EXPORT_SYMBOL(dsi_open_panel); | |
diff -r 1/linux-z7213/drivers/video/sunxi/disp/de/lowlevel_sun8iw5/disp_al.c 2/linux-z7213/drivers/video/sunxi/disp/de/lowlevel_sun8iw5/disp_al.c | |
1844,1845d1843 | |
< DE_BE_Layer_Video_Enable(screen_id, layer_id, false); | |
< DE_BE_Layer_Video_Ch_Sel(screen_id, layer_id, 0); | |
1848a1847,1848 | |
> DE_BE_Layer_Video_Enable(screen_id, layer_id, false); | |
> DE_BE_Layer_Video_Ch_Sel(screen_id, layer_id, 0); | |
diff -r 1/linux-z7213/drivers/video/sunxi/disp/dev_disp.c 2/linux-z7213/drivers/video/sunxi/disp/dev_disp.c | |
39a40,44 | |
> /* for switching LCD display feature */ | |
> s32 disp_switch_enable = 0; | |
> u32 lcd_para = 0; | |
> extern void reinit_lcd0(void); | |
> | |
1615a1621,1628 | |
> case DISP_CMD_LCD_PARA: | |
> if(lcd_para != ubuffer[0]){ | |
> ret = 1; | |
> lcd_para = ubuffer[0]; | |
> reinit_lcd0(); | |
> } | |
> break; | |
> | |
1686a1700 | |
> char primary_key[25]; | |
1688a1703,1705 | |
> | |
> sprintf(primary_key, "disp_init"); | |
> ret = OSAL_Script_FetchParser_Data(primary_key, "disp_switch_enable", &disp_switch_enable, 1); | |
diff -r 1/linux-z7213/drivers/video/sunxi/disp/dev_disp_attrnode.c 2/linux-z7213/drivers/video/sunxi/disp/dev_disp_attrnode.c | |
18a19,59 | |
> /* for switching LCD display feature */ | |
> extern disp_switch_enable; | |
> extern lcd_para; | |
> extern void reinit_lcd0(void); | |
> | |
> static ssize_t disp_lcd_para_show(struct device *dev, | |
> struct device_attribute *attr, char *buf) | |
> { | |
> return sprintf(buf, "%d\n", lcd_para); | |
> } | |
> static ssize_t disp_lcd_para_store(struct device *dev, | |
> struct device_attribute *attr, | |
> const char *buf, size_t count) | |
> { | |
> int err; | |
> unsigned long val; | |
> | |
> if ( 0 == disp_switch_enable ) { | |
> printk("[disp_init] disp_switch_enable not enabled!\n"); | |
> return count; | |
> } | |
> | |
> err = strict_strtoul(buf, 10, &val); | |
> if (err) { | |
> printk("Invalid size\n"); | |
> return err; | |
> } | |
> if((val>1)) | |
> { | |
> printk("Invalid value, 0/1 is expected!\n"); | |
> }else | |
> { | |
> printk("%ld\n", val); | |
> lcd_para = val; | |
> } | |
> reinit_lcd0(); | |
> return count; | |
> } | |
> static DEVICE_ATTR(lcd_para, S_IRUGO|S_IWUSR|S_IWGRP, | |
> disp_lcd_para_show, disp_lcd_para_store); | |
> | |
448a490 | |
> &dev_attr_lcd_para.attr, | |
diff -r 1/linux-z7213/drivers/video/sunxi/disp/dev_fb.c 2/linux-z7213/drivers/video/sunxi/disp/dev_fb.c | |
306a307,330 | |
> #ifdef CONFIG_SUNXI_FB_DRAW_BOOTLOGO | |
> #include "bootlogo.h" | |
> | |
> s32 fb_draw_logo(u32 *logo, u32 base, u32 width, u32 height, struct fb_var_screeninfo *var) | |
> { | |
> u32 i=0, j=0, addr=0, value=0, count=0; | |
> | |
> for(i = 0; i<height; i++) { | |
> for(j = 0; j<width; j++) { | |
> addr = base + (i*width+ j)*4; | |
> // for situation which bootlog width is smaller than fb width | |
> // this check will show bootlogo at fb's upper left | |
> if ((j > BOOTLOGO_WIDTH - 1)) { | |
> value = 0x0; | |
> } else { | |
> value = logo[count]; | |
> count=count+1; | |
> } | |
> sys_put_wvalue(addr, value); | |
> } | |
> } | |
> return 0; | |
> } | |
> #endif | |
1415c1439 | |
< #if defined(CONFIG_ARCH_SUN8IW5P1) && defined(SUPPORT_EXTERNAL_HDMI) | |
--- | |
> #if defined(CONFIG_ARCH_SUN8IW5P1) && defined(SUPPORT_EP952) | |
1426a1451,1453 | |
> #endif | |
> #ifdef CONFIG_SUNXI_FB_DRAW_BOOTLOGO | |
> fb_draw_logo(logo, (u32 __force)g_fbi.fbinfo[i]->screen_base, fb_para.width, fb_para.height*fb_para.buffer_num, &(g_fbi.fbinfo[i]->var)); | |
diff -r 1/linux-z7213/drivers/video/sunxi/hdmi_ep952/DDC_If.c 2/linux-z7213/drivers/video/sunxi/hdmi_ep952/DDC_If.c | |
276,278c276,278 | |
< extern s32 ep952_i2c_write(u32 client_addr,u8 * data,int size); | |
< extern s32 ep952_i2c_read(u32 client_addr,u8 sub_addr,u8 * data,int size); | |
< extern s32 ep952_i2c_send(struct i2c_msg *msgs, int msg_count); | |
--- | |
> extern s32 ddc_i2c_write(u32 client_addr,u8 * data,int size); | |
> extern s32 ddc_i2c_read(u32 client_addr,u8 sub_addr,u8 * data,int size); | |
> extern s32 ddc_i2c_send(struct i2c_msg *msgs, int msg_count); | |
296c296 | |
< return ep952_i2c_write(IICAddr, datas, Size + 1); | |
--- | |
> return ddc_i2c_write(IICAddr, datas, Size + 1); | |
307c307 | |
< return ep952_i2c_read(IICAddr, ByteAddr, Data, Size); | |
--- | |
> return ddc_i2c_read(IICAddr, ByteAddr, Data, Size); | |
338c338 | |
< ret = ep952_i2c_send(&msgs[1], 2); | |
--- | |
> ret = ddc_i2c_send(&msgs[1], 2); | |
340c340 | |
< ret = ep952_i2c_send(msgs, 3); | |
--- | |
> ret = ddc_i2c_send(msgs, 3); | |
diff -r 1/linux-z7213/drivers/video/sunxi/hdmi_ep952/EP952Controller.c 2/linux-z7213/drivers/video/sunxi/hdmi_ep952/EP952Controller.c | |
84c84 | |
< unsigned char is_Hot_Plug; | |
--- | |
> unsigned char is_Hot_Plug = 0; | |
87c87 | |
< unsigned char ChkSum, ConnectionState; | |
--- | |
> unsigned char ChkSum, ConnectionState = 0; | |
121c121 | |
< | |
--- | |
> EP_EP952_PowerOn(); | |
138c138 | |
< is_Connected = 1; | |
--- | |
> is_Connected = 0; | |
142a143 | |
> is_Hot_Plug = 0; | |
279c280,282 | |
< | |
--- | |
> extern hpd_delay_enable; | |
> extern hpd_delay; | |
> extern g_ep952_enabled; | |
286,288c289 | |
< ConnectionState = HDMI_Tx_HTPLG(); | |
< | |
< is_Hot_Plug = (ConnectionState == 1)? 1:0; | |
--- | |
> ConnectionState = HDMI_Tx_HTPLG(); //read ep952 register | |
291c292 | |
< if(is_Connected != ((ConnectionState)?1:0) ) | |
--- | |
> if(is_Connected != ((ConnectionState)?1:0)) | |
293,298c294,295 | |
< if (!is_Connected) { | |
< DBG("#####################\n"); | |
< DBG("# HDMI - Connect #\n"); | |
< DBG("#####################\n"); | |
< } | |
< if(HP_ChangeCount++ >= 5) // Hotplug continuous low 500ms (10ms x 50) | |
--- | |
> DBG("%s %d ConnectionState:%d, is_Connected: %d, is_Hot_Plug: %d is_ReceiverSense: %d \n", __func__, __LINE__, ConnectionState, is_Connected, is_Hot_Plug, is_ReceiverSense); | |
> if(HP_ChangeCount++ >= 5) // Hotplug continuous low 100ms (20ms x 5) | |
301c298 | |
< | |
--- | |
> is_Hot_Plug = (ConnectionState == 1)? 1:0; | |
317a315,318 | |
> }else{ | |
> DBG("#####################\n"); | |
> DBG("# HDMI - Connect #\n"); | |
> DBG("#####################\n"); | |
506a508,514 | |
> } else { | |
> if (hpd_delay_enable == 1) { | |
> if ( (g_ep952_enabled == 1) && (hpd_delay == 1) && (is_ReceiverSense == 1) ) { | |
> msleep(1000); | |
> hpd_delay = 0; | |
> } | |
> } | |
diff -r 1/linux-z7213/drivers/video/sunxi/hdmi_ep952/EP952_If.c 2/linux-z7213/drivers/video/sunxi/hdmi_ep952/EP952_If.c | |
387d386 | |
< EP952_Reg_Set_Bit(EP952_IIS_Control, EP952_IIS_Control__ADO_EN); | |
388a388 | |
> EP952_Reg_Set_Bit(EP952_IIS_Control, EP952_IIS_Control__ADO_EN); | |
diff -r 1/linux-z7213/drivers/video/sunxi/hdmi_ep952/EP952api.c 2/linux-z7213/drivers/video/sunxi/hdmi_ep952/EP952api.c | |
81a82,87 | |
> void EP_EP952_PowerOn(void) | |
> { | |
> hdmi_gpio_config(1, 1); | |
> msleep(10); | |
> } | |
> | |
diff -r 1/linux-z7213/drivers/video/sunxi/hdmi_ep952/EP952api.h 2/linux-z7213/drivers/video/sunxi/hdmi_ep952/EP952api.h | |
111a112 | |
> void EP_EP952_PowerOn(void); | |
diff -r 1/linux-z7213/drivers/video/sunxi/hdmi_ep952/Makefile 2/linux-z7213/drivers/video/sunxi/hdmi_ep952/Makefile | |
1,3c1,3 | |
< obj-y += ep952.o | |
< | |
< ep952-y := hdmi_ep952.o EP952api.o EP952Controller.o EP952_If.o EP952SettingsData.o DDC_If.o Edid.o EP952SettingsData.o HDCP.o | |
--- | |
> ccflags-y := -DEXTERNAL_HDMI_EP952 | |
> obj-$(CONFIG_EXTERNAL_HDMI) += ep952.o | |
> ep952-objs := hdmi_ep952.o EP952api.o EP952Controller.o EP952_If.o EP952SettingsData.o DDC_If.o Edid.o EP952SettingsData.o HDCP.o | |
diff -r 1/linux-z7213/drivers/video/sunxi/hdmi_ep952/hdmi_ep952.c 2/linux-z7213/drivers/video/sunxi/hdmi_ep952/hdmi_ep952.c | |
12,14c12,14 | |
< #include <linux/sched.h> //wake_up_process() | |
< #include <linux/kthread.h> //kthread_create()??��|kthread_run() | |
< #include <linux/err.h> //IS_ERR()??��|PTR_ERR() | |
--- | |
> #include <linux/sched.h> | |
> #include <linux/kthread.h> | |
> #include <linux/err.h> | |
29d28 | |
< //#include "../disp/disp_sys_intf.h" | |
42d40 | |
< //static char modules_name[32] = "ep952"; | |
46,48c44,48 | |
< static int g_ep952_enabled = 0; | |
< static disp_tv_mode g_hdmi_mode = DISP_TV_MOD_720P_50HZ; | |
< static unsigned char g_hdmi_vic = HDMI720P_50; | |
--- | |
> int hpd_delay_enable = 0; | |
> int hpd_delay = 0; | |
> int g_ep952_enabled = 0; | |
> static disp_tv_mode g_hdmi_mode = DISP_TV_MOD_720P_60HZ; | |
> static unsigned char g_hdmi_vic = HDMI720P_60; | |
54c54,55 | |
< //static u32 hdmi_screen_id = 0; | |
--- | |
> static u32 ddc_i2c_id = 0; | |
> static u32 ddc_i2c_used = 0; | |
58,59d58 | |
< //static bool hdmi_io_used[28]; | |
< //static disp_gpio_set_t hdmi_io[28]; | |
62d60 | |
< static struct i2c_adapter *hdmi_i2c_adapter = NULL; | |
63a62 | |
> static struct i2c_adapter *ddc_i2c_adapter = NULL; | |
65,66d63 | |
< static struct disp_device *ep952_device = NULL; | |
< //static disp_vdevice_source_ops hdmi_source_ops; | |
69a67,70 | |
> static struct cdev *ep952_cdev; | |
> static dev_t devid ; | |
> static struct class *ep952_class; | |
> | |
75a77,80 | |
> s32 ddc_i2c_write(u32 client_addr, u8 * data,int size); | |
> s32 ddc_i2c_read(u32 client_addr,u8 sub_addr,u8 * data,int size); | |
> s32 ddc_i2c_send(struct i2c_msg *msgs, int msg_count); | |
> | |
81,85d85 | |
< //extern struct disp_device* disp_vdevice_register(disp_vdevice_init_data *data); | |
< //extern s32 disp_vdevice_unregister(struct disp_device *vdevice); | |
< //extern s32 disp_vdevice_get_source_ops(disp_vdevice_source_ops *ops); | |
< //extern unsigned int disp_boot_para_parse(void); | |
< | |
89a90,93 | |
> extern int OSAL_Power_Enable(char *name); | |
> extern int OSAL_Power_Disable(char *name); | |
> extern __hdle OSAL_GPIO_Request(disp_gpio_set_t *gpio_list, u32 group_count_max); | |
> extern s32 OSAL_GPIO_Release(__hdle p_handler, s32 if_release_to_default_status); | |
104,131c108,131 | |
< printk("%s:%d\n", __func__, __LINE__); | |
< disp_gpio_set_t *gpio_info; | |
< int i, ret; | |
< char io_name[32]; | |
< script_item_u val; | |
< for(i=0; i<2; i++) { | |
< gpio_info = &(hdmi_gpio[i]); | |
< sprintf(io_name, "gpio_%d", i); | |
< | |
< printk("%s:%d\n", __func__, __LINE__); | |
< ret = script_get_item(key_name, io_name, &val); | |
< if (ret == 3) { | |
< gpio_info->gpio = val.gpio.gpio; | |
< gpio_info->mul_sel = val.gpio.mul_sel; | |
< gpio_info->pull = val.gpio.pull; | |
< gpio_info->drv_level = val.gpio.drv_level; | |
< gpio_info->data = val.gpio.data; | |
< memcpy(gpio_info->gpio_name, io_name, strlen(io_name)+1); | |
< printk("gpio get success!\n"); | |
< hdmi_gpio_used[i]= 1; | |
< if (0 == gpio_info->mul_sel) { | |
< OSAL_GPIO_Request(gpio_info, 1); | |
< | |
< } | |
< } | |
< else | |
< continue; | |
< } | |
--- | |
> printk("%s:%d\n", __func__, __LINE__); | |
> disp_gpio_set_t *gpio_info; | |
> int i, ret; | |
> char io_name[32]; | |
> script_item_u val; | |
> for(i=0; i<2; i++) { | |
> gpio_info = &(hdmi_gpio[i]); | |
> sprintf(io_name, "gpio_%d", i); | |
> | |
> printk("%s:%d\n", __func__, __LINE__); | |
> ret = script_get_item(key_name, io_name, &val); | |
> if (ret == 3) { | |
> gpio_info->gpio = val.gpio.gpio; | |
> gpio_info->mul_sel = val.gpio.mul_sel; | |
> gpio_info->pull = val.gpio.pull; | |
> gpio_info->drv_level = val.gpio.drv_level; | |
> gpio_info->data = val.gpio.data; | |
> memcpy(gpio_info->gpio_name, io_name, strlen(io_name)+1); | |
> printk("gpio get success!\n"); | |
> hdmi_gpio_used[i]= 1; | |
> } | |
> else | |
> continue; | |
> } | |
133,134c133,134 | |
< printk("%s:%d\n", __func__, __LINE__); | |
< return 0; | |
--- | |
> printk("%s:%d\n", __func__, __LINE__); | |
> return 0; | |
150c150 | |
< printk("%s: gpio_info->mul_sel = %d\n", __func__, gpio_info->mul_sel); | |
--- | |
> printk("%s: gpio_info->mul_sel = %d\n", __func__, gpio_info->mul_sel); | |
157,179d156 | |
< #if 0 | |
< | |
< int hdmi_pin_config(u32 bon) | |
< { | |
< int hdl,i; | |
< | |
< for(i=0; i<28; i++) { | |
< if(hdmi_io_used[i]) { | |
< disp_gpio_set_t gpio_info[1]; | |
< | |
< memcpy(gpio_info, &(hdmi_io[i]), sizeof(disp_gpio_set_t)); | |
< if(!bon) { | |
< gpio_info->mul_sel = 7; | |
< } | |
< hdl = disp_sys_gpio_request(gpio_info, 1); | |
< disp_sys_gpio_release(hdl, 2); | |
< } | |
< } | |
< return 0; | |
< } | |
< #endif | |
< | |
< | |
182,206c159 | |
< return OSAL_Power_Enable(name); | |
< /* | |
< struct regulator *regu= NULL; | |
< int ret = 0; | |
< regu= regulator_get(NULL, name); | |
< if (IS_ERR(regu)) { | |
< pr_err("%s: some error happen, fail to get regulator %s\n", __func__, name); | |
< goto exit; | |
< } | |
< | |
< //enalbe regulator | |
< ret = regulator_enable(regu); | |
< if (0 != ret) { | |
< pr_err("%s: some error happen, fail to enable regulator %s!\n", __func__, name); | |
< goto exit1; | |
< } else { | |
< __inf("suceess to enable regulator %s!\n", name); | |
< } | |
< | |
< exit1: | |
< //put regulater, when module exit | |
< regulator_put(regu); | |
< exit: | |
< return ret; | |
< */ | |
--- | |
> return OSAL_Power_Enable(name); | |
211,236c164 | |
< | |
< return OSAL_Power_Disable(name); | |
< #if 0 | |
< struct regulator *regu= NULL; | |
< int ret = 0; | |
< regu= regulator_get(NULL, name); | |
< if (IS_ERR(regu)) { | |
< __wrn("%s: some error happen, fail to get regulator %s\n", __func__, name); | |
< goto exit; | |
< } | |
< | |
< //disalbe regulator | |
< ret = regulator_disable(regu); | |
< if (0 != ret) { | |
< __wrn("%s: some error happen, fail to disable regulator %s!\n", __func__, name); | |
< goto exit1; | |
< } else { | |
< __inf("suceess to disable regulator %s!\n", name); | |
< } | |
< | |
< exit1: | |
< //put regulater, when module exit | |
< regulator_put(regu); | |
< exit: | |
< return ret; | |
< #endif | |
--- | |
> return OSAL_Power_Disable(name); | |
246,247c174 | |
< hdmi_power_enable(hdmi_power); | |
< // disp_sys_power_enable(hdmi_power); | |
--- | |
> hdmi_power_enable(hdmi_power); | |
250d176 | |
< // disp_sys_power_disable(hdmi_power); | |
287a214 | |
> #if defined(CONFIG_SWITCH) || defined(CONFIG_ANDROID_SWITCH) | |
288a216,220 | |
> // only delay hpd while issue hpd kernel event | |
> if (hpd_delay_enable == 1) { | |
> hpd_delay = current_state; | |
> } | |
> #endif | |
298a231 | |
> EXPORT_SYMBOL(ep952_get_hpd_status); | |
302c235,236 | |
< unsigned int timeout = HZ / 50; // 20ms | |
--- | |
> | |
> unsigned int timeout = HZ / 50; // 20ms | |
304,307c238 | |
< while(1) { | |
< if(kthread_should_stop()) { | |
< break; | |
< } | |
--- | |
> while(!kthread_should_stop()) { | |
309,313c240,241 | |
< //printk("ep952 tx hpd state [%d]\n",ep952_get_hpd_status()); | |
< if(g_ep952_enabled) { | |
< EP952Controller_Timer(); | |
< EP952Controller_Task(); | |
< } | |
--- | |
> EP952Controller_Timer(); | |
> EP952Controller_Task(); | |
322c250 | |
< int err; | |
--- | |
> int err; | |
336c264 | |
< return 0; | |
--- | |
> return 0; | |
345c273 | |
< return 0; | |
--- | |
> return 0; | |
350c278 | |
< return g_hdmi_mode; | |
--- | |
> return g_hdmi_mode; | |
351a280 | |
> EXPORT_SYMBOL(ep952_get_mode); | |
376c305 | |
< | |
--- | |
> EXPORT_SYMBOL(ep952_check_mode_support); | |
396c325 | |
< printk("%s: ====hdmi_mode = %d\n", __func__, hdmi_mode); | |
--- | |
> printk("%s: ====hdmi_mode = %d\n", __func__, hdmi_mode); | |
401c330 | |
< printk("%s: ====g_hdmi_vic = %d\n", __func__, g_hdmi_vic); | |
--- | |
> printk("%s: ====g_hdmi_vic = %d\n", __func__, g_hdmi_vic); | |
406c335 | |
< | |
--- | |
> | |
408a338 | |
> EXPORT_SYMBOL(ep952_set_mode); | |
429,441c359 | |
< /* | |
< static s32 ep952_hdmi_get_interface_para(void* para) | |
< { | |
< disp_vdevice_interface_para *intf_para = (disp_vdevice_interface_para *)para; | |
< if(NULL == para) { | |
< printk("%s: null pointer\n", __func__); | |
< return -1; | |
< } | |
< intf_para->intf = 0; | |
< intf_para->sub_intf = 0; | |
< intf_para->sequence = 0; | |
< intf_para->clk_phase = 1; | |
< intf_para->sync_polarity = 3; | |
--- | |
> EXPORT_SYMBOL(ep952_get_video_timing_info); | |
443,445d360 | |
< return 0; | |
< } | |
< */ | |
454,461c369,370 | |
< printk("%s:%d\n", __func__, __LINE__); | |
< ep952_thread_disable(); | |
< ep952_hdmi_power_on(1); | |
< // hdmi_pin_config(1); | |
< // msleep(100); | |
< // if(hdmi_source_ops.tcon_enable) | |
< // hdmi_source_ops.tcon_enable(ep952_device); | |
< //msleep(100); | |
--- | |
> printk("%s:%d\n", __func__, __LINE__); | |
> ep952_hdmi_power_on(1); | |
463c372 | |
< EP_HDMI_Init(); | |
--- | |
> EP_HDMI_Init(); | |
465,472c374,378 | |
< EP_HDMI_Set_Video_Timing(g_hdmi_vic); // 720p50hz | |
< EP_HDMI_Set_Audio_Fmt(AUD_I2S, AUD_SF_48000Hz); // IIS input , 48KHz | |
< g_ep952_enabled = 1; | |
< printk("%s:%d\n", __func__, __LINE__); | |
< | |
< ep952_thread_enable(); | |
< | |
< return 0; | |
--- | |
> EP_HDMI_Set_Video_Timing(g_hdmi_vic); // 720p50hz | |
> EP_HDMI_Set_Audio_Fmt(AUD_I2S, AUD_SF_48000Hz); // IIS input , 48KHz | |
> g_ep952_enabled = 1; | |
> printk("%s:%d\n", __func__, __LINE__); | |
> return 0; | |
473a380 | |
> EXPORT_SYMBOL(ep952_open); | |
478,482c385 | |
< g_ep952_enabled = 0; | |
< // if(hdmi_source_ops.tcon_disable) | |
< // hdmi_source_ops.tcon_disable(ep952_device); | |
< // msleep(100); | |
< // hdmi_pin_config(0); | |
--- | |
> g_ep952_enabled = 0; | |
486a390 | |
> EXPORT_SYMBOL(ep952_close); | |
490,492c394,395 | |
< ep952_close(); | |
< ep952_thread_disable(); | |
< return 0; | |
--- | |
> ep952_close(); | |
> return 0; | |
497,499c400,401 | |
< //ep952_thread_enable(); | |
< ep952_open(); | |
< return 0; | |
--- | |
> ep952_open(); | |
> return 0; | |
540a443 | |
> int (*ep952_hdmi_register)(void); | |
544,570c447,448 | |
< printk("%s:%d\n", __func__, __LINE__); | |
< ep952_i2c_client = client; | |
< #if 0 | |
< disp_vdevice_init_data init_data; | |
< | |
< pr_info("[DISP_I2C] hdmi_i2c_probe\n"); | |
< memset(&init_data, 0, sizeof(disp_vdevice_init_data)); | |
< | |
< init_data.disp = hdmi_screen_id; | |
< memcpy(init_data.name, modules_name, 32); | |
< init_data.type = DISP_OUTPUT_TYPE_HDMI; | |
< init_data.fix_timing = 0; | |
< | |
< init_data.func.enable = ep952_open; | |
< init_data.func.disable = ep952_close; | |
< init_data.func.set_mode = ep952_set_mode; | |
< init_data.func.mode_support = ep952_get_mode_support; | |
< init_data.func.get_HPD_status = ep952_get_hpd_status; | |
< init_data.func.get_input_csc = ep952_get_input_csc; | |
< init_data.func.get_video_timing_info = ep952_get_video_timing_info; | |
< init_data.func.suspend = ep952_suspend; | |
< init_data.func.resume = ep952_resume; | |
< init_data.func.early_suspend = ep952_early_suspend; | |
< init_data.func.late_resume = ep952_late_resume; | |
< init_data.func.get_interface_para = ep952_hdmi_get_interface_para; | |
< // disp_vdevice_get_source_ops(&hdmi_source_ops); | |
< #endif | |
--- | |
> printk("%s:%d\n", __func__, __LINE__); | |
> ep952_i2c_client = client; | |
572,573c450,451 | |
< printk("%s:%d\n", __func__, __LINE__); | |
< hdmi_parse_config(); | |
--- | |
> printk("%s:%d\n", __func__, __LINE__); | |
> hdmi_parse_config(); | |
576c454 | |
< EP_HDMI_Init(); | |
--- | |
> EP_HDMI_Init(); | |
578d455 | |
< //EP_HDMI_Init(); | |
583,585c460,462 | |
< ep952_thread_enable(); | |
< bsp_extern_hdmi_register(); | |
< //ep952_device = disp_vdevice_register(&init_data); | |
--- | |
> ep952_thread_enable(); | |
> ep952_hdmi_register = bsp_extern_hdmi_register; | |
> ep952_hdmi_register(); | |
600,602c477 | |
< if(ep952_device); | |
< // disp_vdevice_unregister(ep952_device); | |
< ep952_device = NULL; | |
--- | |
> switch_dev_unregister(&hdmi_switch_dev); | |
614,627c489,500 | |
< printk("%s=============\n",__func__); | |
< //if(hdmi_i2c_id == client->adapter->nr) { | |
< | |
< if(0 == client->adapter->nr) { | |
< printk("%s==111111===========\n",__func__); | |
< const char *type_name = "hdmi_i2c"; | |
< ep952_i2c_adapter = client->adapter; | |
< printk("[DISP_I2C] hdmi_i2c_detect, get right i2c adapter, id=%d, i2c adapter=%x\n", | |
< ep952_i2c_adapter->nr, ep952_i2c_adapter); | |
< strlcpy(info->type, type_name, I2C_NAME_SIZE); | |
< return 0; | |
< } | |
< printk("err.\n"); | |
< return -ENODEV; | |
--- | |
> printk("%s=============\n",__func__); | |
> if(hdmi_i2c_id == client->adapter->nr) { | |
> printk("%s==111111===========\n",__func__); | |
> const char *type_name = "hdmi_i2c"; | |
> ep952_i2c_adapter = client->adapter; | |
> printk("[DISP_I2C] hdmi_i2c_detect, get right i2c adapter, id=%d, i2c adapter=%x\n", | |
> ep952_i2c_adapter->nr, ep952_i2c_adapter); | |
> strlcpy(info->type, type_name, I2C_NAME_SIZE); | |
> return 0; | |
> } | |
> printk("err.\n"); | |
> return -ENODEV; | |
648d520 | |
< // int value; | |
656c528 | |
< printk("hdmi i2c id = %d\n", hdmi_i2c_id); | |
--- | |
> printk("hdmi i2c id = %d\n", hdmi_i2c_id); | |
667a540,590 | |
> static unsigned short ddc_i2c[] = {0x50, I2C_CLIENT_END}; | |
> static const struct i2c_device_id ddc_i2c_id_table[] = {{ "ddc_i2c", 0 },{}}; | |
> MODULE_DEVICE_TABLE(i2c, ddc_i2c_id_table); | |
> | |
> static int ddc_i2c_detect(struct i2c_client *client, struct i2c_board_info *info) | |
> { | |
> printk("%s=============\n",__func__); | |
> if(ddc_i2c_id == client->adapter->nr) { | |
> const char *type_name = "ddc_i2c"; | |
> ddc_i2c_adapter = client->adapter; | |
> printk("[DDC_I2C] ddc_i2c_detect, get right i2c adapter, id=%d\n",ddc_i2c_adapter->nr); | |
> strlcpy(info->type, type_name, I2C_NAME_SIZE); | |
> return 0; | |
> } | |
> printk("[ERR]:ddc_i2c_detect err.\n"); | |
> return -ENODEV; | |
> } | |
> | |
> static struct i2c_driver ddc_i2c_driver = { | |
> .class = I2C_CLASS_HWMON, | |
> .id_table = ddc_i2c_id_table, | |
> .driver = { | |
> .name = "ddc_i2c", | |
> .owner = THIS_MODULE, | |
> }, | |
> .detect = ddc_i2c_detect, | |
> .address_list = ddc_i2c, | |
> }; | |
> | |
> static int ddc_i2c_init(void) | |
> { | |
> int ret; | |
> script_item_u value; | |
> ret = script_get_item(key_name, "ddc_twi_used", &value); | |
> if(1 == ret && value.val) { | |
> ddc_i2c_used = value.val; | |
> if(ddc_i2c_used == 1) { | |
> ret = script_get_item(key_name, "ddc_twi_id", &value); | |
> ddc_i2c_id = (ret == SCIRPT_ITEM_VALUE_TYPE_INT)? value.val : ddc_i2c_id; | |
> printk("ddc i2c id = %d\n", ddc_i2c_id); | |
> return i2c_add_driver(&ddc_i2c_driver); | |
> } | |
> } | |
> return 0; | |
> } | |
> | |
> static void ddc_i2c_exit(void) | |
> { | |
> i2c_del_driver(&ddc_i2c_driver); | |
> } | |
> | |
675d597 | |
< //msg.addr = ep952_i2c_client->addr; | |
691d612 | |
< //.addr = ep952_i2c_client->addr, | |
698,699c619 | |
< //.addr = ep952_i2c_client->addr, | |
< .flags = I2C_M_RD, | |
--- | |
> .flags = I2C_M_RD, | |
724c644 | |
< s32 hdmi_i2c_write(u32 client_addr, u8 *data, int size) | |
--- | |
> s32 ddc_i2c_write(u32 client_addr, u8 *data, int size) | |
729,733c649 | |
< printk("hw.."); | |
< if(hdmi_i2c_adapter == NULL) { | |
< hdmi_i2c_adapter = i2c_get_adapter(0); // fixme | |
< } | |
< if(hdmi_i2c_used) { | |
--- | |
> if(ddc_i2c_used) { | |
738c654 | |
< ret = i2c_transfer(hdmi_i2c_adapter, &msg, 1); | |
--- | |
> ret = i2c_transfer(ddc_i2c_adapter, &msg, 1); | |
744c660 | |
< s32 hdmi_i2c_read(u32 client_addr, u8 sub_addr, u8 *data, int size) | |
--- | |
> s32 ddc_i2c_read(u32 client_addr, u8 sub_addr, u8 *data, int size) | |
747,748d662 | |
< printk("hr.."); | |
< | |
758c672 | |
< .flags = I2C_M_RD, | |
--- | |
> .flags = I2C_M_RD, | |
764,765c678,679 | |
< if(hdmi_i2c_adapter == NULL) { | |
< hdmi_i2c_adapter = i2c_get_adapter(0); // fixme | |
--- | |
> if(ddc_i2c_used) { | |
> ret = i2c_transfer(ddc_i2c_adapter, msgs, 2); | |
768,769c682,691 | |
< if(hdmi_i2c_used) { | |
< ret = i2c_transfer(hdmi_i2c_adapter, msgs, 2); | |
--- | |
> return (ret==2)?0:2; | |
> } | |
> | |
> s32 ddc_i2c_send(struct i2c_msg *msgs, int msg_count) | |
> { | |
> s32 ret = 0; | |
> | |
> | |
> if(ddc_i2c_used) { | |
> ret = i2c_transfer(ddc_i2c_adapter, msgs, msg_count); | |
772c694 | |
< return (ret==2)?0:2; | |
--- | |
> return (ret==msg_count)?0:1; | |
774a697,730 | |
> long ep952_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |
> { | |
> unsigned long karg[4]; | |
> unsigned long ubuffer[4] = {0}; | |
> s32 ret = 0; | |
> | |
> if (copy_from_user((void*)karg,(void __user*)arg,4*sizeof(unsigned long))) { | |
> __wrn("copy_from_user fail\n"); | |
> return -EFAULT; | |
> } | |
> | |
> ubuffer[0] = *(unsigned long*)karg; | |
> ubuffer[1] = (*(unsigned long*)(karg+1)); | |
> ubuffer[2] = (*(unsigned long*)(karg+2)); | |
> ubuffer[3] = (*(unsigned long*)(karg+3)); | |
> | |
> switch(cmd) { | |
> case DISP_CMD_HDMI_SUPPORT_MODE: | |
> // returns: | |
> // 0: mode not supported by connected display device | |
> // 1: mode supported by connected display device | |
> // 2: no connected display device | |
> ret = ep952_check_mode_support(ubuffer[0]); | |
> break; | |
> } | |
> | |
> return ret; | |
> } | |
> | |
> static const struct file_operations ep952_fops = { | |
> .owner = THIS_MODULE, | |
> .unlocked_ioctl = ep952_ioctl, | |
> }; | |
> | |
784,811c740,784 | |
< hdmi_used = value.val; | |
< if(hdmi_used) { | |
< printk("hdmi used.\n"); | |
< ret = script_get_item(key_name, "hdmi_power", &value); | |
< if(2 == ret) { | |
< hdmi_power_used = 1; | |
< memcpy((void*)hdmi_power, (void*)value.str, strlen(value.str)+1); | |
< printk("[HDMI] hdmi_power: %s\n", hdmi_power); | |
< } | |
< hdmi_i2c_init(); | |
< #if 0 | |
< unsigned int value, output_type0, output_mode0, output_type1, output_mode1; | |
< value = disp_boot_para_parse(); | |
< output_type0 = (value >> 8) & 0xff; | |
< output_mode0 = (value) & 0xff; | |
< output_type1 = (value >> 24)& 0xff; | |
< output_mode1 = (value >> 16) & 0xff; | |
< if((output_type0 == DISP_OUTPUT_TYPE_HDMI) || | |
< (output_type1 == DISP_OUTPUT_TYPE_HDMI)) { | |
< printk("[HDMI]%s:smooth boot", __func__); | |
< ep952_hdmi_power_on(1); | |
< if(DISP_OUTPUT_TYPE_HDMI == output_type0) | |
< g_hdmi_mode = output_mode0; | |
< else if(DISP_OUTPUT_TYPE_HDMI == output_type1) | |
< g_hdmi_mode = output_mode1; | |
< } | |
< #endif | |
< } | |
--- | |
> hdmi_used = value.val; | |
> if(hdmi_used) { | |
> printk("hdmi used.\n"); | |
> ret = script_get_item(key_name, "hdmi_power", &value); | |
> if(2 == ret) { | |
> hdmi_power_used = 1; | |
> memcpy((void*)hdmi_power, (void*)value.str, strlen(value.str)+1); | |
> printk("[HDMI] hdmi_power: %s\n", hdmi_power); | |
> } | |
> | |
> ret = script_get_item(key_name, "hpd_delay_enable", &value); | |
> if(1 == ret) { | |
> hpd_delay_enable = value.val; | |
> } | |
> | |
> ddc_i2c_init(); | |
> hdmi_i2c_init(); | |
> ep952_thread_enable(); | |
> | |
> ep952_class = class_create(THIS_MODULE, "hdmi"); | |
> if (IS_ERR(ep952_class)) { | |
> pr_err("failed to allocate class\n"); | |
> return PTR_ERR(ep952_class); | |
> } | |
> ret = alloc_chrdev_region(&devid, 0, 1, "hdmi_ep952"); | |
> if (ret < 0) { | |
> pr_err("failed to allocate char device region\n"); | |
> goto remove_class; | |
> } | |
> ep952_cdev = cdev_alloc(); | |
> if (!ep952_cdev) { | |
> ret = -ENOMEM; | |
> goto remove_class; | |
> } | |
> cdev_init(ep952_cdev, &ep952_fops); | |
> ep952_cdev->owner = THIS_MODULE; | |
> ret = cdev_add(ep952_cdev, devid, 1); | |
> if (ret) { | |
> pr_err("failed to add char device\n"); | |
> goto remove_class; | |
> } | |
> if (device_create(ep952_class, NULL, devid, NULL, "hdmi_ep952") == NULL) { | |
> goto del_cdev; | |
> } | |
> } | |
815a789,796 | |
> | |
> del_cdev: | |
> cdev_del(ep952_cdev); | |
> | |
> remove_class: | |
> class_destroy(ep952_class); | |
> | |
> return ret; | |
820a802 | |
> ep952_thread_disable(); | |
821a804,808 | |
> ddc_i2c_exit(); | |
> | |
> device_destroy(ep952_class, devid); | |
> class_destroy(ep952_class); | |
> cdev_del(ep952_cdev); | |
824c811 | |
< fs_initcall(ep952_module_init); | |
--- | |
> module_init(ep952_module_init); | |
diff -r 1/linux-z7213/drivers/video/sunxi/lcd/Makefile 2/linux-z7213/drivers/video/sunxi/lcd/Makefile | |
4c4 | |
< panels/vvx10f004b00.o panels/lp907qx.o panels/starry768x1024.o panels/sl698ph_720p.o panels/lp079x01.o panels/ep952.o\ | |
--- | |
> panels/vvx10f004b00.o panels/lp907qx.o panels/starry768x1024.o panels/sl698ph_720p.o panels/lp079x01.o panels/h2009.o panels/ep952.o panels/sc7705.o\ | |
diff -r 1/linux-z7213/drivers/video/sunxi/lcd/dev_lcd.c 2/linux-z7213/drivers/video/sunxi/lcd/dev_lcd.c | |
44a45,62 | |
> unsigned long karg[4]; | |
> unsigned long ubuffer[4] = {0}; | |
> | |
> if (copy_from_user((void*)karg,(void __user*)arg,4*sizeof(unsigned long))) { | |
> __wrn("copy_from_user fail\n"); | |
> return -EFAULT; | |
> } | |
> | |
> ubuffer[0] = *(unsigned long*)karg; | |
> ubuffer[1] = (*(unsigned long*)(karg+1)); | |
> ubuffer[2] = (*(unsigned long*)(karg+2)); | |
> ubuffer[3] = (*(unsigned long*)(karg+3)); | |
> | |
> switch(cmd) { | |
> case LCD_PANEL_RELOAD_FUNCS: | |
> LCD_set_panel_funs(); | |
> break; | |
> } | |
58a77,85 | |
> ssize_t reload_lcd_panel_function(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) | |
> { | |
> LCD_set_panel_funs(); | |
> return count; | |
> } | |
> | |
> static CLASS_ATTR(reload_lcd_panel_func, S_IRUGO|S_IWUGO, | |
> NULL, reload_lcd_panel_function); | |
> | |
89a117,119 | |
> | |
> /* for switching LCD display feature */ | |
> class_create_file(g_lcd_drv.lcd_class, &class_attr_reload_lcd_panel_func); | |
diff -r 1/linux-z7213/drivers/video/sunxi/lcd/lcd_panel_cfg.h 2/linux-z7213/drivers/video/sunxi/lcd/lcd_panel_cfg.h | |
50a51,52 | |
> extern __s32 dsi_close_panel(__u32 sel); | |
> extern __s32 dsi_open_panel(__u32 sel); | |
diff -r 1/linux-z7213/drivers/video/sunxi/lcd/panels/ep952.c 2/linux-z7213/drivers/video/sunxi/lcd/panels/ep952.c | |
10a11 | |
> extern s32 ep952_get_video_timing_info(disp_video_timing **video_info); | |
162c163,164 | |
< static s32 LCD_user_defined_func(u32 sel, u32 para1, u32 para2, u32 para3) | |
--- | |
> //static s32 LCD_user_defined_func(u32 sel, u32 para1, u32 para2, u32 para3) | |
> static s32 LCD_user_defined_func(u32 sel, u32 para1, u32 para2, disp_video_timing **para3) | |
176a179,181 | |
> break; | |
> case 4: | |
> ret = ep952_get_video_timing_info(para3); | |
Only in 2/linux-z7213/drivers/video/sunxi/lcd/panels: h2009.c | |
Only in 2/linux-z7213/drivers/video/sunxi/lcd/panels: h2009.h | |
diff -r 1/linux-z7213/drivers/video/sunxi/lcd/panels/panels.c 2/linux-z7213/drivers/video/sunxi/lcd/panels/panels.c | |
4a5 | |
> #include "h2009.h" | |
11a13,14 | |
> extern __lcd_panel_t h2009_panel; | |
> extern __lcd_panel_t sc7705_panel; | |
20a24 | |
> &h2009_panel, | |
21a26 | |
> &sc7705_panel, | |
Only in 2/linux-z7213/drivers/video/sunxi/lcd/panels: sc7705.c | |
Only in 2/linux-z7213/drivers/video/sunxi/lcd/panels: sc7705.h | |
diff -r 1/linux-z7213/fs/proc/Kconfig 2/linux-z7213/fs/proc/Kconfig | |
69a70,78 | |
> | |
> config PROC_EXE_MONITOR | |
> default y | |
> depends on PROC_FS | |
> bool "Enable /proc exe monitoring" if EXPERT | |
> help | |
> Various /proc files exist to monitor process file : | |
> Through /proc/<PID>/exe, you can see the location of the program file | |
> and used to recover the exe file if it be deleted. | |
diff -r 1/linux-z7213/fs/proc/base.c 2/linux-z7213/fs/proc/base.c | |
3018a3019 | |
> #ifdef CONFIG_PROC_EXE_MONITOR | |
3019a3021 | |
> #endif | |
3377a3380 | |
> #ifdef CONFIG_PROC_EXE_MONITOR | |
3378a3382 | |
> #endif | |
Only in 2/linux-z7213/include/linux: compiler-gcc7.h | |
Only in 2/linux-z7213/include/linux: compiler-gcc8.h | |
diff -r 1/linux-z7213/include/linux/hid.h 2/linux-z7213/include/linux/hid.h | |
64,65d63 | |
< #define HID_NUM_MAX (8) | |
< #define HID_NUM_MIN (0) | |
Only in 2/linux-z7213/include/linux/netfilter: xt_CONNMARK.h | |
Only in 1/linux-z7213/include/linux/netfilter: xt_DSCP.h | |
Only in 2/linux-z7213/include/linux/netfilter: xt_RATEEST.h | |
Only in 1/linux-z7213/include/linux/netfilter: xt_connmark.h | |
Only in 2/linux-z7213/include/linux/netfilter: xt_dscp.h | |
Only in 1/linux-z7213/include/linux/netfilter: xt_rateest.h | |
Only in 1/linux-z7213/include/linux/netfilter_ipv4: ipt_TTL.h | |
Only in 2/linux-z7213/include/linux/netfilter_ipv4: ipt_ttl.h | |
diff -r 1/linux-z7213/include/linux/usb/hcd.h 2/linux-z7213/include/linux/usb/hcd.h | |
26c26 | |
< #define MAX_TOPO_LEVEL 6 | |
--- | |
> #define MAX_TOPO_LEVEL 3 | |
diff -r 1/linux-z7213/include/linux/usbdevice_fs.h 2/linux-z7213/include/linux/usbdevice_fs.h | |
206a207 | |
> #define USBDEVFS_SET_HUB_ID_FILTER _IOW('U', 26, unsigned int) | |
diff -r 1/linux-z7213/include/video/drv_display.h 2/linux-z7213/include/video/drv_display.h | |
604a605,617 | |
> struct disp_lcd_esd_info { | |
> /*1:reset all module include tcon; 0:reset panel only*/ | |
> unsigned char level; | |
> /*unit:frame*/ | |
> unsigned short freq; | |
> /*1:in disp isr; 0:in reflush work*/ | |
> unsigned char esd_check_func_pos; | |
> /*count*/ | |
> unsigned int cnt; | |
> /*reset count*/ | |
> unsigned int rst_cnt; | |
> }; | |
> | |
610c623,626 | |
< int (*lcd_user_defined_func)(unsigned int sel, unsigned int para1, unsigned int para2, unsigned int para3); | |
--- | |
> int (*lcd_user_defined_func)(unsigned int sel, unsigned int para1, unsigned int para2, disp_video_timing** para3); | |
> int (*esd_check)(unsigned int sel); | |
> int (*reset_panel)(unsigned int sel); | |
> int (*set_esd_info)(struct disp_lcd_esd_info *p_info); | |
809a826,828 | |
> | |
> //---astro lcd switch --- | |
> DISP_CMD_LCD_PARA = 0x304, | |
811a831 | |
> #define LCD_PANEL_RELOAD_FUNCS 0x305 | |
814c834 | |
< | |
--- | |
> #define SUPPORT_EP952 | |
Only in 1/linux-z7213/net/netfilter: xt_DSCP.c | |
Only in 1/linux-z7213/net/netfilter: xt_RATEEST.c | |
Only in 1/linux-z7213/net/netfilter: xt_TCPMSS.c | |
Only in 2/linux-z7213/net/netfilter: xt_dscp.c | |
Only in 2/linux-z7213/net/netfilter: xt_rateest.c | |
Only in 2/linux-z7213/net/netfilter: xt_tcpmss.c | |
diff -r 1/linux-z7213/sound/soc/sunxi/audiocodec/sun8iw5_sndcodec.c 2/linux-z7213/sound/soc/sunxi/audiocodec/sun8iw5_sndcodec.c | |
34a35,38 | |
> #if defined(CONFIG_SWITCH) || defined(CONFIG_ANDROID_SWITCH) | |
> #include <linux/switch.h> | |
> #endif | |
> | |
58a63 | |
> static int audio_jack_sts = -1; | |
213a219,224 | |
> #if defined(CONFIG_SWITCH) || defined(CONFIG_ANDROID_SWITCH) | |
> static struct switch_dev audio_jack_dev = { | |
> .name = "audio_jack", | |
> }; | |
> #endif | |
> | |
407a419,422 | |
> if (reg == HP_VOLC) { | |
> pr_err("set vol to %d\n",(val & val_mask)); | |
> earpiece_vol = headphone_vol = pa_vol = (val & val_mask); | |
> } | |
1034a1050,1058 | |
> | |
> #if defined(CONFIG_SWITCH) || defined(CONFIG_ANDROID_SWITCH) | |
> if(ret != audio_jack_sts) | |
> { | |
> audio_jack_sts = ret; | |
> switch_set_state(&audio_jack_dev, audio_jack_sts); | |
> } | |
> #endif | |
> | |
2139c2163 | |
< for(i=0; i < headphone_vol; i++) { | |
--- | |
> for(i=0; i < earpiece_vol; i++) { | |
3558a3583,3587 | |
> else { | |
> #if defined(CONFIG_SWITCH) || defined(CONFIG_ANDROID_SWITCH) | |
> switch_dev_register(&audio_jack_dev); | |
> #endif | |
> } | |
3726a3756,3758 | |
> #if defined(CONFIG_SWITCH) || defined(CONFIG_ANDROID_SWITCH) | |
> switch_dev_unregister(&audio_jack_dev); | |
> #endif | |
Binary files 1/linux-z7213.tar.gz and 2/linux-z7213.tar.gz differ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff 1/brandy/u-boot-2011.09 2/u-boot-2011.09 -r | |
diff -r 1/brandy/u-boot-2011.09/arch/arm/cpu/armv7/sun8iw5/spl/Makefile 2/u-boot-2011.09/arch/arm/cpu/armv7/sun8iw5/spl/Makefile | |
34d33 | |
< # COBJS += sw2001_verify/sw2001.o | |
diff -r 1/brandy/u-boot-2011.09/arch/arm/cpu/armv7/sun8iw5/spl/sunxi_i2c_spl.c 2/u-boot-2011.09/arch/arm/cpu/armv7/sun8iw5/spl/sunxi_i2c_spl.c | |
485a486 | |
> int _2_pow_clk_n=1; | |
537c538,541 | |
< clk_m = (24000/10)/((2^clk_n) * speed) - 1; | |
--- | |
> //calculate 2 pow clk_n: | |
> _2_pow_clk_n = _2_pow_clk_n<<clk_n; | |
> | |
> clk_m = (24000/10)/(_2_pow_clk_n * speed) - 1; | |
539a544 | |
> //printf("%s %d clk_m=0x%x clk_n=0x%x _2_pow_clk_n=%d \n", __func__, __LINE__, clk_m, clk_n, _2_pow_clk_n); | |
diff -r 1/brandy/u-boot-2011.09/arch/arm/cpu/armv7/sun8iw5/timer.c 2/u-boot-2011.09/arch/arm/cpu/armv7/sun8iw5/timer.c | |
99a100,104 | |
> ulong get_mtimer(ulong base) | |
> { | |
> return get_timer_masked() - base; | |
> } | |
> | |
diff -r 1/brandy/u-boot-2011.09/arch/arm/include/asm/arch-sun8iw5/pwm.h 2/u-boot-2011.09/arch/arm/include/asm/arch-sun8iw5/pwm.h | |
23,24c23,24 | |
< #define PWM_NUM 2 | |
< #define PWM_REG_NUM 3 | |
--- | |
> #define PWM_NUM 3 | |
> #define PWM_REG_NUM 5 | |
Only in 1/brandy/u-boot-2011.09/arch/arm/include/asm/arch-sun8iw5: sw2001_verify | |
diff -r 1/brandy/u-boot-2011.09/arch/arm/lib/board.c 2/u-boot-2011.09/arch/arm/lib/board.c | |
100a101 | |
> int sunxi_auto_fel_by_usb(void); | |
674a676,680 | |
> #ifndef CONFIG_ARCH_HOMELET | |
> printf("board_status_probe\n"); | |
> board_status_probe(0); | |
> #endif | |
> | |
912,913d917 | |
< printf("board_status_probe\n"); | |
< board_status_probe(0); | |
915c919 | |
< #if 0 | |
--- | |
> | |
918,919c922,923 | |
< printf("sunxi_bmp_logo_display\n"); | |
< sunxi_bmp_display("bootlogo.bmp"); | |
--- | |
> printf("sunxi_bmp_logo_display\n"); | |
> sunxi_bmp_display("bootlogo.bmp"); | |
926c930 | |
< #endif | |
--- | |
> | |
932c936,938 | |
< | |
--- | |
> #ifdef CONFIG_CMD_SUNXI_AUTO_FEL | |
> sunxi_auto_fel_by_usb(); | |
> #endif | |
diff -r 1/brandy/u-boot-2011.09/board/sunxi/Makefile 2/u-boot-2011.09/board/sunxi/Makefile | |
46a47 | |
> COBJS-$(CONFIG_CMD_SUNXI_AUTO_FEL) += sunxi_auto_fel.o | |
diff -r 1/brandy/u-boot-2011.09/board/sunxi/board_common.c 2/u-boot-2011.09/board/sunxi/board_common.c | |
499a500,576 | |
> #define RECOVERY_MODE_GPIO_MAX 5 | |
> | |
> static int detect_recovery_mode_by_gpio_keys(void) | |
> { | |
> int i; | |
> int ret = 0; | |
> int key_cnt = 0; | |
> int key_debounce_interval = 0; | |
> char buf[32]; | |
> user_gpio_set_t key[RECOVERY_MODE_GPIO_MAX]; | |
> u32 key_hdl[RECOVERY_MODE_GPIO_MAX]; | |
> | |
> if (axp_probe_startup_cause() == 1) { | |
> // AXP_POWER_ON_BY_POWER_TRIGGER | |
> } else { | |
> // AXP_POWER_ON_BY_POWER_KEY | |
> return 0; | |
> } | |
> | |
> /* | |
> * Add items like this into sys_config.fex: | |
> * | |
> * [recovery_gpiokey_para] | |
> * key_cnt = 2 | |
> * key_debounce_interval = 5 | |
> * key0_io = port:PH04<0><default><default><1> | |
> * key1_io = port:PH05<0><default><default><1> | |
> */ | |
> | |
> ret = script_parser_fetch("recovery_gpiokey_para", "key_cnt", | |
> &key_cnt, 1); | |
> | |
> if (ret != 0 || key_cnt <= 0 || key_cnt > RECOVERY_MODE_GPIO_MAX) { | |
> return 0; | |
> } | |
> | |
> ret = script_parser_fetch("recovery_gpiokey_para", | |
> "key_debounce_interval", | |
> &key_debounce_interval, 1); | |
> | |
> if (ret != 0 || key_debounce_interval <= 0 || | |
> key_debounce_interval > 10 * 1000) { | |
> return 0; | |
> } | |
> | |
> for (i = 0; i < key_cnt; i++) { | |
> sprintf(buf, "key%d_io", i); | |
> ret = script_parser_fetch("recovery_gpiokey_para", buf, | |
> (int *)(&key[i]), | |
> sizeof(user_gpio_set_t) / 4); | |
> | |
> if (ret != 0) { | |
> return 0; | |
> } | |
> | |
> key_hdl[i] = gpio_request(&key[i], 1); | |
> } | |
> | |
> for (i = 0; i < key_cnt; i++) { | |
> if (gpio_read_one_pin_value(key_hdl[i], 0) == key[i].data) { | |
> // read data value == default data value, not pressed | |
> return 0; | |
> } | |
> } | |
> | |
> __msdelay(key_debounce_interval); | |
> | |
> for (i = 0; i < key_cnt; i++) { | |
> if (gpio_read_one_pin_value(key_hdl[i], 0) == key[i].data) { | |
> // read data value == default data value, not pressed | |
> return 0; | |
> } | |
> } | |
> | |
> return 1; | |
> } | |
> | |
526a604,608 | |
> | |
> if (detect_recovery_mode_by_gpio_keys()) { | |
> return ANDROID_RECOVERY_MODE; | |
> } | |
> | |
diff -r 1/brandy/u-boot-2011.09/board/sunxi/de.c 2/u-boot-2011.09/board/sunxi/de.c | |
234a235,240 | |
> #ifdef CONFIG_ARCH_SUN8IW5P1 | |
> cmd = DISP_CMD_LCD_SET_BRIGHTNESS; | |
> arg[0] = 0; /* screen_id */ | |
> arg[1] = 0; /* brightness */ | |
> disp_ioctl(NULL, cmd, (void *)arg); | |
> #else | |
236a243 | |
> #endif | |
diff -r 1/brandy/u-boot-2011.09/board/sunxi/key_burn.c 2/u-boot-2011.09/board/sunxi/key_burn.c | |
101c101 | |
< return -1; | |
--- | |
> //return -1; | |
Only in 2/u-boot-2011.09/board/sunxi: sunxi_auto_fel.c | |
diff -r 1/brandy/u-boot-2011.09/common/Makefile 2/u-boot-2011.09/common/Makefile | |
165a166 | |
> COBJS-$(CONFIG_CMD_SUNXI_AUTO_FEL) += sunxi_auto_fel.o | |
diff -r 1/brandy/u-boot-2011.09/common/cmd_irq.c 2/u-boot-2011.09/common/cmd_irq.c | |
162c162 | |
< sunxi_usb_main_loop(2500); | |
--- | |
> sunxi_usb_main_loop(0); | |
Only in 2/u-boot-2011.09/common: sunxi_auto_fel.c | |
diff -r 1/brandy/u-boot-2011.09/drivers/pwm/sunxi-pwm.c 2/u-boot-2011.09/drivers/pwm/sunxi-pwm.c | |
5d4 | |
< * | |
41c40 | |
< #define pwm_debug(fmt,args...) printf(fmt ,##args) | |
--- | |
> #define pwm_debug(fmt,args...) printf(fmt ,##args) | |
43c42 | |
< #define pwm_debug(fmt,args...) | |
--- | |
> #define pwm_debug(fmt,args...) | |
47c46 | |
< #define PWM_FPGA | |
--- | |
> #define PWM_FPGA | |
52c51 | |
< uint value = 0; | |
--- | |
> uint value = 0; | |
54c53 | |
< value = sys_get_wvalue(PWM03_BASE + offset); | |
--- | |
> value = sys_get_wvalue(PWM03_BASE + offset); | |
56c55 | |
< return value; | |
--- | |
> return value; | |
61c60 | |
< sys_put_wvalue(PWM03_BASE + offset, value); | |
--- | |
> sys_put_wvalue(PWM03_BASE + offset, value); | |
63c62 | |
< return 0; | |
--- | |
> return 0; | |
65a65,81 | |
> //s_pwm (R_pwm) | |
> static __u32 sunxi_r_pwm_read_reg(__u32 offset) | |
> { | |
> __u32 value = 0; | |
> | |
> value = sys_get_wvalue(R_PWM_BASE + offset); | |
> | |
> return value; | |
> } | |
> | |
> //s_pwm(R_pwm) | |
> static __u32 sunxi_r_pwm_write_reg(__u32 offset, __u32 value) | |
> { | |
> sys_put_wvalue(R_PWM_BASE + offset, value); | |
> | |
> return 0; | |
> } | |
68,94c84,110 | |
< int ret, val; | |
< char primary_key[25]; | |
< user_gpio_set_t gpio_info[1]; | |
< | |
< sprintf(primary_key, "pwm%d_para", pwm); | |
< ret = script_parser_fetch(primary_key, "pwm_used", &val, 1); | |
< if(ret < 0) { | |
< pwm_debug("fetch script data fail\n"); | |
< } else { | |
< if(val == 1) { | |
< ret = script_parser_fetch(primary_key, "pwm_positive", (int *)&gpio_info, sizeof(user_gpio_set_t) / sizeof(int)); | |
< if(ret < 0) { | |
< pwm_debug("fetch script data fail\n"); | |
< } else { | |
< pwm_pin_count[pwm]++; | |
< memcpy(&pwm_gpio_info[pwm][0], gpio_info, sizeof(user_gpio_set_t)); | |
< } | |
< | |
< ret = script_parser_fetch(primary_key, "pwm_negative", (int *)&gpio_info, sizeof(user_gpio_set_t) / sizeof(int)); | |
< if(ret < 0) { | |
< pwm_debug("fetch script data fail\n"); | |
< } else { | |
< pwm_pin_count[pwm]++; | |
< memcpy(&pwm_gpio_info[pwm][1], gpio_info, sizeof(user_gpio_set_t)); | |
< } | |
< } | |
< } | |
--- | |
> int ret, val; | |
> char primary_key[25]; | |
> user_gpio_set_t gpio_info[1]; | |
> | |
> sprintf(primary_key, "pwm%d_para", pwm); | |
> ret = script_parser_fetch(primary_key, "pwm_used", &val, 1); | |
> if(ret < 0) { | |
> pwm_debug("fetch script data fail\n"); | |
> } else { | |
> if(val == 1) { | |
> ret = script_parser_fetch(primary_key, "pwm_positive", (int *)&gpio_info, sizeof(user_gpio_set_t) / sizeof(int)); | |
> if(ret < 0) { | |
> pwm_debug("fetch script data fail\n"); | |
> } else { | |
> pwm_pin_count[pwm]++; | |
> memcpy(&pwm_gpio_info[pwm][0], gpio_info, sizeof(user_gpio_set_t)); | |
> } | |
> | |
> ret = script_parser_fetch(primary_key, "pwm_negative", (int *)&gpio_info, sizeof(user_gpio_set_t) / sizeof(int)); | |
> if(ret < 0) { | |
> pwm_debug("fetch script data fail\n"); | |
> } else { | |
> pwm_pin_count[pwm]++; | |
> memcpy(&pwm_gpio_info[pwm][1], gpio_info, sizeof(user_gpio_set_t)); | |
> } | |
> } | |
> } | |
99c115 | |
< uint temp; | |
--- | |
> uint temp; | |
103c119 | |
< temp = sunxi_pwm_read_reg(pwm * 0x10); | |
--- | |
> temp = sunxi_pwm_read_reg(pwm * 0x10); | |
105,111c121,127 | |
< if(polarity == PWM_POLARITY_NORMAL) { | |
< pwm_active_sta[pwm] = 1; | |
< temp |= 1 << 5; | |
< } else { | |
< pwm_active_sta[pwm] = 0; | |
< temp &= ~(1 << 5); | |
< } | |
--- | |
> if(polarity == PWM_POLARITY_NORMAL) { | |
> pwm_active_sta[pwm] = 1; | |
> temp |= 1 << 5; | |
> } else { | |
> pwm_active_sta[pwm] = 0; | |
> temp &= ~(1 << 5); | |
> } | |
113c129 | |
< sunxi_pwm_write_reg(pwm * 0x10, temp); | |
--- | |
> sunxi_pwm_write_reg(pwm * 0x10, temp); | |
117,130c133,146 | |
< temp = sunxi_pwm_read_reg(0); | |
< if(polarity == PWM_POLARITY_NORMAL) { | |
< pwm_active_sta[pwm] = 1; | |
< if(pwm == 0) | |
< temp |= 1 << 5; | |
< else | |
< temp |= 1 << 20; | |
< }else { | |
< pwm_active_sta[pwm] = 0; | |
< if(pwm == 0) | |
< temp &= ~(1 << 5); | |
< else | |
< temp &= ~(1 << 20); | |
< } | |
--- | |
> temp = sunxi_pwm_read_reg(0); | |
> if(polarity == PWM_POLARITY_NORMAL) { | |
> pwm_active_sta[pwm] = 1; | |
> if(pwm == 0 || pwm ==2 ) | |
> temp |= 1 << 5; | |
> else | |
> temp |= 1 << 20; | |
> } else { | |
> pwm_active_sta[pwm] = 0; | |
> if(pwm == 0 || pwm ==2) | |
> temp &= ~(1 << 5); | |
> else | |
> temp &= ~(1 << 20); | |
> } | |
132c148,151 | |
< sunxi_pwm_write_reg(0, temp); | |
--- | |
> if (pwm == 0 || pwm == 1) | |
> sunxi_pwm_write_reg(0, temp); | |
> else | |
> sunxi_r_pwm_write_reg(0, temp); | |
137,149c156,168 | |
< if(polarity == PWM_POLARITY_NORMAL) { | |
< pwm_active_sta[pwm] = 1; | |
< if(pwm == 0) | |
< temp |= 1 << 5; | |
< else | |
< temp |= 1 << 20; | |
< }else { | |
< pwm_active_sta[pwm] = 0; | |
< if(pwm == 0) | |
< temp &= ~(1 << 5); | |
< else | |
< temp &= ~(1 << 20); | |
< } | |
--- | |
> if(polarity == PWM_POLARITY_NORMAL) { | |
> pwm_active_sta[pwm] = 1; | |
> if(pwm == 0) | |
> temp |= 1 << 5; | |
> else | |
> temp |= 1 << 20; | |
> }else { | |
> pwm_active_sta[pwm] = 0; | |
> if(pwm == 0) | |
> temp &= ~(1 << 5); | |
> else | |
> temp &= ~(1 << 20); | |
> } | |
154c173 | |
< return 0; | |
--- | |
> return 0; | |
161,199c180,216 | |
< uint pre_scal[7] = {1, 2, 4, 8, 16, 32, 64}; | |
< uint freq; | |
< uint pre_scal_id = 0; | |
< uint entire_cycles = 256; | |
< uint active_cycles = 192; | |
< uint entire_cycles_max = 65536; | |
< uint temp; | |
< uint calc; | |
< | |
< if(period_ns < 10667) | |
< freq = 93747; | |
< else if(period_ns > 174762666) { | |
< freq = 6; | |
< calc = period_ns / duty_ns; | |
< duty_ns = 174762666 / calc; | |
< period_ns = 174762666; | |
< } | |
< else | |
< freq = 1000000000 / period_ns; | |
< | |
< entire_cycles = 24000000 / freq /pre_scal[pre_scal_id]; | |
< | |
< while(entire_cycles > entire_cycles_max) { | |
< pre_scal_id++; | |
< | |
< if(pre_scal_id > 6) | |
< break; | |
< | |
< entire_cycles = 24000000 / freq / pre_scal[pre_scal_id]; | |
< } | |
< | |
< if(period_ns < 5*100*1000) | |
< active_cycles = (duty_ns * entire_cycles + (period_ns/2)) /period_ns; | |
< else if(period_ns >= 5*100*1000 && period_ns < 6553500) | |
< active_cycles = ((duty_ns / 100) * entire_cycles + (period_ns /2 / 100)) / (period_ns/100); | |
< else | |
< active_cycles = ((duty_ns / 10000) * entire_cycles + (period_ns /2 / 10000)) / (period_ns/10000); | |
< | |
< temp = sunxi_pwm_read_reg(pwm * 0x10); | |
--- | |
> uint pre_scal[7] = {1, 2, 4, 8, 16, 32, 64}; | |
> uint freq; | |
> uint pre_scal_id = 0; | |
> uint entire_cycles = 256; | |
> uint active_cycles = 192; | |
> uint entire_cycles_max = 65536; | |
> uint temp; | |
> uint calc; | |
> | |
> if(period_ns < 10667) | |
> freq = 93747; | |
> else if(period_ns > 174762666) { | |
> freq = 6; | |
> calc = period_ns / duty_ns; | |
> duty_ns = 174762666 / calc; | |
> period_ns = 174762666; | |
> } | |
> else | |
> freq = 1000000000 / period_ns; | |
> | |
> entire_cycles = 24000000 / freq /pre_scal[pre_scal_id]; | |
> | |
> while(entire_cycles > entire_cycles_max) { | |
> pre_scal_id++; | |
> | |
> if(pre_scal_id > 6) | |
> break; | |
> | |
> entire_cycles = 24000000 / freq / pre_scal[pre_scal_id]; | |
> } | |
> | |
> if(period_ns < 5*100*1000) | |
> active_cycles = (duty_ns * entire_cycles + (period_ns/2)) /period_ns; | |
> else if(period_ns >= 5*100*1000 && period_ns < 6553500) | |
> active_cycles = ((duty_ns / 100) * entire_cycles + (period_ns /2 / 100)) / (period_ns/100); | |
> else | |
> active_cycles = ((duty_ns / 10000) * entire_cycles + (period_ns /2 / 10000)) / (period_ns/10000); | |
201c218 | |
< temp = (temp & 0xfffffff0) | pre_scal_id; | |
--- | |
> temp = sunxi_pwm_read_reg(pwm * 0x10); | |
203,204c220 | |
< sunxi_pwm_write_reg(pwm * 0x10, temp); | |
< printf("[PWM]temp = %d,entire_cycles = %d, active_cycles = %d\n", pwm * 0x10,entire_cycles, active_cycles); | |
--- | |
> temp = (temp & 0xfffffff0) | pre_scal_id; | |
206c222,223 | |
< sunxi_pwm_write_reg(pwm * 0x10 + 0x04, ((entire_cycles - 1)<< 16) | active_cycles); | |
--- | |
> sunxi_pwm_write_reg(pwm * 0x10, temp); | |
> printf("[PWM]temp = %d,entire_cycles = %d, active_cycles = %d\n", pwm * 0x10,entire_cycles, active_cycles); | |
208c225,227 | |
< pwm_debug("PWM _TEST: duty_ns=%d, period_ns=%d, freq=%d, per_scal=%d, period_reg=0x%x\n", duty_ns, period_ns, freq, pre_scal_id, temp); | |
--- | |
> sunxi_pwm_write_reg(pwm * 0x10 + 0x04, ((entire_cycles - 1)<< 16) | active_cycles); | |
> | |
> pwm_debug("PWM _TEST: duty_ns=%d, period_ns=%d, freq=%d, per_scal=%d, period_reg=0x%x\n", duty_ns, period_ns, freq, pre_scal_id, temp); | |
213,219c232,238 | |
< uint pre_scal[11][2] = {{15, 1}, {0, 120}, {1, 180}, {2, 240}, {3, 360}, {4, 480}, {8, 12000}, {9, 24000}, {10, 36000}, {11, 48000}, {12, 72000}}; | |
< uint freq; | |
< uint pre_scal_id = 0; | |
< uint entire_cycles = 256; | |
< uint active_cycles = 192; | |
< uint entire_cycles_max = 65536; | |
< uint temp; | |
--- | |
> uint pre_scal[11][2] = {{15, 1}, {0, 120}, {1, 180}, {2, 240}, {3, 360}, {4, 480}, {8, 12000}, {9, 24000}, {10, 36000}, {11, 48000}, {12, 72000}}; | |
> uint freq; | |
> uint pre_scal_id = 0; | |
> uint entire_cycles = 256; | |
> uint active_cycles = 192; | |
> uint entire_cycles_max = 65536; | |
> uint temp; | |
230,237c249,256 | |
< if(period_ns < 10667) | |
< freq = 93747; | |
< else if(period_ns > 1000000000) | |
< freq = 1; | |
< else | |
< freq = 1000000000 / period_ns; | |
< | |
< entire_cycles = 24000000 / freq / pre_scal[pre_scal_id][1]; | |
--- | |
> if(period_ns < 10667) | |
> freq = 93747; | |
> else if(period_ns > 1000000000) | |
> freq = 1; | |
> else | |
> freq = 1000000000 / period_ns; | |
> | |
> entire_cycles = 24000000 / freq / pre_scal[pre_scal_id][1]; | |
239,240c258,259 | |
< while(entire_cycles > entire_cycles_max) { | |
< pre_scal_id++; | |
--- | |
> while(entire_cycles > entire_cycles_max) { | |
> pre_scal_id++; | |
242,243c261,262 | |
< if(pre_scal_id > 10) | |
< break; | |
--- | |
> if(pre_scal_id > 10) | |
> break; | |
245,255c264,265 | |
< entire_cycles = 24000000 / freq / pre_scal[pre_scal_id][1]; | |
< } | |
< | |
< if(period_ns < 5*100*1000) | |
< active_cycles = (duty_ns * entire_cycles + (period_ns/2)) /period_ns; | |
< else if(period_ns >= 5*100*1000 && period_ns < 6553500) | |
< active_cycles = ((duty_ns / 100) * entire_cycles + (period_ns /2 / 100)) / (period_ns/100); | |
< else | |
< active_cycles = ((duty_ns / 10000) * entire_cycles + (period_ns /2 / 10000)) / (period_ns/10000); | |
< | |
< temp = sunxi_pwm_read_reg(0); | |
--- | |
> entire_cycles = 24000000 / freq / pre_scal[pre_scal_id][1]; | |
> } | |
257,260c267,290 | |
< if(pwm == 0) | |
< temp = (temp & 0xfffffff0) |pre_scal[pre_scal_id][0]; | |
< else | |
< temp = (temp & 0xfff87fff) |pre_scal[pre_scal_id][0]; | |
--- | |
> if(period_ns < 5*100*1000) | |
> active_cycles = (duty_ns * entire_cycles + (period_ns/2)) /period_ns; | |
> else if(period_ns >= 5*100*1000 && period_ns < 6553500) | |
> active_cycles = ((duty_ns / 100) * entire_cycles + (period_ns /2 / 100)) / (period_ns/100); | |
> else | |
> active_cycles = ((duty_ns / 10000) * entire_cycles + (period_ns /2 / 10000)) / (period_ns/10000); | |
> | |
> if (pwm == 0 || pwm == 1) | |
> temp = sunxi_pwm_read_reg(0); | |
> else | |
> temp = sunxi_r_pwm_read_reg(0); | |
> | |
> if(pwm == 0 || pwm == 2) | |
> temp = (temp & 0xfffffff0) |pre_scal[pre_scal_id][0]; | |
> else | |
> temp = (temp & 0xfff87fff) |pre_scal[pre_scal_id][0]; | |
> | |
> if (pwm == 0 || pwm == 1) { | |
> sunxi_pwm_write_reg(0, temp); | |
> sunxi_pwm_write_reg((pwm + 1) * 0x04, ((entire_cycles - 1)<< 16) | active_cycles); | |
> }else{ | |
> sunxi_r_pwm_write_reg(0, temp); | |
> sunxi_r_pwm_write_reg(0x04, ((entire_cycles - 1)<< 16) | active_cycles); | |
> } | |
262c292,293 | |
< sunxi_pwm_write_reg(0, temp); | |
--- | |
> pwm_debug("PWM _TEST: duty_ns=%d, period_ns=%d, freq=%d, per_scal=%d, period_reg=0x%x\n", duty_ns, period_ns, freq, pre_scal_id, temp); | |
> #elif (defined CONFIG_ARCH_SUN7I) || (defined CONFIG_ARCH_SUN5I) | |
264c295,306 | |
< sunxi_pwm_write_reg((pwm + 1) * 0x04, ((entire_cycles - 1)<< 16) | active_cycles); | |
--- | |
> __u32 pre_scal[10] = {120, 180, 240, 360, 480, 12000, 24000, 36000, 48000, 72000}; | |
> __u32 pre_scal_id = 0, entire_cycle = 256, active_cycle = 192; | |
> __u32 i=0, tmp=0; | |
> __u32 freq; | |
> | |
> freq = 1000000000 /period_ns; | |
> | |
> if(freq > 200000) | |
> { | |
> pwm_debug("pwm preq is large then 200khz, fix to 200khz\n"); | |
> freq = 200000; | |
> } | |
266c308,331 | |
< pwm_debug("PWM _TEST: duty_ns=%d, period_ns=%d, freq=%d, per_scal=%d, period_reg=0x%x\n", duty_ns, period_ns, freq, pre_scal_id, temp); | |
--- | |
> if(freq > 781) | |
> { | |
> pre_scal_id = 0; | |
> entire_cycle = (24000000 / pre_scal[pre_scal_id] + (freq/2)) / freq; | |
> pwm_debug("pre_scal:%d, entire_cycle:%d, pwm_freq:%d\n", pre_scal[i], entire_cycle, 24000000 / pre_scal[pre_scal_id] / entire_cycle ); | |
> } | |
> else | |
> { | |
> for(i=0; i<10; i++) | |
> { | |
> __u32 pwm_freq = 0; | |
> | |
> pwm_freq = 24000000 / (pre_scal[i] * 256); | |
> if((abs((pwm_freq) - (freq))) < (abs((tmp) - (freq)))) | |
> { | |
> tmp = pwm_freq; | |
> pre_scal_id = i; | |
> entire_cycle = 256; | |
> pwm_debug("pre_scal:%d, entire_cycle:%d, pwm_freq:%d\n", pre_scal[i], 256, pwm_freq); | |
> pwm_debug("----%d\n", tmp); | |
> } | |
> } | |
> } | |
> active_cycle = (duty_ns * entire_cycle + (period_ns/2)) /period_ns; | |
268c333,336 | |
< #elif (defined CONFIG_ARCH_SUN7I) || (defined CONFIG_ARCH_SUN5I) | |
--- | |
> if(pre_scal_id >= 5) | |
> { | |
> pre_scal_id += 3; | |
> } | |
270,328c338,353 | |
< __u32 pre_scal[10] = {120, 180, 240, 360, 480, 12000, 24000, 36000, 48000, 72000}; | |
< __u32 pre_scal_id = 0, entire_cycle = 256, active_cycle = 192; | |
< __u32 i=0, tmp=0; | |
< __u32 freq; | |
< | |
< freq = 1000000000 /period_ns; | |
< | |
< if(freq > 200000) | |
< { | |
< pwm_debug("pwm preq is large then 200khz, fix to 200khz\n"); | |
< freq = 200000; | |
< } | |
< | |
< if(freq > 781) | |
< { | |
< pre_scal_id = 0; | |
< entire_cycle = (24000000 / pre_scal[pre_scal_id] + (freq/2)) / freq; | |
< pwm_debug("pre_scal:%d, entire_cycle:%d, pwm_freq:%d\n", pre_scal[i], entire_cycle, 24000000 / pre_scal[pre_scal_id] / entire_cycle ); | |
< } | |
< else | |
< { | |
< for(i=0; i<10; i++) | |
< { | |
< __u32 pwm_freq = 0; | |
< | |
< pwm_freq = 24000000 / (pre_scal[i] * 256); | |
< if((abs((pwm_freq) - (freq))) < (abs((tmp) - (freq)))) | |
< { | |
< tmp = pwm_freq; | |
< pre_scal_id = i; | |
< entire_cycle = 256; | |
< pwm_debug("pre_scal:%d, entire_cycle:%d, pwm_freq:%d\n", pre_scal[i], 256, pwm_freq); | |
< pwm_debug("----%d\n", tmp); | |
< } | |
< } | |
< } | |
< active_cycle = (duty_ns * entire_cycle + (period_ns/2)) /period_ns; | |
< | |
< if(pre_scal_id >= 5) | |
< { | |
< pre_scal_id += 3; | |
< } | |
< | |
< if(pwm == 0) | |
< { | |
< sunxi_pwm_write_reg(0x204, ((entire_cycle - 1)<< 16) | active_cycle); | |
< | |
< tmp = sunxi_pwm_read_reg(0x200) & 0xfffffff0; | |
< tmp |= pre_scal_id;//bit6:gatting the special clock for pwm0; bit5:pwm0 active state is high level | |
< sunxi_pwm_write_reg(0x200,tmp); | |
< } | |
< else | |
< { | |
< sunxi_pwm_write_reg(0x208, ((entire_cycle - 1)<< 16) | active_cycle); | |
< | |
< tmp = sunxi_pwm_read_reg(0x200) & 0xfff87fff; | |
< tmp |= (pre_scal_id<<15);//bit21:gatting the special clock for pwm1; bit20:pwm1 active state is high level | |
< sunxi_pwm_write_reg(0x200,tmp); | |
< } | |
--- | |
> if(pwm == 0) | |
> { | |
> sunxi_pwm_write_reg(0x204, ((entire_cycle - 1)<< 16) | active_cycle); | |
> | |
> tmp = sunxi_pwm_read_reg(0x200) & 0xfffffff0; | |
> tmp |= pre_scal_id;//bit6:gatting the special clock for pwm0; bit5:pwm0 active state is high level | |
> sunxi_pwm_write_reg(0x200,tmp); | |
> } | |
> else | |
> { | |
> sunxi_pwm_write_reg(0x208, ((entire_cycle - 1)<< 16) | active_cycle); | |
> | |
> tmp = sunxi_pwm_read_reg(0x200) & 0xfff87fff; | |
> tmp |= (pre_scal_id<<15);//bit21:gatting the special clock for pwm1; bit20:pwm1 active state is high level | |
> sunxi_pwm_write_reg(0x200,tmp); | |
> } | |
330c355 | |
< pwm_debug("PWM _TEST: duty_ns=%d, period_ns=%d, freq=%d, per_scal=%d, period_reg=0x%x\n", duty_ns, period_ns, freq, pre_scal_id, temp); | |
--- | |
> pwm_debug("PWM _TEST: duty_ns=%d, period_ns=%d, freq=%d, per_scal=%d, period_reg=0x%x\n", duty_ns, period_ns, freq, pre_scal_id, temp); | |
334c359 | |
< return 0; | |
--- | |
> return 0; | |
339c364 | |
< uint temp; | |
--- | |
> uint temp; | |
343,344c368,369 | |
< int i; | |
< uint ret = 0; | |
--- | |
> int i; | |
> uint ret = 0; | |
346,350c371,375 | |
< for(i = 0; i < pwm_pin_count[pwm]; i++) { | |
< ret = gpio_request_early(&pwm_gpio_info[pwm][i], 1,1); | |
< if(ret == 0) { | |
< pwm_debug("pwm gpio request failed!\n"); | |
< } | |
--- | |
> for(i = 0; i < pwm_pin_count[pwm]; i++) { | |
> ret = gpio_request_early(&pwm_gpio_info[pwm][i], 1,1); | |
> if(ret == 0) { | |
> pwm_debug("pwm gpio request failed!\n"); | |
> } | |
352,353c377,378 | |
< //gpio_release(ret, 2); | |
< } | |
--- | |
> //gpio_release(ret, 2); | |
> } | |
359c384 | |
< temp = sunxi_pwm_read_reg(pwm * 0x10); | |
--- | |
> temp = sunxi_pwm_read_reg(pwm * 0x10); | |
361,362c386,387 | |
< temp |= 1 << 4; | |
< temp |= 1 << 6; | |
--- | |
> temp |= 1 << 4; | |
> temp |= 1 << 6; | |
364c389 | |
< sunxi_pwm_write_reg(pwm * 0x10, temp); | |
--- | |
> sunxi_pwm_write_reg(pwm * 0x10, temp); | |
366a392,403 | |
> if (pwm == 0 || pwm == 1) | |
> temp = sunxi_pwm_read_reg(0); | |
> else | |
> temp = sunxi_r_pwm_read_reg(0); | |
> | |
> if(pwm == 0 || pwm == 2) { | |
> temp |= 1 << 4; | |
> temp |= 1 << 6; | |
> } else { | |
> temp |= 1 << 19; | |
> temp |= 1 << 21; | |
> } | |
368,378c405,408 | |
< temp = sunxi_pwm_read_reg(0); | |
< | |
< if(pwm == 0) { | |
< temp |= 1 << 4; | |
< temp |= 1 << 6; | |
< } else { | |
< temp |= 1 << 19; | |
< temp |= 1 << 21; | |
< } | |
< | |
< sunxi_pwm_write_reg(0, temp); | |
--- | |
> if (pwm == 0 || pwm == 1) | |
> sunxi_pwm_write_reg(0, temp); | |
> else | |
> sunxi_r_pwm_write_reg(0, temp); | |
385,386c415,416 | |
< temp |= 1 << 4; | |
< temp |= 1 << 6; | |
--- | |
> temp |= 1 << 4; | |
> temp |= 1 << 6; | |
388,389c418,419 | |
< temp |= 1 << 19; | |
< temp |= 1 << 21; | |
--- | |
> temp |= 1 << 19; | |
> temp |= 1 << 21; | |
397c427 | |
< return 0; | |
--- | |
> return 0; | |
402c432 | |
< uint temp; | |
--- | |
> uint temp; | |
406,407c436,437 | |
< int i; | |
< uint ret = 0; | |
--- | |
> int i; | |
> uint ret = 0; | |
409,413c439,443 | |
< for(i = 0; i < pwm_pin_count[pwm]; i++) { | |
< ret = gpio_request(&pwm_gpio_info[pwm][i], 1); | |
< if(ret == 0) { | |
< pwm_debug("pwm gpio request failed!\n"); | |
< } | |
--- | |
> for(i = 0; i < pwm_pin_count[pwm]; i++) { | |
> ret = gpio_request(&pwm_gpio_info[pwm][i], 1); | |
> if(ret == 0) { | |
> pwm_debug("pwm gpio request failed!\n"); | |
> } | |
415,416c445,446 | |
< gpio_release(ret, 2); | |
< } | |
--- | |
> gpio_release(ret, 2); | |
> } | |
418c448 | |
< #endif | |
--- | |
> #endif | |
422c452 | |
< temp = sunxi_pwm_read_reg(pwm * 0x10); | |
--- | |
> temp = sunxi_pwm_read_reg(pwm * 0x10); | |
424,425c454,455 | |
< temp &= ~(1 << 4); | |
< temp &= ~(1 << 6); | |
--- | |
> temp &= ~(1 << 4); | |
> temp &= ~(1 << 6); | |
427c457 | |
< sunxi_pwm_write_reg(pwm * 0x10, temp); | |
--- | |
> sunxi_pwm_write_reg(pwm * 0x10, temp); | |
430,439c460,471 | |
< | |
< temp = sunxi_pwm_read_reg(0); | |
< | |
< if(pwm == 0) { | |
< temp &= ~(1 << 4); | |
< temp &= ~(1 << 6); | |
< } else { | |
< temp &= ~(1 << 19); | |
< temp &= ~(1 << 21); | |
< } | |
--- | |
> if (pwm == 0 || pwm == 1) | |
> temp = sunxi_pwm_read_reg(0); | |
> else | |
> temp = sunxi_r_pwm_read_reg(0); | |
> | |
> if(pwm == 0 || pwm == 2) { | |
> temp &= ~(1 << 4); | |
> temp &= ~(1 << 6); | |
> } else { | |
> temp &= ~(1 << 19); | |
> temp &= ~(1 << 21); | |
> } | |
445,451c477,483 | |
< if(pwm == 0) { | |
< temp &= ~(1 << 4); | |
< temp &= ~(1 << 6); | |
< } else { | |
< temp &= ~(1 << 19); | |
< temp &= ~(1 << 21); | |
< } | |
--- | |
> if(pwm == 0) { | |
> temp &= ~(1 << 4); | |
> temp &= ~(1 << 6); | |
> } else { | |
> temp &= ~(1 << 19); | |
> temp &= ~(1 << 21); | |
> } | |
460c492 | |
< int i; | |
--- | |
> int i; | |
462,463c494,495 | |
< for(i = 0; i < PWM_NUM; i++) | |
< sunxi_pwm_get_sys_config(i); | |
--- | |
> for(i = 0; i < PWM_NUM; i++) | |
> sunxi_pwm_get_sys_config(i); | |
Only in 2/u-boot-2011.09/drivers/video_sunxi/sunxi_v1: obj_video | |
diff -r 1/brandy/u-boot-2011.09/drivers/video_sunxi/sunxi_v2/de_bsp/de/disp_lcd.c 2/u-boot-2011.09/drivers/video_sunxi/sunxi_v2/de_bsp/de/disp_lcd.c | |
744a745,747 | |
> #if defined(CONFIG_ARCH_SUN8IW5P1) && defined(SUPPORT_DCLK_HZ) | |
> lcd_dclk_freq = lcdp->panel_info.lcd_dclk_freq; | |
> #else | |
745a749,750 | |
> #endif | |
> | |
795a801,803 | |
> #if defined(CONFIG_ARCH_SUN8IW5P1) && defined(SUPPORT_DCLK_HZ) | |
> lcd_dclk_freq = lcdp->panel_info.lcd_dclk_freq; | |
> #else | |
796a805,806 | |
> #endif | |
> | |
1504a1515,1517 | |
> #if defined(CONFIG_ARCH_SUN8IW5P1) && defined(SUPPORT_DCLK_HZ) | |
> tt->pixel_clk = lcdp->panel_info.lcd_dclk_freq / 1000; | |
> #else | |
1505a1519 | |
> #endif | |
diff -r 1/brandy/u-boot-2011.09/drivers/video_sunxi/sunxi_v2/de_bsp/de/disp_smart_backlight.c 2/u-boot-2011.09/drivers/video_sunxi/sunxi_v2/de_bsp/de/disp_smart_backlight.c | |
183c183 | |
< disp_notifier_call_chain(DISP_EVENT_BACKLIGHT_DIMMING_UPDATE, smbl->channel_id, (void*)backlight_dimming); | |
--- | |
> //disp_notifier_call_chain(DISP_EVENT_BACKLIGHT_DIMMING_UPDATE, smbl->channel_id, (void*)backlight_dimming); | |
Only in 2/u-boot-2011.09/drivers/video_sunxi/sunxi_v2/de_bsp/lcd/panels: h2009.c | |
Only in 2/u-boot-2011.09/drivers/video_sunxi/sunxi_v2/de_bsp/lcd/panels: h2009.h | |
diff -r 1/brandy/u-boot-2011.09/drivers/video_sunxi/sunxi_v2/de_bsp/lcd/panels/panels.c 2/u-boot-2011.09/drivers/video_sunxi/sunxi_v2/de_bsp/lcd/panels/panels.c | |
6a7,8 | |
> #include "h2009.h" | |
> #include "sc7705.h" | |
9a12,13 | |
> extern __lcd_panel_t h2009_panel; | |
> extern __lcd_panel_t sc7705_panel; | |
11a16,17 | |
> &h2009_panel, | |
> &sc7705_panel, | |
Only in 2/u-boot-2011.09/drivers/video_sunxi/sunxi_v2/de_bsp/lcd/panels: sc7705.c | |
Only in 2/u-boot-2011.09/drivers/video_sunxi/sunxi_v2/de_bsp/lcd/panels: sc7705.h | |
diff -r 1/brandy/u-boot-2011.09/drivers/video_sunxi/sunxi_v2/obj_video 2/u-boot-2011.09/drivers/video_sunxi/sunxi_v2/obj_video | |
58c58 | |
< sunxi_v2/de_bsp/lcd/panels/lp079x01.o sunxi_v2/de_bsp/lcd/panels/B116XAN03.o | |
--- | |
> sunxi_v2/de_bsp/lcd/panels/lp079x01.o sunxi_v2/de_bsp/lcd/panels/B116XAN03.o sunxi_v2/de_bsp/lcd/panels/h2009.o sunxi_v2/de_bsp/lcd/panels/sc7705.o | |
95c95 | |
< endif | |
\ No newline at end of file | |
--- | |
> endif | |
Only in 2/u-boot-2011.09/drivers/video_sunxi/sunxi_v3: obj_video | |
diff -r 1/brandy/u-boot-2011.09/include/common.h 2/u-boot-2011.09/include/common.h | |
622a623 | |
> ulong get_mtimer (ulong base); | |
diff -r 1/brandy/u-boot-2011.09/include/configs/sun8iw5p1.h 2/u-boot-2011.09/include/configs/sun8iw5p1.h | |
64a65 | |
> //#define USE_SW2001 | |
186a188 | |
> #define CONFIG_CMD_SUNXI_AUTO_FEL | |
354a357 | |
> #define SUPPORT_DCLK_HZ | |
diff -r 1/brandy/u-boot-2011.09/usb_sunxi/usb_base_67.c 2/u-boot-2011.09/usb_sunxi/usb_base_67.c | |
49a50,51 | |
> static int sunxi_usb_connected = 0; | |
> | |
168,169c170,171 | |
< sunxi_usb_dbg("IRQ: EP0\n"); | |
< | |
--- | |
> //sunxi_usb_dbg("IRQ: EP0\n"); | |
> puts("IRQ: EP0\n"); | |
171,172c173,177 | |
< //中断内完成ep0处理 | |
< ep0_recv_op(); | |
--- | |
> /* seems ep0_tx_irq still occurs after calling USBC_INT_DisableEp */ | |
> if (!sunxi_usb_connected) { | |
> //中断内完成ep0处理 | |
> ep0_recv_op(); | |
> } | |
185a191,196 | |
> if (!sunxi_usb_connected) { | |
> sunxi_usb_connected = 1; | |
> /* already connected to PC tools, disbale ep0_tx_irq */ | |
> USBC_INT_DisableEp(sunxi_udc_source.usbc_hd, USBC_EP_TYPE_TX, SUNXI_USB_CTRL_EP_INDEX); | |
> } | |
> | |
1387a1399,1400 | |
> int need_exit_usb = 1; | |
> int sprite_keep_usb = 0; | |
1412a1426,1434 | |
> if(uboot_spare_head.boot_data.work_mode == WORK_MODE_USB_PRODUCT) | |
> { | |
> script_parser_fetch("platform", "sprite_keep_usb",&sprite_keep_usb, 1); | |
> if (sprite_keep_usb == 1) { | |
> /* keep usb regs after sprite, then PC tools can detect usb plug out */ | |
> need_exit_usb = 0; | |
> printf("sprite_keep_usb = 1, keep usb regs when exit usb\n"); | |
> } | |
> }; | |
1414c1436,1437 | |
< sunxi_usb_exit(); | |
--- | |
> if(need_exit_usb) | |
> sunxi_usb_exit(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment