[openwrt/openwrt] pistachio: update and extend 6.1 patches
LEDE Commits
lede-commits at lists.infradead.org
Fri Apr 5 06:39:09 PDT 2024
wigyori pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/47dee7be559e095724d45de188610352da14052a
commit 47dee7be559e095724d45de188610352da14052a
Author: Zoltan HERPAI <wigyori at uid0.hu>
AuthorDate: Tue Mar 19 23:28:53 2024 +0100
pistachio: update and extend 6.1 patches
Add:
110-pwm-img-fix-clock-lookup.patch
- patch to fix a clock lookup issue from upstream
Update:
401-mtd-nor-support-mtd-name-from-device-tree.patch
- mtd-name lookup hack to reflect the updated spi_nor_scan function
Signed-off-by: Zoltan HERPAI <wigyori at uid0.hu>
---
.../patches-6.1/110-pwm-img-fix-clock-lookup.patch | 39 ++++++++++++++++++++++
...mtd-nor-support-mtd-name-from-device-tree.patch | 21 ++++++------
2 files changed, 49 insertions(+), 11 deletions(-)
diff --git a/target/linux/pistachio/patches-6.1/110-pwm-img-fix-clock-lookup.patch b/target/linux/pistachio/patches-6.1/110-pwm-img-fix-clock-lookup.patch
new file mode 100644
index 0000000000..d77a2f4259
--- /dev/null
+++ b/target/linux/pistachio/patches-6.1/110-pwm-img-fix-clock-lookup.patch
@@ -0,0 +1,39 @@
+From 58d03770ac5f78ff2d819caabea9371a041bf7be Mon Sep 17 00:00:00 2001
+From: Zoltan HERPAI <wigyori at uid0.hu>
+Date: Wed, 20 Mar 2024 09:36:02 +0100
+Subject: pwm: img: fix pwm clock lookup
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+22e8e19 has introduced a regression in the imgchip->pwm_clk lookup, whereas
+the clock name has also been renamed to "imgchip". This causes the driver
+failing to load:
+
+[ 0.546905] img-pwm 18101300.pwm: failed to get imgchip clock
+[ 0.553418] img-pwm: probe of 18101300.pwm failed with error -2
+
+Fix this lookup by reverting the clock name back to "pwm".
+
+Signed-off-by: Zoltan HERPAI <wigyori at uid0.hu>
+Link: https://lore.kernel.org/r/20240320083602.81592-1-wigyori@uid0.hu
+Fixes: 22e8e19a46f7 ("pwm: img: Rename variable pointing to driver private data")
+Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
+---
+ drivers/pwm/pwm-img.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/pwm/pwm-img.c
++++ b/drivers/pwm/pwm-img.c
+@@ -289,9 +289,9 @@ static int img_pwm_probe(struct platform
+ return PTR_ERR(imgchip->sys_clk);
+ }
+
+- imgchip->pwm_clk = devm_clk_get(&pdev->dev, "imgchip");
++ imgchip->pwm_clk = devm_clk_get(&pdev->dev, "pwm");
+ if (IS_ERR(imgchip->pwm_clk)) {
+- dev_err(&pdev->dev, "failed to get imgchip clock\n");
++ dev_err(&pdev->dev, "failed to get pwm clock\n");
+ return PTR_ERR(imgchip->pwm_clk);
+ }
+
diff --git a/target/linux/pistachio/patches-6.1/401-mtd-nor-support-mtd-name-from-device-tree.patch b/target/linux/pistachio/patches-6.1/401-mtd-nor-support-mtd-name-from-device-tree.patch
index 36f5331bd0..b30f79b773 100644
--- a/target/linux/pistachio/patches-6.1/401-mtd-nor-support-mtd-name-from-device-tree.patch
+++ b/target/linux/pistachio/patches-6.1/401-mtd-nor-support-mtd-name-from-device-tree.patch
@@ -10,19 +10,18 @@ Signed-off-by: Abhimanyu Vishwakarma <Abhimanyu.Vishwakarma at imgtec.com>
--- a/drivers/mtd/spi-nor/core.c
+++ b/drivers/mtd/spi-nor/core.c
-@@ -3108,6 +3108,7 @@ int spi_nor_scan(struct spi_nor *nor, co
- struct device *dev = nor->dev;
+@@ -2942,12 +2942,20 @@ static void spi_nor_set_mtd_info(struct
+ {
struct mtd_info *mtd = &nor->mtd;
- struct device_node *np = spi_nor_get_flash_node(nor);
+ struct device *dev = nor->dev;
++ struct device_node *np = spi_nor_get_flash_node(nor);
+ const char __maybe_unused *of_mtd_name = NULL;
- int ret;
- int i;
-@@ -3162,7 +3163,12 @@ int spi_nor_scan(struct spi_nor *nor, co
- if (ret)
- return ret;
+ spi_nor_set_mtd_locking_ops(nor);
+ spi_nor_set_mtd_otp_ops(nor);
-- if (!mtd->name)
+ mtd->dev.parent = dev;
+ if (!mtd->name)
+#ifdef CONFIG_MTD_OF_PARTS
+ of_property_read_string(np, "linux,mtd-name", &of_mtd_name);
+#endif
@@ -30,11 +29,11 @@ Signed-off-by: Abhimanyu Vishwakarma <Abhimanyu.Vishwakarma at imgtec.com>
+ mtd->name = of_mtd_name;
+ else if (!mtd->name)
mtd->name = dev_name(dev);
- mtd->priv = nor;
mtd->type = MTD_NORFLASH;
+ mtd->flags = MTD_CAP_NORFLASH;
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
-@@ -870,6 +870,17 @@ out_error:
+@@ -863,6 +863,17 @@ out_error:
*/
static void mtd_set_dev_defaults(struct mtd_info *mtd)
{
More information about the lede-commits
mailing list