From 57116ffcc0e4f9ba1e7bf0a807d0c91403219555 Mon Sep 17 00:00:00 2001 From: wangzijiao Date: Wed, 5 Dec 2018 17:35:03 +0800 Subject: [PATCH] add 3.06 led module, fix netease config in driver --- lichee/linux-4.9/drivers/leds/Kconfig | 8 ++++++++ lichee/linux-4.9/drivers/leds/Makefile | 1 + lichee/linux-4.9/drivers/leds/led-core.c | 1 + .../drivers/misc/xunfei/cpld/cx20810.c | 4 ++++ .../include/linux/dma/sunxi/dma-sun50iw8.h | 3 ++- .../include/linux/dma/sunxi/dma-sun8iw15.h | 2 +- package/netease/submodules | 2 +- target/allwinner/mandolin-pv1c/config-4.9 | 19 ++++++++++++++++++- .../mandolin-pv1c/configs/sys_config.fex | 16 +++++++++++++--- 9 files changed, 49 insertions(+), 7 deletions(-) diff --git a/lichee/linux-4.9/drivers/leds/Kconfig b/lichee/linux-4.9/drivers/leds/Kconfig index 3fdaae3d3..abe1fd722 100755 --- a/lichee/linux-4.9/drivers/leds/Kconfig +++ b/lichee/linux-4.9/drivers/leds/Kconfig @@ -666,6 +666,14 @@ config LEDS_MLXCPLD This option enabled support for the LEDs on the Mellanox boards. Say Y to enabled these. +config LEDS_SUNXI + tristate "LED support for Allwinner platforms" + depends on ARCH_SUNXI + depends on LEDS_CLASS + help + This option enabled support for the LEDs on the Allwinner + platforms. Say Y to enabled these. + comment "LED Triggers" source "drivers/leds/trigger/Kconfig" diff --git a/lichee/linux-4.9/drivers/leds/Makefile b/lichee/linux-4.9/drivers/leds/Makefile index e893921ed..e3e392de3 100755 --- a/lichee/linux-4.9/drivers/leds/Makefile +++ b/lichee/linux-4.9/drivers/leds/Makefile @@ -71,6 +71,7 @@ obj-$(CONFIG_LEDS_IS31FL319X) += leds-is31fl319x.o obj-$(CONFIG_LEDS_IS31FL32XX) += leds-is31fl32xx.o obj-$(CONFIG_LEDS_PM8058) += leds-pm8058.o obj-$(CONFIG_LEDS_MLXCPLD) += leds-mlxcpld.o +obj-$(CONFIG_LEDS_SUNXI) += leds-sunxi.o #for AW2016 LED Driver obj-$(CONFIG_LEDS_AW2016) += leds-aw2016.o diff --git a/lichee/linux-4.9/drivers/leds/led-core.c b/lichee/linux-4.9/drivers/leds/led-core.c index 3bce44893..454ed4dc6 100644 --- a/lichee/linux-4.9/drivers/leds/led-core.c +++ b/lichee/linux-4.9/drivers/leds/led-core.c @@ -188,6 +188,7 @@ void led_blink_set(struct led_classdev *led_cdev, { del_timer_sync(&led_cdev->blink_timer); + led_cdev->flags &= ~LED_BLINK_SW; led_cdev->flags &= ~LED_BLINK_ONESHOT; led_cdev->flags &= ~LED_BLINK_ONESHOT_STOP; diff --git a/lichee/linux-4.9/drivers/misc/xunfei/cpld/cx20810.c b/lichee/linux-4.9/drivers/misc/xunfei/cpld/cx20810.c index 93f0a2696..5c9db8123 100755 --- a/lichee/linux-4.9/drivers/misc/xunfei/cpld/cx20810.c +++ b/lichee/linux-4.9/drivers/misc/xunfei/cpld/cx20810.c @@ -269,6 +269,7 @@ static int __init cpld_r311_probe(struct platform_device *pdev) { } + gpionum = -1; gpionum = of_get_named_gpio_flags(np, "4v5_ldo_en", 0, (enum of_gpio_flags *)&cfg); if (gpio_is_valid(gpionum)) { @@ -279,16 +280,19 @@ static int __init cpld_r311_probe(struct platform_device *pdev) { printk("Set 4v5_ldo_en fail\n"); } + gpionum = -1; gpionum = of_get_named_gpio_flags(np, "3v_ldo_en", 0, (enum of_gpio_flags *)&cfg); if (gpio_is_valid(gpionum)) { gpio_request(gpionum, "3v_ldo_en"); gpio_direction_output(gpionum, 1); + gpio_free(gpionum); printk("Set 3v_ldo_en(%d) success\n", gpionum); } else { printk("Set 3v_ldo_en fail\n"); } + gpionum = -1; gpionum = of_get_named_gpio_flags(np, "gp_adc_rst", 0, (enum of_gpio_flags *)&cfg); gpio_adc_rst = gpionum; diff --git a/lichee/linux-4.9/include/linux/dma/sunxi/dma-sun50iw8.h b/lichee/linux-4.9/include/linux/dma/sunxi/dma-sun50iw8.h index 85a04fff7..eee6fa9aa 100644 --- a/lichee/linux-4.9/include/linux/dma/sunxi/dma-sun50iw8.h +++ b/lichee/linux-4.9/include/linux/dma/sunxi/dma-sun50iw8.h @@ -91,6 +91,7 @@ #define DRQDST_OTG_EP3 32 #define DRQDST_OTG_EP4 33 #define DRQDST_OTG_EP5 34 - +#define DRQSRC_MAD_TX 44 +#define DRQDST_LEDC 45 #endif /*__DMA_SUN50IW8__ */ diff --git a/lichee/linux-4.9/include/linux/dma/sunxi/dma-sun8iw15.h b/lichee/linux-4.9/include/linux/dma/sunxi/dma-sun8iw15.h index ce315a869..a85a2634f 100644 --- a/lichee/linux-4.9/include/linux/dma/sunxi/dma-sun8iw15.h +++ b/lichee/linux-4.9/include/linux/dma/sunxi/dma-sun8iw15.h @@ -91,6 +91,6 @@ #define DRQDST_OTG_EP3 32 #define DRQDST_OTG_EP4 33 #define DRQDST_OTG_EP5 34 - +#define DRQDST_LEDC 45 #endif /*__DMA_SUN8IW15__ */ diff --git a/package/netease/submodules b/package/netease/submodules index 765523be4..d2c397aa2 160000 --- a/package/netease/submodules +++ b/package/netease/submodules @@ -1 +1 @@ -Subproject commit 765523be4e352b63d58e07b964a6c4bac42f2512 +Subproject commit d2c397aa21c5fccf9a621f893ca8441c450e893b diff --git a/target/allwinner/mandolin-pv1c/config-4.9 b/target/allwinner/mandolin-pv1c/config-4.9 index 6721ce823..0b608c97a 100644 --- a/target/allwinner/mandolin-pv1c/config-4.9 +++ b/target/allwinner/mandolin-pv1c/config-4.9 @@ -101,6 +101,7 @@ CONFIG_BT_HCIUART=y CONFIG_BT_HCIUART_BCM=y # CONFIG_BT_HCIUART_INTEL is not set # CONFIG_BT_HCIUART_MRVL is not set +# CONFIG_BT_LEDS is not set # CONFIG_BT_RTKBTUSB is not set # CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE is not set CONFIG_BUILD_BIN2C=y @@ -420,6 +421,7 @@ CONFIG_HID=y # CONFIG_HID_ALPS is not set # CONFIG_HID_CMEDIA is not set CONFIG_HID_GENERIC=y +# CONFIG_HID_LED is not set CONFIG_HIGHMEM=y CONFIG_HIGHPTE=y # CONFIG_HISI_FEMAC is not set @@ -524,6 +526,18 @@ CONFIG_KEYBOARD_NETEASE_PV1_CES=y # CONFIG_KEYBOARD_SUN4I_LRADC is not set CONFIG_KEYBOARD_SUNXI=y # CONFIG_KS7010 is not set +# CONFIG_LEDS_AAT1290 is not set +# CONFIG_LEDS_AW2016 is not set +CONFIG_LEDS_CLASS_FLASH=y +# CONFIG_LEDS_IS31FL319X is not set +# CONFIG_LEDS_IS31FL32XX is not set +# CONFIG_LEDS_KTD2692 is not set +# CONFIG_LEDS_SUNXI is not set +CONFIG_LEDS_TRIGGER_BACKLIGHT=y +CONFIG_LEDS_TRIGGER_GPIO=y +CONFIG_LEDS_TRIGGER_HEARTBEAT=y +CONFIG_LEDS_TRIGGER_ONESHOT=y +# CONFIG_LEDS_TRIGGER_PANIC is not set CONFIG_LIBFDT=y # CONFIG_LNET is not set CONFIG_LOCK_SPIN_ON_OWNER=y @@ -535,6 +549,7 @@ CONFIG_MAC80211_DEBUGFS=y # CONFIG_MAC80211_DEBUG_MENU is not set CONFIG_MAC80211_HAS_RC=y # CONFIG_MAC80211_HWSIM is not set +# CONFIG_MAC80211_LEDS is not set # CONFIG_MAC80211_MESH is not set CONFIG_MAC80211_RC_DEFAULT="minstrel_ht" CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y @@ -605,7 +620,6 @@ CONFIG_NET_KEY=y CONFIG_NET_VENDOR_ALLWINNER=y CONFIG_NET_VENDOR_AMAZON=y CONFIG_NET_VENDOR_NETRONOME=y -# CONFIG_NEW_LEDS is not set CONFIG_NF_CONNTRACK=y CONFIG_NF_CONNTRACK_EVENTS=y CONFIG_NF_CONNTRACK_IPV4=y @@ -729,6 +743,7 @@ CONFIG_REGULATOR=y CONFIG_RFKILL=y # CONFIG_RFKILL_GPIO is not set CONFIG_RFKILL_INPUT=y +CONFIG_RFKILL_LEDS=y CONFIG_RFKILL_PM=y CONFIG_RFKILL_REGULATOR=y CONFIG_RFS_ACCEL=y @@ -942,6 +957,7 @@ CONFIG_USB_F_PTP=y CONFIG_USB_GADGET=y CONFIG_USB_HID=y # CONFIG_USB_HSIC_USB4604 is not set +# CONFIG_USB_LEDS_TRIGGER_USBPORT is not set CONFIG_USB_LIBCOMPOSITE=y CONFIG_USB_OHCI_HCD=y # CONFIG_USB_OHCI_HCD_PLATFORM is not set @@ -975,6 +991,7 @@ CONFIG_USB_SUPPORT=y CONFIG_USB_UAS=y # CONFIG_USERIO is not set CONFIG_USE_OF=y +# CONFIG_V4L2_FLASH_LED_CLASS is not set CONFIG_V4L_PLATFORM_DRIVERS=y # CONFIG_VDPO_DISP2_SUNXI is not set CONFIG_VDSO=y diff --git a/target/allwinner/mandolin-pv1c/configs/sys_config.fex b/target/allwinner/mandolin-pv1c/configs/sys_config.fex index 30c3cf1e3..9fff1b2a7 100755 --- a/target/allwinner/mandolin-pv1c/configs/sys_config.fex +++ b/target/allwinner/mandolin-pv1c/configs/sys_config.fex @@ -1680,7 +1680,7 @@ lv4_volt = 900 ; ;---------------------------------------------------------------------------------- [leds] -leds_used = 1 +leds_used = 0 leds_name = "aw2016_led" leds_twi_id = 1 @@ -1695,6 +1695,17 @@ hold-time-ms = 0 fall-time-ms = 6 off-time-ms = 4 +[led_para] +compatible = "allwinner,sunxi-leds" +led_used = 1 +led_count = 3 +led1 = port:PL3<1> +led1_trigger = "none" +led2 = port:PL2<1> +led2_trigger = "none" +led3 = port:PH5<1> +led3_trigger = "none" + ;-------------------------------------------------------------------------------- ;digital amplifier control ;-------------------------------------------------------------------------------- @@ -1730,5 +1741,4 @@ compatible = "allwinner,cpld-r311-pv1" gp_adc_rst = port:PD21<1><1><1> gp_cpld_rst = port:PL10<1><1><1> 4v5_ldo_en = port:PH04<1><0> -3v_ldo_en = port:PH05<1><0> -netease_io_regulator = "netease-io" \ No newline at end of file +netease_io_regulator = "netease-io"