summaryrefslogtreecommitdiff
path: root/recipes-kernel
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel')
-rw-r--r--recipes-kernel/linux/linux-at91-4.9/at91pinctrl_reprobe.patch60
-rw-r--r--recipes-kernel/linux/linux-at91_4.9.bb1
2 files changed, 61 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-at91-4.9/at91pinctrl_reprobe.patch b/recipes-kernel/linux/linux-at91-4.9/at91pinctrl_reprobe.patch
new file mode 100644
index 0000000..972404c
--- /dev/null
+++ b/recipes-kernel/linux/linux-at91-4.9/at91pinctrl_reprobe.patch
@@ -0,0 +1,60 @@
+diff -Naru linux-4.9.87.orig/drivers/pinctrl/pinctrl-at91.c linux-4.9.87/drivers/pinctrl/pinctrl-at91.c
+--- linux-4.9.87.orig/drivers/pinctrl/pinctrl-at91.c 2018-12-06 17:41:59.621200529 -0600
++++ linux-4.9.87/drivers/pinctrl/pinctrl-at91.c 2018-12-06 18:06:37.437156779 -0600
+@@ -29,7 +29,7 @@
+
+ #define MAX_GPIO_BANKS 5
+ #define MAX_NB_GPIO_PER_BANK 32
+-
++#define PLATFORM_NAME "at91_pinctrl"
+ struct at91_pinctrl_mux_ops;
+
+ struct at91_gpio_chip {
+@@ -1224,12 +1224,17 @@
+ return 0;
+ }
+
++static struct platform_device *at91_pinctrl_platform_device = NULL;
++
+ static int at91_pinctrl_probe(struct platform_device *pdev)
+ {
+ struct at91_pinctrl *info;
+ struct pinctrl_pin_desc *pdesc;
+ int ret, i, j, k, ngpio_chips_enabled = 0;
+
++ if (!at91_pinctrl_platform_device)
++ at91_pinctrl_platform_device = pdev;
++
+ info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL);
+ if (!info)
+ return -ENOMEM;
+@@ -1833,8 +1838,29 @@
+ &at91_pinctrl_driver,
+ };
+
++static ssize_t do_at91_pinctrl_probe(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count)
++{
++ /* Do Probe */
++ if(at91_pinctrl_platform_device)
++ at91_pinctrl_probe(at91_pinctrl_platform_device);
++ else
++ printk(KERN_ALERT "at91pinctrl_platform_device is undefined!\n");
++ return count;
++}
++
++static struct kobj_attribute at91_pinctrl_attr =
++__ATTR(do_at91_pinctrl_probe, 0200, NULL, do_at91_pinctrl_probe);
++
+ static int __init at91_pinctrl_init(void)
+ {
++ int ret;
++ struct kobject *kobj;
++ kobj = kobject_create_and_add(PLATFORM_NAME, kernel_kobj);
++ if(kobj)
++ {
++ ret = sysfs_create_file(kobj,&at91_pinctrl_attr.attr);
++ } else
++ printk(KERN_ALERT "Could not create platform name %s\n",PLATFORM_NAME);
+ return platform_register_drivers(drivers, ARRAY_SIZE(drivers));
+ }
+ arch_initcall(at91_pinctrl_init);
diff --git a/recipes-kernel/linux/linux-at91_4.9.bb b/recipes-kernel/linux/linux-at91_4.9.bb
index 10e9152..fe728ba 100644
--- a/recipes-kernel/linux/linux-at91_4.9.bb
+++ b/recipes-kernel/linux/linux-at91_4.9.bb
@@ -31,6 +31,7 @@ SRC_URI_append_mtcdt = "\
file://linux-4.9-mtcdt-device-tree.patch \
file://linux-4.9-add-num_accessory_ports-config-option.patch \
file://950-0090-OF-DT-Overlay-configfs-interface.patch \
+ file://at91pinctrl_reprobe.patch \
"
DTB_APPEND_mtcdt = "mtcdt"