Skip to content

Commit

Permalink
[bot] AutoMerging: merge all upstream's changes:
Browse files Browse the repository at this point in the history
* https://github.com/coolsnowwolf/lede:
  rockchip: update rk3399 soc support
  generic: 6.12: fixes broken patches
  • Loading branch information
zesming committed Dec 18, 2024
2 parents b84a86c + af0a4aa commit 31b5774
Show file tree
Hide file tree
Showing 9 changed files with 81 additions and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Signed-off-by: John Crispin <[email protected]>

#include "gpiolib.h"
#include "gpiolib-of.h"
@@ -1187,3 +1189,72 @@ void of_gpiochip_remove(struct gpio_chip
@@ -1187,3 +1189,73 @@ void of_gpiochip_remove(struct gpio_chip
{
of_node_put(dev_of_node(&chip->gpiodev->dev));
}
Expand Down Expand Up @@ -44,17 +44,19 @@ Signed-off-by: John Crispin <[email protected]>
+ of_property_read_string(cnp, "gpio-export,name", &name);
+
+ if (!name)
+ // max_gpio = of_gpio_count(cnp);
+ max_gpio = of_gpio_named_count(cnp, "gpios");
+
+ for (i = 0; i < max_gpio; i++) {
+ struct gpio_desc *desc;
+ unsigned flags = 0;
+ enum of_gpio_flags of_flags;
+
+ gpio = of_get_named_gpio(cnp, i, &of_flags);
+ if (!gpio_is_valid(gpio))
+ return gpio;
+ desc = of_get_named_gpiod_flags(cnp, "gpios", i, &of_flags);
+ if (IS_ERR(desc))
+ return PTR_ERR(desc);
+ gpio = desc_to_gpio(desc);
+
+ if (of_flags == OF_GPIO_ACTIVE_LOW)
+ if (of_flags & OF_GPIO_ACTIVE_LOW)
+ flags |= GPIOF_ACTIVE_LOW;
+
+ if (!of_property_read_u32(cnp, "gpio-export,output", &val))
Expand All @@ -66,7 +68,7 @@ Signed-off-by: John Crispin <[email protected]>
+ continue;
+
+ dmc = of_property_read_bool(cnp, "gpio-export,direction_may_change");
+ gpio_export_with_name(gpio, dmc, name);
+ gpio_export_with_name(gpio_to_desc(gpio), dmc, name);
+ nb++;
+ }
+ }
Expand All @@ -79,7 +81,6 @@ Signed-off-by: John Crispin <[email protected]>
+static struct platform_driver gpio_export_driver = {
+ .driver = {
+ .name = "gpio-export",
+ .owner = THIS_MODULE,
+ .of_match_table = of_match_ptr(gpio_export_ids),
+ },
+ .probe = of_gpio_export_probe,
Expand All @@ -88,22 +89,24 @@ Signed-off-by: John Crispin <[email protected]>
+module_platform_driver(gpio_export_driver);
+
+#endif
\ No newline at end of file
--- a/include/linux/gpio/consumer.h
+++ b/include/linux/gpio/consumer.h
@@ -628,6 +628,7 @@ static inline int devm_acpi_dev_add_driv
@@ -628,7 +628,10 @@ static inline int devm_acpi_dev_add_driv

#if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_GPIO_SYSFS)

+int _gpiod_export(struct gpio_desc *desc, bool direction_may_change, const char *name);
+int __gpiod_export(struct gpio_desc *desc, bool direction_may_change, const char *name);
int gpiod_export(struct gpio_desc *desc, bool direction_may_change);
+int gpio_export_with_name(struct gpio_desc *desc, bool direction_may_change,
+ const char *name);
int gpiod_export_link(struct device *dev, const char *name,
struct gpio_desc *desc);
@@ -637,6 +638,13 @@ void gpiod_unexport(struct gpio_desc *de
void gpiod_unexport(struct gpio_desc *desc);
@@ -637,11 +640,25 @@ void gpiod_unexport(struct gpio_desc *de

#include <asm/errno.h>

+static inline int _gpiod_export(struct gpio_desc *desc,
+static inline int __gpiod_export(struct gpio_desc *desc,
+ bool direction_may_change,
+ const char *name)
+{
Expand All @@ -113,6 +116,18 @@ Signed-off-by: John Crispin <[email protected]>
static inline int gpiod_export(struct gpio_desc *desc,
bool direction_may_change)
{
return -ENOSYS;
}
+
+static inline int gpio_export_with_name(struct gpio_desc *desc,
+ bool direction_may_change,
+ const char *name)
+{
+ return -ENOSYS;
+}

static inline int gpiod_export_link(struct device *dev, const char *name,
struct gpio_desc *desc)
--- a/drivers/gpio/gpiolib-sysfs.c
+++ b/drivers/gpio/gpiolib-sysfs.c
@@ -571,7 +571,7 @@ static struct class gpio_class = {
Expand All @@ -133,7 +148,7 @@ Signed-off-by: John Crispin <[email protected]>

dev = device_create_with_groups(&gpio_class, &gdev->dev,
MKDEV(0, 0), data, gpio_groups,
@@ -650,6 +652,12 @@ err_unlock:
@@ -650,8 +652,21 @@ err_unlock:
gpiod_dbg(desc, "%s: status %d\n", __func__, status);
return status;
}
Expand All @@ -145,4 +160,13 @@ Signed-off-by: John Crispin <[email protected]>
+}
EXPORT_SYMBOL_GPL(gpiod_export);

+int gpio_export_with_name(struct gpio_desc *desc, bool direction_may_change,
+ const char *name)
+{
+ return __gpiod_export(desc, direction_may_change, name);
+}
+EXPORT_SYMBOL_GPL(gpio_export_with_name);
+
static int match_export(struct device *dev, const void *desc)
{
struct gpiod_data *data = dev_get_drvdata(dev);
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
{
if (!nor->params->set_4byte_addr_mode)
nor->params->set_4byte_addr_mode = spi_nor_set_4byte_addr_mode_en4b_ex4b;
+ nor->flags |= SNOR_F_HAS_LOCK;
+ nor->flags |= SNOR_F_HAS_LOCK;

return 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Signed-off-by: Nick Hainke <[email protected]>
{
if (!nor->params->set_4byte_addr_mode)
nor->params->set_4byte_addr_mode = spi_nor_set_4byte_addr_mode_en4b_ex4b;
+ nor->flags &= ~SNOR_F_HAS_16BIT_SR;
nor->flags |= SNOR_F_HAS_LOCK;
+ nor->flags &= ~SNOR_F_HAS_16BIT_SR;
nor->flags |= SNOR_F_HAS_LOCK;

return 0;
2 changes: 1 addition & 1 deletion target/linux/rockchip/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ endef

include $(INCLUDE_DIR)/target.mk

DEFAULT_PACKAGES += uboot-envtools partx-utils e2fsprogs mkf2fs kmod-gpio-button-hotplug \
DEFAULT_PACKAGES += uboot-envtools partx-utils e2fsprogs mkf2fs kmod-button-hotplug \
automount autocore-arm e2fsprogs ethtool haveged htop usb-modeswitch

KERNELNAME:=Image dtbs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <dt-bindings/input/input.h>
#include <dt-bindings/pwm/pwm.h>
#include "rk3399.dtsi"
#include "rk3399-op1-opp.dtsi"
#include "rk3399-opp.dtsi"

/ {
model = "RUMU3F Fine3399";
Expand Down
55 changes: 26 additions & 29 deletions target/linux/rockchip/image/armv8.mk
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ define Device/dilusense_dlfr100
SOC := rk3399
UBOOT_DEVICE_NAME := dlfr100-rk3399
IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-img | gzip | append-metadata
DEVICE_PACKAGES := kmod-r8168 -urngd
DEVICE_PACKAGES := kmod-gpio-button-hotplug kmod-r8168
endef
TARGET_DEVICES += dilusense_dlfr100

Expand Down Expand Up @@ -108,7 +108,7 @@ define Device/fastrhino_common
DEVICE_VENDOR := FastRhino
SOC := rk3568
IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-img | gzip | append-metadata
DEVICE_PACKAGES := kmod-r8125-rss
DEVICE_PACKAGES := kmod-gpio-button-hotplug kmod-r8125-rss
endef

define Device/fastrhino_r66s
Expand Down Expand Up @@ -170,7 +170,7 @@ define Device/friendlyarm_nanopi-r2c
SOC := rk3328
UBOOT_DEVICE_NAME := nanopi-r2c-rk3328
IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-bin | gzip | append-metadata
DEVICE_PACKAGES := kmod-usb-net-rtl8152
DEVICE_PACKAGES := kmod-gpio-button-hotplug kmod-usb-net-rtl8152
endef
TARGET_DEVICES += friendlyarm_nanopi-r2c

Expand All @@ -180,7 +180,7 @@ define Device/friendlyarm_nanopi-r2c-plus
SOC := rk3328
UBOOT_DEVICE_NAME := nanopi-r2c-plus-rk3328
IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-bin | gzip | append-metadata
DEVICE_PACKAGES := kmod-usb-net-rtl8152
DEVICE_PACKAGES := kmod-gpio-button-hotplug kmod-usb-net-rtl8152
endef
TARGET_DEVICES += friendlyarm_nanopi-r2c-plus

Expand All @@ -190,7 +190,7 @@ define Device/friendlyarm_nanopi-r2s
SOC := rk3328
UBOOT_DEVICE_NAME := nanopi-r2s-rk3328
IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-bin | gzip | append-metadata
DEVICE_PACKAGES := kmod-usb-net-rtl8152
DEVICE_PACKAGES := kmod-gpio-button-hotplug kmod-usb-net-rtl8152
endef
TARGET_DEVICES += friendlyarm_nanopi-r2s

Expand All @@ -200,7 +200,7 @@ define Device/friendlyarm_nanopi-r2s-plus
SOC := rk3328
UBOOT_DEVICE_NAME := nanopi-r2s-plus-rk3328
IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-bin | gzip | append-metadata
DEVICE_PACKAGES := kmod-usb-net-rtl8152
DEVICE_PACKAGES := kmod-gpio-button-hotplug kmod-usb-net-rtl8152
endef
TARGET_DEVICES += friendlyarm_nanopi-r2s-plus

Expand All @@ -210,7 +210,7 @@ define Device/friendlyarm_nanopi-r3s
SOC := rk3566
UBOOT_DEVICE_NAME := nanopi-r3s-rk3566
IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-img | gzip | append-metadata
DEVICE_PACKAGES := kmod-r8168
DEVICE_PACKAGES := kmod-gpio-button-hotplug kmod-r8168
endef
TARGET_DEVICES += friendlyarm_nanopi-r3s

Expand All @@ -220,7 +220,7 @@ define Device/friendlyarm_nanopi-r4s
SOC := rk3399
UBOOT_DEVICE_NAME := nanopi-r4s-rk3399
IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-bin | gzip | append-metadata
DEVICE_PACKAGES := kmod-r8168 -urngd
DEVICE_PACKAGES := kmod-gpio-button-hotplug kmod-r8168
endef
TARGET_DEVICES += friendlyarm_nanopi-r4s

Expand All @@ -230,7 +230,7 @@ define Device/friendlyarm_nanopi-r4se
SOC := rk3399
UBOOT_DEVICE_NAME := nanopi-r4se-rk3399
IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-bin | gzip | append-metadata
DEVICE_PACKAGES := kmod-r8168 -urngd
DEVICE_PACKAGES := kmod-gpio-button-hotplug kmod-r8168
endef
TARGET_DEVICES += friendlyarm_nanopi-r4se

Expand All @@ -240,7 +240,7 @@ define Device/friendlyarm_nanopi-r5c
SOC := rk3568
UBOOT_DEVICE_NAME := nanopi-r5c-rk3568
IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-img | gzip | append-metadata
DEVICE_PACKAGES := kmod-r8125-rss
DEVICE_PACKAGES := kmod-gpio-button-hotplug kmod-r8125-rss
endef
TARGET_DEVICES += friendlyarm_nanopi-r5c

Expand All @@ -250,7 +250,7 @@ define Device/friendlyarm_nanopi-r5s
SOC := rk3568
UBOOT_DEVICE_NAME := nanopi-r5s-rk3568
IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-img | gzip | append-metadata
DEVICE_PACKAGES := kmod-r8125-rss
DEVICE_PACKAGES := kmod-gpio-button-hotplug kmod-r8125-rss
endef
TARGET_DEVICES += friendlyarm_nanopi-r5s

Expand All @@ -260,7 +260,7 @@ define Device/friendlyarm_nanopi-r6c
SOC := rk3588s
UBOOT_DEVICE_NAME := nanopi-r6c-rk3588s
IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-img | gzip | append-metadata
DEVICE_PACKAGES := kmod-r8125-rss
DEVICE_PACKAGES := kmod-gpio-button-hotplug kmod-r8125-rss
endef
TARGET_DEVICES += friendlyarm_nanopi-r6c

Expand All @@ -270,7 +270,7 @@ define Device/friendlyarm_nanopi-r6s
SOC := rk3588s
UBOOT_DEVICE_NAME := nanopi-r6s-rk3588s
IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-img | gzip | append-metadata
DEVICE_PACKAGES := kmod-r8125-rss
DEVICE_PACKAGES := kmod-gpio-button-hotplug kmod-r8125-rss
endef
TARGET_DEVICES += friendlyarm_nanopi-r6s

Expand Down Expand Up @@ -349,7 +349,7 @@ define Device/lyt_t68m
SOC := rk3568
UBOOT_DEVICE_NAME := generic-rk3568
IMAGE/sysupgrade.img.gz := boot-common | boot-script vop | pine64-img | gzip | append-metadata
DEVICE_PACKAGES := kmod-drm-rockchip kmod-mt7921e kmod-r8125-rss wpad-openssl uboot-envtools
DEVICE_PACKAGES := kmod-drm-rockchip kmod-gpio-button-hotplug kmod-r8125-rss uboot-envtools
endef
TARGET_DEVICES += lyt_t68m

Expand All @@ -360,7 +360,7 @@ define Device/mmbox_anas3035
DEVICE_DTS := rockchip/rk3568-mmbox-anas3035
UBOOT_DEVICE_NAME := mmbox-anas3035-rk3568
IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-img | gzip | append-metadata
DEVICE_PACKAGES := kmod-r8125-rss kmod-ata-ahci-dwc kmod-hwmon-pwmfan kmod-hwmon-drivetemp
DEVICE_PACKAGES := kmod-ata-ahci-dwc kmod-hwmon-drivetemp kmod-hwmon-pwmfan kmod-r8125-rss
endef
TARGET_DEVICES += mmbox_anas3035

Expand All @@ -380,7 +380,6 @@ define Device/pine64_rockpro64
SOC := rk3399
UBOOT_DEVICE_NAME := rockpro64-rk3399
IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-img | gzip | append-metadata
DEVICE_PACKAGES := -urngd
endef
TARGET_DEVICES += pine64_rockpro64

Expand All @@ -390,7 +389,7 @@ define Device/radxa_e20c
DEVICE_DTS := rockchip/rk3528-radxa-e20c
UBOOT_DEVICE_NAME := evb-rk3528
IMAGE/sysupgrade.img.gz := boot-common | boot-script rk3528 | pine64-img | gzip | append-metadata
DEVICE_PACKAGES := kmod-r8168 -urngd
DEVICE_PACKAGES := kmod-gpio-button-hotplug kmod-r8168 -urngd
endef
TARGET_DEVICES += radxa_e20c

Expand Down Expand Up @@ -424,16 +423,14 @@ define Device/radxa_rock-3c
endef
TARGET_DEVICES += radxa_rock-3c

define Device/radxa_rock-pi-4
define Device/radxa_rock-pi-4a
DEVICE_VENDOR := Radxa
DEVICE_MODEL := ROCK Pi 4
DEVICE_MODEL := ROCK Pi 4A
SOC := rk3399
SUPPORTED_DEVICES := radxa,rockpi4
SUPPORTED_DEVICES := radxa,rockpi4a radxa,rockpi4
UBOOT_DEVICE_NAME := rock-pi-4-rk3399
IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-img | gzip | append-metadata
DEVICE_PACKAGES := -urngd
endef
TARGET_DEVICES += radxa_rock-pi-4
TARGET_DEVICES += radxa_rock-pi-4a

define Device/radxa_rock-5a
DEVICE_VENDOR := Radxa
Expand All @@ -451,7 +448,7 @@ define Device/rongpin_king3399
SOC := rk3399
UBOOT_DEVICE_NAME := king3399-rk3399
IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-img | gzip | append-metadata
DEVICE_PACKAGES := kmod-r8168 -urngd kmod-brcmfmac cypress-firmware-4356-sdio wpad-openssl
DEVICE_PACKAGES := kmod-r8168 kmod-brcmfmac cypress-firmware-4356-sdio wpad-openssl
endef
TARGET_DEVICES += rongpin_king3399

Expand All @@ -461,7 +458,7 @@ define Device/rocktech_mpc1903
SOC := rk3399
UBOOT_DEVICE_NAME := mpc1903-rk3399
IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-img | gzip | append-metadata
DEVICE_PACKAGES := kmod-usb-net-smsc75xx kmod-usb-serial-cp210x -urngd
DEVICE_PACKAGES := kmod-usb-net-smsc75xx kmod-usb-serial-cp210x
endef
TARGET_DEVICES += rocktech_mpc1903

Expand All @@ -471,7 +468,7 @@ define Device/rumu3f_fine-3399
SOC := rk3399
UBOOT_DEVICE_NAME := fine3399-rk3399
IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-img | gzip | append-metadata
DEVICE_PACKAGES := kmod-r8168 -urngd
DEVICE_PACKAGES := kmod-gpio-button-hotplug kmod-r8168
endef
TARGET_DEVICES += rumu3f_fine-3399

Expand All @@ -482,7 +479,7 @@ define Device/scensmart_sv901-eaio
UBOOT_DEVICE_NAME := sv901-eaio-rk3399
IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-bin | gzip | append-metadata
DEVICE_PACKAGES := brcmfmac-nvram-4356-sdio cypress-firmware-4356-sdio kmod-brcmfmac \
kmod-switch-rtl8367b swconfig wpad -urngd
kmod-gpio-button-hotplug kmod-switch-rtl8367b swconfig wpad
endef
TARGET_DEVICES += scensmart_sv901-eaio

Expand Down Expand Up @@ -519,7 +516,7 @@ define Device/sharevdi_h3399pc
SOC := rk3399
UBOOT_DEVICE_NAME := h3399pc-rk3399
IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-img | gzip | append-metadata
DEVICE_PACKAGES := kmod-r8168 -urngd
DEVICE_PACKAGES := kmod-gpio-button-hotplug kmod-r8168
endef
TARGET_DEVICES += sharevdi_h3399pc

Expand All @@ -529,7 +526,7 @@ define Device/sharevdi_guangmiao-g4c
SOC := rk3399
UBOOT_DEVICE_NAME := guangmiao-g4c-rk3399
IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-img | gzip | append-metadata
DEVICE_PACKAGES := kmod-r8168 -urngd
DEVICE_PACKAGES := kmod-gpio-button-hotplug kmod-r8168
endef
TARGET_DEVICES += sharevdi_guangmiao-g4c

Expand Down
Loading

0 comments on commit 31b5774

Please sign in to comment.