* [gpio:for-next] BUILD SUCCESS 70d7cd6c82a906bfc45e5043fed5456d46a92662
From: kernel test robot @ 2020-07-18 2:05 UTC (permalink / raw)
To: Linus Walleij; +Cc: linux-gpio
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git for-next
branch HEAD: 70d7cd6c82a906bfc45e5043fed5456d46a92662 Merge branch 'devel' into for-next
elapsed time: 722m
configs tested: 86
configs skipped: 2
The following configs have been built successfully.
More configs may be tested in the coming days.
arm defconfig
arm allyesconfig
arm allmodconfig
arm allnoconfig
arm64 allyesconfig
arm64 defconfig
arm64 allmodconfig
arm64 allnoconfig
nds32 allnoconfig
powerpc ppc64e_defconfig
arm viper_defconfig
ia64 alldefconfig
sh se7721_defconfig
ia64 tiger_defconfig
mips jmr3927_defconfig
arm xcep_defconfig
h8300 allyesconfig
powerpc linkstation_defconfig
sparc sparc32_defconfig
arm badge4_defconfig
powerpc pmac32_defconfig
riscv rv32_defconfig
i386 allyesconfig
i386 defconfig
i386 debian-10.3
i386 allnoconfig
ia64 allmodconfig
ia64 defconfig
ia64 allnoconfig
ia64 allyesconfig
m68k allmodconfig
m68k allnoconfig
m68k sun3_defconfig
m68k defconfig
m68k allyesconfig
nios2 defconfig
nios2 allyesconfig
openrisc defconfig
c6x allyesconfig
c6x allnoconfig
openrisc allyesconfig
nds32 defconfig
csky allyesconfig
csky defconfig
alpha defconfig
alpha allyesconfig
xtensa allyesconfig
h8300 allmodconfig
xtensa defconfig
arc defconfig
arc allyesconfig
sh allmodconfig
sh allnoconfig
microblaze allnoconfig
mips allyesconfig
mips allnoconfig
mips allmodconfig
parisc allnoconfig
parisc defconfig
parisc allyesconfig
parisc allmodconfig
powerpc defconfig
powerpc allyesconfig
powerpc rhel-kconfig
powerpc allmodconfig
powerpc allnoconfig
riscv allyesconfig
riscv allnoconfig
riscv defconfig
riscv allmodconfig
s390 allyesconfig
s390 allnoconfig
s390 allmodconfig
s390 defconfig
sparc allyesconfig
sparc defconfig
sparc64 defconfig
sparc64 allnoconfig
sparc64 allyesconfig
sparc64 allmodconfig
x86_64 rhel-7.6-kselftests
x86_64 rhel-8.3
x86_64 kexec
x86_64 rhel
x86_64 lkp
x86_64 fedora-25
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
^ permalink raw reply
* [gpio:devel] BUILD SUCCESS 80606cb24161d504acb4d89f406d68f72196575e
From: kernel test robot @ 2020-07-18 2:05 UTC (permalink / raw)
To: Linus Walleij; +Cc: linux-gpio
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git devel
branch HEAD: 80606cb24161d504acb4d89f406d68f72196575e gpio: max77620: Use helper variable and clarify
elapsed time: 722m
configs tested: 86
configs skipped: 2
The following configs have been built successfully.
More configs may be tested in the coming days.
arm defconfig
arm allyesconfig
arm allmodconfig
arm allnoconfig
arm64 allyesconfig
arm64 defconfig
arm64 allmodconfig
arm64 allnoconfig
nds32 allnoconfig
powerpc ppc64e_defconfig
arm viper_defconfig
ia64 alldefconfig
sh se7721_defconfig
ia64 tiger_defconfig
mips jmr3927_defconfig
arm xcep_defconfig
h8300 allyesconfig
powerpc linkstation_defconfig
sparc sparc32_defconfig
arm badge4_defconfig
powerpc pmac32_defconfig
riscv rv32_defconfig
i386 allyesconfig
i386 defconfig
i386 debian-10.3
i386 allnoconfig
ia64 allmodconfig
ia64 defconfig
ia64 allnoconfig
ia64 allyesconfig
m68k allmodconfig
m68k allnoconfig
m68k sun3_defconfig
m68k defconfig
m68k allyesconfig
nios2 defconfig
nios2 allyesconfig
openrisc defconfig
c6x allyesconfig
c6x allnoconfig
openrisc allyesconfig
nds32 defconfig
csky allyesconfig
csky defconfig
alpha defconfig
alpha allyesconfig
xtensa allyesconfig
h8300 allmodconfig
xtensa defconfig
arc defconfig
arc allyesconfig
sh allmodconfig
sh allnoconfig
microblaze allnoconfig
mips allyesconfig
mips allnoconfig
mips allmodconfig
parisc allnoconfig
parisc defconfig
parisc allyesconfig
parisc allmodconfig
powerpc defconfig
powerpc allyesconfig
powerpc rhel-kconfig
powerpc allmodconfig
powerpc allnoconfig
riscv allyesconfig
riscv allnoconfig
riscv defconfig
riscv allmodconfig
s390 allyesconfig
s390 allnoconfig
s390 allmodconfig
s390 defconfig
sparc allyesconfig
sparc defconfig
sparc64 defconfig
sparc64 allnoconfig
sparc64 allyesconfig
sparc64 allmodconfig
x86_64 rhel-7.6-kselftests
x86_64 rhel-8.3
x86_64 kexec
x86_64 rhel
x86_64 lkp
x86_64 fedora-25
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
^ permalink raw reply
* [gpio:gpio-descriptors-usb] BUILD SUCCESS b84efced84146e09ba546dcbbdf57cc9370f781c
From: kernel test robot @ 2020-07-18 2:05 UTC (permalink / raw)
To: Linus Walleij; +Cc: linux-gpio
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git gpio-descriptors-usb
branch HEAD: b84efced84146e09ba546dcbbdf57cc9370f781c usb: ohci-omap: Convert to use GPIO descriptors
elapsed time: 722m
configs tested: 86
configs skipped: 2
The following configs have been built successfully.
More configs may be tested in the coming days.
arm defconfig
arm allyesconfig
arm allmodconfig
arm allnoconfig
arm64 allyesconfig
arm64 defconfig
arm64 allmodconfig
arm64 allnoconfig
nds32 allnoconfig
powerpc ppc64e_defconfig
arm viper_defconfig
ia64 alldefconfig
sh se7721_defconfig
ia64 tiger_defconfig
mips jmr3927_defconfig
arm xcep_defconfig
h8300 allyesconfig
powerpc linkstation_defconfig
sparc sparc32_defconfig
arm badge4_defconfig
powerpc pmac32_defconfig
riscv rv32_defconfig
i386 allyesconfig
i386 defconfig
i386 debian-10.3
i386 allnoconfig
ia64 allmodconfig
ia64 defconfig
ia64 allnoconfig
ia64 allyesconfig
m68k allmodconfig
m68k allnoconfig
m68k sun3_defconfig
m68k defconfig
m68k allyesconfig
nios2 defconfig
nios2 allyesconfig
openrisc defconfig
c6x allyesconfig
c6x allnoconfig
openrisc allyesconfig
nds32 defconfig
csky allyesconfig
csky defconfig
alpha defconfig
alpha allyesconfig
xtensa allyesconfig
h8300 allmodconfig
xtensa defconfig
arc defconfig
arc allyesconfig
sh allmodconfig
sh allnoconfig
microblaze allnoconfig
mips allyesconfig
mips allnoconfig
mips allmodconfig
parisc allnoconfig
parisc defconfig
parisc allyesconfig
parisc allmodconfig
powerpc defconfig
powerpc allyesconfig
powerpc rhel-kconfig
powerpc allmodconfig
powerpc allnoconfig
riscv allyesconfig
riscv allnoconfig
riscv defconfig
riscv allmodconfig
s390 allyesconfig
s390 allnoconfig
s390 allmodconfig
s390 defconfig
sparc allyesconfig
sparc defconfig
sparc64 defconfig
sparc64 allnoconfig
sparc64 allyesconfig
sparc64 allmodconfig
x86_64 rhel-7.6-kselftests
x86_64 rhel-8.3
x86_64 kexec
x86_64 rhel
x86_64 lkp
x86_64 fedora-25
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
^ permalink raw reply
* Re: gpiolib gpio_chrdev_release duration is about 30 ms
From: Kent Gibson @ 2020-07-18 4:25 UTC (permalink / raw)
To: Maxim Kochetkov
Cc: Linus Walleij, open list:GPIO SUBSYSTEM, Bartosz Golaszewski,
Andy Shevchenko
In-Reply-To: <CAHp75VfQdTtbiHjhBuf3czdKAgmiQeALo7CaqW36oEkSGSHUBA@mail.gmail.com>
On Fri, Jul 17, 2020 at 06:07:04PM +0300, Andy Shevchenko wrote:
> On Fri, Jul 17, 2020 at 5:17 PM Maxim Kochetkov <fido_max@inbox.ru> wrote:
> >
> > I need a small userspace program to do some GPIO magic to communicate
> > other hardware like devmem. This program takes about 2,5 seconds just to
> > find GPIO lines by name.
> >
> > replacing synchronize_rcu to synchronize_rcu_expedited in
> > atomic_notifier_chain_unregister gives the same boost as removing
> > synchronize_rcu
>
> Have you tried to replace an atomic notifier call with a regular one?
> IIRC it's still not clear why atomic is used there.
>
Indeed, I recently submitted a patch to switch the
atomic_notifier_call_chain to blocking_notifier_call_chain, as some of
the chained calls can sleep.
Not sure if that is related, or if the change would make this case better
or worse, but it would be interesting to find out.
The patch is in the current gpio/devel, btw.
Cheers,
Kent.
^ permalink raw reply
* [pinctrl:for-next] BUILD SUCCESS 8d93caaf4f6b7de4a1df082aec932c959ce0b63c
From: kernel test robot @ 2020-07-18 5:03 UTC (permalink / raw)
To: Linus Walleij; +Cc: linux-gpio
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git for-next
branch HEAD: 8d93caaf4f6b7de4a1df082aec932c959ce0b63c Merge branch 'devel' into for-next
elapsed time: 834m
configs tested: 107
configs skipped: 1
The following configs have been built successfully.
More configs may be tested in the coming days.
arm64 allyesconfig
arm64 defconfig
arm64 allmodconfig
arm64 allnoconfig
arm defconfig
arm allyesconfig
arm allmodconfig
arm allnoconfig
powerpc ppc64e_defconfig
arm viper_defconfig
ia64 alldefconfig
sh se7721_defconfig
h8300 allyesconfig
powerpc linkstation_defconfig
sparc sparc32_defconfig
arm badge4_defconfig
powerpc pmac32_defconfig
riscv rv32_defconfig
i386 allyesconfig
i386 defconfig
i386 debian-10.3
i386 allnoconfig
ia64 allmodconfig
ia64 defconfig
ia64 allnoconfig
ia64 allyesconfig
m68k allmodconfig
m68k allnoconfig
m68k sun3_defconfig
m68k defconfig
m68k allyesconfig
nds32 defconfig
nds32 allnoconfig
csky allyesconfig
csky defconfig
alpha defconfig
alpha allyesconfig
xtensa allyesconfig
h8300 allmodconfig
xtensa defconfig
arc defconfig
arc allyesconfig
sh allmodconfig
sh allnoconfig
microblaze allnoconfig
nios2 defconfig
nios2 allyesconfig
openrisc defconfig
c6x allyesconfig
c6x allnoconfig
openrisc allyesconfig
mips allyesconfig
mips allnoconfig
mips allmodconfig
parisc allnoconfig
parisc defconfig
parisc allyesconfig
parisc allmodconfig
powerpc defconfig
powerpc allyesconfig
powerpc rhel-kconfig
powerpc allmodconfig
powerpc allnoconfig
i386 randconfig-a001-20200717
i386 randconfig-a005-20200717
i386 randconfig-a002-20200717
i386 randconfig-a006-20200717
i386 randconfig-a003-20200717
i386 randconfig-a004-20200717
x86_64 randconfig-a012-20200716
x86_64 randconfig-a011-20200716
x86_64 randconfig-a016-20200716
x86_64 randconfig-a014-20200716
x86_64 randconfig-a013-20200716
x86_64 randconfig-a015-20200716
i386 randconfig-a016-20200717
i386 randconfig-a011-20200717
i386 randconfig-a015-20200717
i386 randconfig-a012-20200717
i386 randconfig-a013-20200717
i386 randconfig-a014-20200717
x86_64 randconfig-a005-20200717
x86_64 randconfig-a006-20200717
x86_64 randconfig-a002-20200717
x86_64 randconfig-a001-20200717
x86_64 randconfig-a003-20200717
x86_64 randconfig-a004-20200717
riscv allyesconfig
riscv allnoconfig
riscv defconfig
riscv allmodconfig
s390 allyesconfig
s390 allnoconfig
s390 allmodconfig
s390 defconfig
sparc allyesconfig
sparc defconfig
sparc64 defconfig
sparc64 allnoconfig
sparc64 allyesconfig
sparc64 allmodconfig
x86_64 rhel-7.6-kselftests
x86_64 rhel-8.3
x86_64 kexec
x86_64 rhel
x86_64 lkp
x86_64 fedora-25
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
^ permalink raw reply
* [pinctrl:devel] BUILD SUCCESS bf3d3999084aac96d60597b2745d81081642a2f7
From: kernel test robot @ 2020-07-18 10:20 UTC (permalink / raw)
To: Linus Walleij; +Cc: linux-gpio
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git devel
branch HEAD: bf3d3999084aac96d60597b2745d81081642a2f7 pinctrl: lpc18xx: Use fallthrough pseudo-keyword
elapsed time: 1151m
configs tested: 92
configs skipped: 1
The following configs have been built successfully.
More configs may be tested in the coming days.
arm defconfig
arm allyesconfig
arm allmodconfig
arm allnoconfig
arm64 allyesconfig
arm64 defconfig
arm64 allmodconfig
arm64 allnoconfig
arm corgi_defconfig
sh edosk7760_defconfig
mips omega2p_defconfig
powerpc storcenter_defconfig
arm tegra_defconfig
sh hp6xx_defconfig
i386 allyesconfig
i386 defconfig
i386 debian-10.3
i386 allnoconfig
ia64 allmodconfig
ia64 defconfig
ia64 allnoconfig
ia64 allyesconfig
m68k allmodconfig
m68k allnoconfig
m68k sun3_defconfig
m68k defconfig
m68k allyesconfig
nds32 defconfig
nds32 allnoconfig
csky allyesconfig
csky defconfig
alpha defconfig
alpha allyesconfig
xtensa allyesconfig
h8300 allyesconfig
h8300 allmodconfig
xtensa defconfig
arc defconfig
arc allyesconfig
sh allmodconfig
sh allnoconfig
microblaze allnoconfig
nios2 defconfig
nios2 allyesconfig
openrisc defconfig
c6x allyesconfig
c6x allnoconfig
openrisc allyesconfig
mips allyesconfig
mips allnoconfig
mips allmodconfig
parisc allnoconfig
parisc defconfig
parisc allyesconfig
parisc allmodconfig
powerpc defconfig
powerpc allyesconfig
powerpc rhel-kconfig
powerpc allmodconfig
powerpc allnoconfig
x86_64 randconfig-a005-20200717
x86_64 randconfig-a006-20200717
x86_64 randconfig-a002-20200717
x86_64 randconfig-a001-20200717
x86_64 randconfig-a003-20200717
x86_64 randconfig-a004-20200717
i386 randconfig-a016-20200717
i386 randconfig-a011-20200717
i386 randconfig-a015-20200717
i386 randconfig-a012-20200717
i386 randconfig-a013-20200717
i386 randconfig-a014-20200717
riscv allyesconfig
riscv allnoconfig
riscv defconfig
riscv allmodconfig
s390 allyesconfig
s390 allnoconfig
s390 allmodconfig
s390 defconfig
sparc allyesconfig
sparc defconfig
sparc64 defconfig
sparc64 allnoconfig
sparc64 allyesconfig
sparc64 allmodconfig
x86_64 rhel
x86_64 lkp
x86_64 fedora-25
x86_64 rhel-7.6-kselftests
x86_64 rhel-8.3
x86_64 kexec
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
^ permalink raw reply
* [PATCH] pinctrl: samsung: Replace HTTP links with HTTPS ones
From: Alexander A. Klimov @ 2020-07-18 10:47 UTC (permalink / raw)
To: tomasz.figa, krzk, s.nawrocki, linus.walleij, kgene,
linux-arm-kernel, linux-samsung-soc, linux-gpio, linux-kernel
Cc: Alexander A. Klimov
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.
Deterministic algorithm:
For each file:
If not .svg:
For each line:
If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
Replace HTTP with HTTPS.
Signed-off-by: Alexander A. Klimov <grandmaster@al2klimov.de>
---
Continuing my work started at 93431e0607e5.
See also: git log --oneline '--author=Alexander A. Klimov <grandmaster@al2klimov.de>' v5.7..master
If there are any URLs to be removed completely
or at least not (just) HTTPSified:
Just clearly say so and I'll *undo my change*.
See also: https://lkml.org/lkml/2020/6/27/64
If there are any valid, but yet not changed URLs:
See: https://lkml.org/lkml/2020/6/26/837
If you apply the patch, please let me know.
drivers/pinctrl/samsung/pinctrl-exynos-arm.c | 2 +-
drivers/pinctrl/samsung/pinctrl-exynos-arm64.c | 2 +-
drivers/pinctrl/samsung/pinctrl-exynos.c | 2 +-
drivers/pinctrl/samsung/pinctrl-exynos.h | 2 +-
drivers/pinctrl/samsung/pinctrl-samsung.c | 2 +-
drivers/pinctrl/samsung/pinctrl-samsung.h | 2 +-
6 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/pinctrl/samsung/pinctrl-exynos-arm.c b/drivers/pinctrl/samsung/pinctrl-exynos-arm.c
index 85ddf49a5188..6b3b60157bf9 100644
--- a/drivers/pinctrl/samsung/pinctrl-exynos-arm.c
+++ b/drivers/pinctrl/samsung/pinctrl-exynos-arm.c
@@ -5,7 +5,7 @@
// Copyright (c) 2012 Samsung Electronics Co., Ltd.
// http://www.samsung.com
// Copyright (c) 2012 Linaro Ltd
-// http://www.linaro.org
+// https://www.linaro.org
//
// Author: Thomas Abraham <thomas.ab@samsung.com>
//
diff --git a/drivers/pinctrl/samsung/pinctrl-exynos-arm64.c b/drivers/pinctrl/samsung/pinctrl-exynos-arm64.c
index b6e56422a700..d96ae32bb66d 100644
--- a/drivers/pinctrl/samsung/pinctrl-exynos-arm64.c
+++ b/drivers/pinctrl/samsung/pinctrl-exynos-arm64.c
@@ -6,7 +6,7 @@
// Copyright (c) 2012 Samsung Electronics Co., Ltd.
// http://www.samsung.com
// Copyright (c) 2012 Linaro Ltd
-// http://www.linaro.org
+// https://www.linaro.org
// Copyright (c) 2017 Krzysztof Kozlowski <krzk@kernel.org>
//
// This file contains the Samsung Exynos specific information required by the
diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.c b/drivers/pinctrl/samsung/pinctrl-exynos.c
index 84501c785473..72752cb51771 100644
--- a/drivers/pinctrl/samsung/pinctrl-exynos.c
+++ b/drivers/pinctrl/samsung/pinctrl-exynos.c
@@ -5,7 +5,7 @@
// Copyright (c) 2012 Samsung Electronics Co., Ltd.
// http://www.samsung.com
// Copyright (c) 2012 Linaro Ltd
-// http://www.linaro.org
+// https://www.linaro.org
//
// Author: Thomas Abraham <thomas.ab@samsung.com>
//
diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.h b/drivers/pinctrl/samsung/pinctrl-exynos.h
index da1ec13697e7..aad7b69f1287 100644
--- a/drivers/pinctrl/samsung/pinctrl-exynos.h
+++ b/drivers/pinctrl/samsung/pinctrl-exynos.h
@@ -5,7 +5,7 @@
* Copyright (c) 2012 Samsung Electronics Co., Ltd.
* http://www.samsung.com
* Copyright (c) 2012 Linaro Ltd
- * http://www.linaro.org
+ * https://www.linaro.org
*
* This file contains the Exynos specific definitions for the Samsung
* pinctrl/gpiolib interface drivers.
diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c
index f26574ef234a..9eac799c541e 100644
--- a/drivers/pinctrl/samsung/pinctrl-samsung.c
+++ b/drivers/pinctrl/samsung/pinctrl-samsung.c
@@ -5,7 +5,7 @@
// Copyright (c) 2012 Samsung Electronics Co., Ltd.
// http://www.samsung.com
// Copyright (c) 2012 Linaro Ltd
-// http://www.linaro.org
+// https://www.linaro.org
//
// Author: Thomas Abraham <thomas.ab@samsung.com>
//
diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.h b/drivers/pinctrl/samsung/pinctrl-samsung.h
index 379f34a9a482..c4c5356d696a 100644
--- a/drivers/pinctrl/samsung/pinctrl-samsung.h
+++ b/drivers/pinctrl/samsung/pinctrl-samsung.h
@@ -5,7 +5,7 @@
* Copyright (c) 2012 Samsung Electronics Co., Ltd.
* http://www.samsung.com
* Copyright (c) 2012 Linaro Ltd
- * http://www.linaro.org
+ * https://www.linaro.org
*
* Author: Thomas Abraham <thomas.ab@samsung.com>
*/
--
2.27.0
^ permalink raw reply related
* [PATCH] pinctl: ti: iodelay: Replace HTTP links with HTTPS ones
From: Alexander A. Klimov @ 2020-07-18 12:08 UTC (permalink / raw)
To: linus.walleij, colin.king, tony, linux-gpio, linux-kernel
Cc: Alexander A. Klimov
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.
Deterministic algorithm:
For each file:
If not .svg:
For each line:
If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
Replace HTTP with HTTPS.
Signed-off-by: Alexander A. Klimov <grandmaster@al2klimov.de>
---
Continuing my work started at 93431e0607e5.
See also: git log --oneline '--author=Alexander A. Klimov <grandmaster@al2klimov.de>' v5.7..master
(Actually letting a shell for loop submit all this stuff for me.)
If there are any URLs to be removed completely
or at least not (just) HTTPSified:
Just clearly say so and I'll *undo my change*.
See also: https://lkml.org/lkml/2020/6/27/64
If there are any valid, but yet not changed URLs:
See: https://lkml.org/lkml/2020/6/26/837
If you apply the patch, please let me know.
Sorry again to all maintainers who complained about subject lines.
Now I realized that you want an actually perfect prefixes,
not just subsystem ones.
I tried my best...
And yes, *I could* (at least half-)automate it.
Impossible is nothing! :)
drivers/pinctrl/ti/pinctrl-ti-iodelay.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
index b522ca010332..cfb924228d87 100644
--- a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
+++ b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
@@ -2,7 +2,7 @@
* Support for configuration of IO Delay module found on Texas Instruments SoCs
* such as DRA7
*
- * Copyright (C) 2015-2017 Texas Instruments Incorporated - http://www.ti.com/
+ * Copyright (C) 2015-2017 Texas Instruments Incorporated - https://www.ti.com/
*
* This file is licensed under the terms of the GNU General Public
* License version 2. This program is licensed "as is" without any
--
2.27.0
^ permalink raw reply related
* [PATCH] pinctrl: core: print gpio in pins debugfs file
From: Drew Fustini @ 2020-07-18 15:49 UTC (permalink / raw)
To: Andy Shevchenko, Tony Lindgren, Linus Walleij, linux-omap,
linux-gpio, linux-kernel, Jason Kridner, Robert Nelson
Cc: Drew Fustini
If there is a gpio range mapping for the pin, then print out the gpio
number for the pin in the debugfs 'pins' file.
Here is an example output on the BeagleBone Black from:
/sys/kernel/debug/pinctrl/44e10800.pinmux-pinctrl-single/pins
pin 103 (PIN103) GPIO-113 44e1099c 00000027 pinctrl-single
pin 104 (PIN104) GPIO-114 44e109a0 0000002c pinctrl-single
pin 105 (PIN105) GPIO-115 44e109a4 00000027 pinctrl-single
pin 106 (PIN106) GPIO-116 44e109a8 00000027 pinctrl-single
pin 107 (PIN107) GPIO-117 44e109ac 00000027 pinctrl-single
pin 108 (PIN108) GPIO-19 44e109b0 00000027 pinctrl-single
pin 109 (PIN109) GPIO-20 44e109b4 00000027 pinctrl-single
pin 110 (PIN110) 44e109b8 00000030 pinctrl-single
pin 111 (PIN111) 44e109bc 00000028 pinctrl-single
pin 112 (PIN112) 44e109c0 00000030 pinctrl-single
pin 113 (PIN113) 44e109c4 00000028 pinctrl-single
pin 114 (PIN114) 44e109c8 00000028 pinctrl-single
Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Suggested-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Drew Fustini <drew@beagleboard.org>
---
Note:
- I am hoping to get feedback if another format is better. Currently
the column 'GPIO-xxx' will only be printed when there is a GPIO num
drivers/pinctrl/core.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
index 70e13fcd94c4..e3eee950a553 100644
--- a/drivers/pinctrl/core.c
+++ b/drivers/pinctrl/core.c
@@ -1633,6 +1633,8 @@ static int pinctrl_pins_show(struct seq_file *s, void *what)
struct pinctrl_dev *pctldev = s->private;
const struct pinctrl_ops *ops = pctldev->desc->pctlops;
unsigned i, pin;
+ struct pinctrl_gpio_range *range;
+ unsigned gpio_num;
seq_printf(s, "registered pins: %d\n", pctldev->desc->npins);
@@ -1650,6 +1652,16 @@ static int pinctrl_pins_show(struct seq_file *s, void *what)
seq_printf(s, "pin %d (%s) ", pin, desc->name);
+ gpio_num = 0;
+ list_for_each_entry(range, &pctldev->gpio_ranges, node) {
+ if ((pin >= range->pin_base) &&
+ (pin < (range->pin_base + range->npins)))
+ gpio_num = range->base + (pin - range->pin_base);
+ }
+
+ if (gpio_num > 0)
+ seq_printf(s, "GPIO-%u ", gpio_num);
+
/* Driver-specific info per pin */
if (ops->pin_dbg_show)
ops->pin_dbg_show(pctldev, s, pin);
--
2.25.1
^ permalink raw reply related
* Re: [PATCH] pinctrl: core: print gpio in pins debugfs file
From: Tony Lindgren @ 2020-07-18 17:24 UTC (permalink / raw)
To: Drew Fustini
Cc: Andy Shevchenko, Linus Walleij, linux-omap, linux-gpio,
linux-kernel, Jason Kridner, Robert Nelson
In-Reply-To: <20200718154908.1816031-1-drew@beagleboard.org>
* Drew Fustini <drew@beagleboard.org> [200718 15:53]:
> If there is a gpio range mapping for the pin, then print out the gpio
> number for the pin in the debugfs 'pins' file.
>
> Here is an example output on the BeagleBone Black from:
> /sys/kernel/debug/pinctrl/44e10800.pinmux-pinctrl-single/pins
>
> pin 103 (PIN103) GPIO-113 44e1099c 00000027 pinctrl-single
> pin 104 (PIN104) GPIO-114 44e109a0 0000002c pinctrl-single
> pin 105 (PIN105) GPIO-115 44e109a4 00000027 pinctrl-single
> pin 106 (PIN106) GPIO-116 44e109a8 00000027 pinctrl-single
> pin 107 (PIN107) GPIO-117 44e109ac 00000027 pinctrl-single
> pin 108 (PIN108) GPIO-19 44e109b0 00000027 pinctrl-single
> pin 109 (PIN109) GPIO-20 44e109b4 00000027 pinctrl-single
> pin 110 (PIN110) 44e109b8 00000030 pinctrl-single
> pin 111 (PIN111) 44e109bc 00000028 pinctrl-single
> pin 112 (PIN112) 44e109c0 00000030 pinctrl-single
> pin 113 (PIN113) 44e109c4 00000028 pinctrl-single
> pin 114 (PIN114) 44e109c8 00000028 pinctrl-single
This looks nice to me, maybe just show NA if no GPIO name is
available?
This is debugfs so the output format can change at any point
AFAIK.
Regards,
Tony
^ permalink raw reply
* Re: [PATCH v1 2/5] ARM/orion/gpio: Make use of for_each_requested_gpio()
From: Gregory CLEMENT @ 2020-07-18 20:52 UTC (permalink / raw)
To: Andy Shevchenko, Linus Walleij, Bartosz Golaszewski, linux-gpio
Cc: Andy Shevchenko, Jason Cooper, Andrew Lunn, Sebastian Hesselbarth
In-Reply-To: <20200615150545.87964-3-andriy.shevchenko@linux.intel.com>
Andy Shevchenko <andriy.shevchenko@linux.intel.com> writes:
> Make use of for_each_requested_gpio() instead of home grown analogue.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Cc: Jason Cooper <jason@lakedaemon.net>
> Cc: Andrew Lunn <andrew@lunn.ch>
> Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
> Cc: Gregory Clement <gregory.clement@bootlin.com>
Applied on mvebu/arm
Thanks,
Gregory
> ---
> arch/arm/plat-orion/gpio.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/arch/arm/plat-orion/gpio.c b/arch/arm/plat-orion/gpio.c
> index 26a531ebb6e9..734f0be4f14a 100644
> --- a/arch/arm/plat-orion/gpio.c
> +++ b/arch/arm/plat-orion/gpio.c
> @@ -442,6 +442,7 @@ static void orion_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
>
> struct orion_gpio_chip *ochip = gpiochip_get_data(chip);
> u32 out, io_conf, blink, in_pol, data_in, cause, edg_msk, lvl_msk;
> + const char *label;
> int i;
>
> out = readl_relaxed(GPIO_OUT(ochip));
> @@ -453,15 +454,10 @@ static void orion_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
> edg_msk = readl_relaxed(GPIO_EDGE_MASK(ochip));
> lvl_msk = readl_relaxed(GPIO_LEVEL_MASK(ochip));
>
> - for (i = 0; i < chip->ngpio; i++) {
> - const char *label;
> + for_each_requested_gpio(chip, i, label) {
> u32 msk;
> bool is_out;
>
> - label = gpiochip_is_requested(chip, i);
> - if (!label)
> - continue;
> -
> msk = 1 << i;
> is_out = !(io_conf & msk);
>
> --
> 2.27.0.rc2
>
--
Gregory Clement, Bootlin
Embedded Linux and Kernel engineering
http://bootlin.com
^ permalink raw reply
* [PATCH v1 0/3] gpio: aggregator: Further improvements
From: Andy Shevchenko @ 2020-07-18 21:26 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski, linux-gpio,
Geert Uytterhoeven
Cc: Andy Shevchenko
Patch 1 makes sparse happy about locking and, in my opinion, improves
readability, though increases LOC count.
Patch 2 simplifies parser by using existing helpers.
Patch 3 refactors loop in parser for better readability in my opinion.
It might be you have different opinions about patches 1 and 3, we may discuss.
Compile tested only.
Andy Shevchenko (3):
gpio: aggregator: Refactor ->{get,set}_multiple() to make Sparse happy
gpio: aggregator: Simplify isrange() by using get_option()
gpio: aggregator: Assign name and offsets only once in a loop
drivers/gpio/gpio-aggregator.c | 110 +++++++++++++++++----------------
1 file changed, 57 insertions(+), 53 deletions(-)
--
2.27.0
^ permalink raw reply
* [PATCH v1 3/3] gpio: aggregator: Assign name and offsets only once in a loop
From: Andy Shevchenko @ 2020-07-18 21:26 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski, linux-gpio,
Geert Uytterhoeven
Cc: Andy Shevchenko
In-Reply-To: <20200718212608.65328-1-andriy.shevchenko@linux.intel.com>
The for-loop looks a bit hard to read when we extract two arguments
per iteration. The 'do {} while (true)' makes it easier to read
despite being infinite loop.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/gpio/gpio-aggregator.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/gpio/gpio-aggregator.c b/drivers/gpio/gpio-aggregator.c
index de9ae622ca23..962ec9373d6f 100644
--- a/drivers/gpio/gpio-aggregator.c
+++ b/drivers/gpio/gpio-aggregator.c
@@ -109,14 +109,17 @@ static int aggr_parse(struct gpio_aggregator *aggr)
if (!bitmap)
return -ENOMEM;
- for (name = get_arg(&args), offsets = get_arg(&args); name;
- offsets = get_arg(&args)) {
+ do {
+ name = get_arg(&args);
+ if (!name)
+ break;
if (IS_ERR(name)) {
pr_err("Cannot get GPIO specifier: %pe\n", name);
error = PTR_ERR(name);
goto free_bitmap;
}
+ offsets = get_arg(&args);
if (!isrange(offsets)) {
/* Named GPIO line */
error = aggr_add_gpio(aggr, name, U16_MAX, &n);
@@ -139,9 +142,7 @@ static int aggr_parse(struct gpio_aggregator *aggr)
if (error)
goto free_bitmap;
}
-
- name = get_arg(&args);
- }
+ } while (true);
if (!n) {
pr_err("No GPIOs specified\n");
--
2.27.0
^ permalink raw reply related
* [PATCH v1 2/3] gpio: aggregator: Simplify isrange() by using get_option()
From: Andy Shevchenko @ 2020-07-18 21:26 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski, linux-gpio,
Geert Uytterhoeven
Cc: Andy Shevchenko
In-Reply-To: <20200718212608.65328-1-andriy.shevchenko@linux.intel.com>
We already have a nice helper called get_option() which can be used
to validate the input format. Simplify isrange() by using it.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/gpio/gpio-aggregator.c | 29 ++++++++---------------------
1 file changed, 8 insertions(+), 21 deletions(-)
diff --git a/drivers/gpio/gpio-aggregator.c b/drivers/gpio/gpio-aggregator.c
index 5be166e73381..de9ae622ca23 100644
--- a/drivers/gpio/gpio-aggregator.c
+++ b/drivers/gpio/gpio-aggregator.c
@@ -64,30 +64,17 @@ static char *get_arg(char **args)
static bool isrange(const char *s)
{
- size_t n;
+ char **args = (char **)&s;
+ int dummy;
+ int res;
- if (IS_ERR_OR_NULL(s))
+ if (IS_ERR_OR_NULL(s) || *s == '\0')
return false;
- while (1) {
- n = strspn(s, "0123456789");
- if (!n)
- return false;
-
- s += n;
-
- switch (*s++) {
- case '\0':
- return true;
-
- case '-':
- case ',':
- break;
-
- default:
- return false;
- }
- }
+ do {
+ res = get_option(args, &dummy);
+ } while (res);
+ return **args == '\0';
}
static int aggr_add_gpio(struct gpio_aggregator *aggr, const char *key,
--
2.27.0
^ permalink raw reply related
* [PATCH v1 1/3] gpio: aggregator: Refactor ->{get,set}_multiple() to make Sparse happy
From: Andy Shevchenko @ 2020-07-18 21:26 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski, linux-gpio,
Geert Uytterhoeven
Cc: Andy Shevchenko
In-Reply-To: <20200718212608.65328-1-andriy.shevchenko@linux.intel.com>
Sparse can't see locking scheme used in ->get_multiple() and
->set_multiple() callbacks.
CHECK .../drivers/gpio/gpio-aggregator.c
.../spinlock.h:409:9: warning: context imbalance in 'gpio_fwd_get_multiple' - unexpected unlock
.../spinlock.h:409:9: warning: context imbalance in 'gpio_fwd_set_multiple' - unexpected unlock
Refactor them to have better readability and make Sparse happy.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/gpio/gpio-aggregator.c | 70 +++++++++++++++++++++-------------
1 file changed, 43 insertions(+), 27 deletions(-)
diff --git a/drivers/gpio/gpio-aggregator.c b/drivers/gpio/gpio-aggregator.c
index 424a3d25350b..5be166e73381 100644
--- a/drivers/gpio/gpio-aggregator.c
+++ b/drivers/gpio/gpio-aggregator.c
@@ -333,20 +333,14 @@ static int gpio_fwd_get(struct gpio_chip *chip, unsigned int offset)
return gpiod_get_value(fwd->descs[offset]);
}
-static int gpio_fwd_get_multiple(struct gpio_chip *chip, unsigned long *mask,
+static int gpio_fwd_get_multiple(struct gpiochip_fwd *fwd, unsigned long *mask,
unsigned long *bits)
{
- struct gpiochip_fwd *fwd = gpiochip_get_data(chip);
- unsigned long *values, flags = 0;
struct gpio_desc **descs;
+ unsigned long *values;
unsigned int i, j = 0;
int error;
- if (chip->can_sleep)
- mutex_lock(&fwd->mlock);
- else
- spin_lock_irqsave(&fwd->slock, flags);
-
/* Both values bitmap and desc pointers are stored in tmp[] */
values = &fwd->tmp[0];
descs = (void *)&fwd->tmp[BITS_TO_LONGS(fwd->chip.ngpio)];
@@ -356,16 +350,32 @@ static int gpio_fwd_get_multiple(struct gpio_chip *chip, unsigned long *mask,
descs[j++] = fwd->descs[i];
error = gpiod_get_array_value(j, descs, NULL, values);
- if (!error) {
- j = 0;
- for_each_set_bit(i, mask, fwd->chip.ngpio)
- __assign_bit(i, bits, test_bit(j++, values));
- }
+ if (error)
+ return error;
- if (chip->can_sleep)
+ j = 0;
+ for_each_set_bit(i, mask, fwd->chip.ngpio)
+ __assign_bit(i, bits, test_bit(j++, values));
+
+ return 0;
+}
+
+static int gpio_fwd_get_multiple_locked(struct gpio_chip *chip,
+ unsigned long *mask, unsigned long *bits)
+{
+ struct gpiochip_fwd *fwd = gpiochip_get_data(chip);
+ unsigned long flags;
+ int error;
+
+ if (chip->can_sleep) {
+ mutex_lock(&fwd->mlock);
+ error = gpio_fwd_get_multiple(fwd, mask, bits);
mutex_unlock(&fwd->mlock);
- else
+ } else {
+ spin_lock_irqsave(&fwd->slock, flags);
+ error = gpio_fwd_get_multiple(fwd, mask, bits);
spin_unlock_irqrestore(&fwd->slock, flags);
+ }
return error;
}
@@ -377,19 +387,13 @@ static void gpio_fwd_set(struct gpio_chip *chip, unsigned int offset, int value)
gpiod_set_value(fwd->descs[offset], value);
}
-static void gpio_fwd_set_multiple(struct gpio_chip *chip, unsigned long *mask,
+static void gpio_fwd_set_multiple(struct gpiochip_fwd *fwd, unsigned long *mask,
unsigned long *bits)
{
- struct gpiochip_fwd *fwd = gpiochip_get_data(chip);
- unsigned long *values, flags = 0;
struct gpio_desc **descs;
+ unsigned long *values;
unsigned int i, j = 0;
- if (chip->can_sleep)
- mutex_lock(&fwd->mlock);
- else
- spin_lock_irqsave(&fwd->slock, flags);
-
/* Both values bitmap and desc pointers are stored in tmp[] */
values = &fwd->tmp[0];
descs = (void *)&fwd->tmp[BITS_TO_LONGS(fwd->chip.ngpio)];
@@ -400,11 +404,23 @@ static void gpio_fwd_set_multiple(struct gpio_chip *chip, unsigned long *mask,
}
gpiod_set_array_value(j, descs, NULL, values);
+}
- if (chip->can_sleep)
+static void gpio_fwd_set_multiple_locked(struct gpio_chip *chip,
+ unsigned long *mask, unsigned long *bits)
+{
+ struct gpiochip_fwd *fwd = gpiochip_get_data(chip);
+ unsigned long flags;
+
+ if (chip->can_sleep) {
+ mutex_lock(&fwd->mlock);
+ gpio_fwd_set_multiple(fwd, mask, bits);
mutex_unlock(&fwd->mlock);
- else
+ } else {
+ spin_lock_irqsave(&fwd->slock, flags);
+ gpio_fwd_set_multiple(fwd, mask, bits);
spin_unlock_irqrestore(&fwd->slock, flags);
+ }
}
static int gpio_fwd_set_config(struct gpio_chip *chip, unsigned int offset,
@@ -470,9 +486,9 @@ static struct gpiochip_fwd *gpiochip_fwd_create(struct device *dev,
chip->direction_input = gpio_fwd_direction_input;
chip->direction_output = gpio_fwd_direction_output;
chip->get = gpio_fwd_get;
- chip->get_multiple = gpio_fwd_get_multiple;
+ chip->get_multiple = gpio_fwd_get_multiple_locked;
chip->set = gpio_fwd_set;
- chip->set_multiple = gpio_fwd_set_multiple;
+ chip->set_multiple = gpio_fwd_set_multiple_locked;
chip->base = -1;
chip->ngpio = ngpios;
fwd->descs = descs;
--
2.27.0
^ permalink raw reply related
* Re: [PATCH v1 2/5] ARM/orion/gpio: Make use of for_each_requested_gpio()
From: Andy Shevchenko @ 2020-07-18 21:31 UTC (permalink / raw)
To: Gregory CLEMENT
Cc: Andy Shevchenko, Linus Walleij, Bartosz Golaszewski,
open list:GPIO SUBSYSTEM, Jason Cooper, Andrew Lunn,
Sebastian Hesselbarth
In-Reply-To: <87sgdo35sf.fsf@FE-laptop>
On Sat, Jul 18, 2020 at 11:53 PM Gregory CLEMENT
<gregory.clement@bootlin.com> wrote:
>
> Andy Shevchenko <andriy.shevchenko@linux.intel.com> writes:
>
> > Make use of for_each_requested_gpio() instead of home grown analogue.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > Cc: Jason Cooper <jason@lakedaemon.net>
> > Cc: Andrew Lunn <andrew@lunn.ch>
> > Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
> > Cc: Gregory Clement <gregory.clement@bootlin.com>
>
> Applied on mvebu/arm
I guess you need to merge an immutable branch from Linus. Does above imply this?
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply
* Re: [PATCH 03/13] pinctrl: rockchip: make driver be tristate module
From: kernel test robot @ 2020-07-18 23:32 UTC (permalink / raw)
To: Jianqun Xu, heiko, linus.walleij
Cc: kbuild-all, linux-gpio, linux-rockchip, linux-kernel, kever.yang,
david.wu, Jianqun Xu
In-Reply-To: <20200717032411.17654-4-jay.xu@rock-chips.com>
[-- Attachment #1: Type: text/plain, Size: 7799 bytes --]
Hi Jianqun,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on rockchip/for-next]
[also build test ERROR on pinctrl/devel v5.8-rc5 next-20200717]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Jianqun-Xu/pinctrl-rockchip-prepare-work-for-split-driver/20200717-112906
base: https://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git for-next
config: alpha-randconfig-r014-20200719 (attached as .config)
compiler: alpha-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=alpha
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
drivers/pinctrl/pinctrl-rockchip.c: In function 'rockchip_pinctrl_parse_groups':
>> drivers/pinctrl/pinctrl-rockchip.c:2879:9: error: implicit declaration of function 'pinconf_generic_parse_dt_config'; did you mean 'pinconf_generic_dump_config'? [-Werror=implicit-function-declaration]
2879 | ret = pinconf_generic_parse_dt_config(np_config, NULL,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| pinconf_generic_dump_config
drivers/pinctrl/pinctrl-rockchip.c: In function 'rockchip_gpiolib_register':
>> drivers/pinctrl/pinctrl-rockchip.c:3471:5: error: 'struct gpio_chip' has no member named 'of_node'
3471 | gc->of_node = bank->of_node;
| ^~
drivers/pinctrl/pinctrl-rockchip.c: In function 'rockchip_pinctrl_get_soc_data':
drivers/pinctrl/pinctrl-rockchip.c:3575:8: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
3575 | const const struct rockchip_pin_ctrl *ctrl;
| ^~~~~
drivers/pinctrl/pinctrl-rockchip.c: In function 'rockchip_pinctrl_probe':
drivers/pinctrl/pinctrl-rockchip.c:3753:8: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
3753 | const const struct rockchip_pin_ctrl *ctrl;
| ^~~~~
At top level:
drivers/pinctrl/pinctrl-rockchip.c:2802:34: warning: 'rockchip_bank_match' defined but not used [-Wunused-const-variable=]
2802 | static const struct of_device_id rockchip_bank_match[] = {
| ^~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +2879 drivers/pinctrl/pinctrl-rockchip.c
d3e5116119bd02 Heiko Stübner 2013-06-10 2821
d3e5116119bd02 Heiko Stübner 2013-06-10 2822 static int rockchip_pinctrl_parse_groups(struct device_node *np,
d3e5116119bd02 Heiko Stübner 2013-06-10 2823 struct rockchip_pin_group *grp,
d3e5116119bd02 Heiko Stübner 2013-06-10 2824 struct rockchip_pinctrl *info,
d3e5116119bd02 Heiko Stübner 2013-06-10 2825 u32 index)
d3e5116119bd02 Heiko Stübner 2013-06-10 2826 {
d3e5116119bd02 Heiko Stübner 2013-06-10 2827 struct rockchip_pin_bank *bank;
d3e5116119bd02 Heiko Stübner 2013-06-10 2828 int size;
d3e5116119bd02 Heiko Stübner 2013-06-10 2829 const __be32 *list;
d3e5116119bd02 Heiko Stübner 2013-06-10 2830 int num;
d3e5116119bd02 Heiko Stübner 2013-06-10 2831 int i, j;
d3e5116119bd02 Heiko Stübner 2013-06-10 2832 int ret;
d3e5116119bd02 Heiko Stübner 2013-06-10 2833
94f4e54cecaf3e Rob Herring 2018-08-27 2834 dev_dbg(info->dev, "group(%d): %pOFn\n", index, np);
d3e5116119bd02 Heiko Stübner 2013-06-10 2835
d3e5116119bd02 Heiko Stübner 2013-06-10 2836 /* Initialise group */
d3e5116119bd02 Heiko Stübner 2013-06-10 2837 grp->name = np->name;
d3e5116119bd02 Heiko Stübner 2013-06-10 2838
d3e5116119bd02 Heiko Stübner 2013-06-10 2839 /*
d3e5116119bd02 Heiko Stübner 2013-06-10 2840 * the binding format is rockchip,pins = <bank pin mux CONFIG>,
d3e5116119bd02 Heiko Stübner 2013-06-10 2841 * do sanity check and calculate pins number
d3e5116119bd02 Heiko Stübner 2013-06-10 2842 */
d3e5116119bd02 Heiko Stübner 2013-06-10 2843 list = of_get_property(np, "rockchip,pins", &size);
d3e5116119bd02 Heiko Stübner 2013-06-10 2844 /* we do not check return since it's safe node passed down */
d3e5116119bd02 Heiko Stübner 2013-06-10 2845 size /= sizeof(*list);
d3e5116119bd02 Heiko Stübner 2013-06-10 2846 if (!size || size % 4) {
d3e5116119bd02 Heiko Stübner 2013-06-10 2847 dev_err(info->dev, "wrong pins number or pins and configs should be by 4\n");
d3e5116119bd02 Heiko Stübner 2013-06-10 2848 return -EINVAL;
d3e5116119bd02 Heiko Stübner 2013-06-10 2849 }
d3e5116119bd02 Heiko Stübner 2013-06-10 2850
d3e5116119bd02 Heiko Stübner 2013-06-10 2851 grp->npins = size / 4;
d3e5116119bd02 Heiko Stübner 2013-06-10 2852
a86854d0c599b3 Kees Cook 2018-06-12 2853 grp->pins = devm_kcalloc(info->dev, grp->npins, sizeof(unsigned int),
d3e5116119bd02 Heiko Stübner 2013-06-10 2854 GFP_KERNEL);
a86854d0c599b3 Kees Cook 2018-06-12 2855 grp->data = devm_kcalloc(info->dev,
a86854d0c599b3 Kees Cook 2018-06-12 2856 grp->npins,
d3e5116119bd02 Heiko Stübner 2013-06-10 2857 sizeof(struct rockchip_pin_config),
d3e5116119bd02 Heiko Stübner 2013-06-10 2858 GFP_KERNEL);
d3e5116119bd02 Heiko Stübner 2013-06-10 2859 if (!grp->pins || !grp->data)
d3e5116119bd02 Heiko Stübner 2013-06-10 2860 return -ENOMEM;
d3e5116119bd02 Heiko Stübner 2013-06-10 2861
d3e5116119bd02 Heiko Stübner 2013-06-10 2862 for (i = 0, j = 0; i < size; i += 4, j++) {
d3e5116119bd02 Heiko Stübner 2013-06-10 2863 const __be32 *phandle;
d3e5116119bd02 Heiko Stübner 2013-06-10 2864 struct device_node *np_config;
d3e5116119bd02 Heiko Stübner 2013-06-10 2865
d3e5116119bd02 Heiko Stübner 2013-06-10 2866 num = be32_to_cpu(*list++);
d3e5116119bd02 Heiko Stübner 2013-06-10 2867 bank = bank_num_to_bank(info, num);
d3e5116119bd02 Heiko Stübner 2013-06-10 2868 if (IS_ERR(bank))
d3e5116119bd02 Heiko Stübner 2013-06-10 2869 return PTR_ERR(bank);
d3e5116119bd02 Heiko Stübner 2013-06-10 2870
d3e5116119bd02 Heiko Stübner 2013-06-10 2871 grp->pins[j] = bank->pin_base + be32_to_cpu(*list++);
d3e5116119bd02 Heiko Stübner 2013-06-10 2872 grp->data[j].func = be32_to_cpu(*list++);
d3e5116119bd02 Heiko Stübner 2013-06-10 2873
d3e5116119bd02 Heiko Stübner 2013-06-10 2874 phandle = list++;
d3e5116119bd02 Heiko Stübner 2013-06-10 2875 if (!phandle)
d3e5116119bd02 Heiko Stübner 2013-06-10 2876 return -EINVAL;
d3e5116119bd02 Heiko Stübner 2013-06-10 2877
d3e5116119bd02 Heiko Stübner 2013-06-10 2878 np_config = of_find_node_by_phandle(be32_to_cpup(phandle));
dd4d01f7bad886 Soren Brinkmann 2015-01-09 @2879 ret = pinconf_generic_parse_dt_config(np_config, NULL,
d3e5116119bd02 Heiko Stübner 2013-06-10 2880 &grp->data[j].configs, &grp->data[j].nconfigs);
d3e5116119bd02 Heiko Stübner 2013-06-10 2881 if (ret)
d3e5116119bd02 Heiko Stübner 2013-06-10 2882 return ret;
d3e5116119bd02 Heiko Stübner 2013-06-10 2883 }
d3e5116119bd02 Heiko Stübner 2013-06-10 2884
d3e5116119bd02 Heiko Stübner 2013-06-10 2885 return 0;
d3e5116119bd02 Heiko Stübner 2013-06-10 2886 }
d3e5116119bd02 Heiko Stübner 2013-06-10 2887
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 24835 bytes --]
^ permalink raw reply
* Re: [PATCH v1 3/3] gpio: aggregator: Assign name and offsets only once in a loop
From: Andy Shevchenko @ 2020-07-19 10:12 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Linus Walleij, Bartosz Golaszewski, open list:GPIO SUBSYSTEM,
Geert Uytterhoeven
In-Reply-To: <20200718212608.65328-4-andriy.shevchenko@linux.intel.com>
On Sun, Jul 19, 2020 at 12:26 AM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> The for-loop looks a bit hard to read when we extract two arguments
> per iteration. The 'do {} while (true)' makes it easier to read
> despite being infinite loop.
This is not gonna work.
Please, discard this patch from the series.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply
* [PATCH v2] pinctrl: core: print gpio in pins debugfs file
From: Drew Fustini @ 2020-07-19 13:22 UTC (permalink / raw)
To: Andy Shevchenko, Tony Lindgren, Linus Walleij, linux-omap,
linux-gpio, linux-kernel, Jason Kridner, Robert Nelson
Cc: Drew Fustini
If there is a gpio range mapping for the pin, then print out the gpio
number for the pin in the debugfs 'pins' file.
Here is an example output on the BeagleBone Black from:
/sys/kernel/debug/pinctrl/44e10800.pinmux-pinctrl-single/pins
pin 103 (PIN103) GPIO-113 44e1099c 00000027 pinctrl-single
pin 104 (PIN104) GPIO-114 44e109a0 0000002c pinctrl-single
pin 105 (PIN105) GPIO-115 44e109a4 00000027 pinctrl-single
pin 106 (PIN106) GPIO-116 44e109a8 00000027 pinctrl-single
pin 107 (PIN107) GPIO-117 44e109ac 00000027 pinctrl-single
pin 108 (PIN108) GPIO-19 44e109b0 00000027 pinctrl-single
pin 109 (PIN109) GPIO-20 44e109b4 00000027 pinctrl-single
pin 110 (PIN110) NA 44e109b8 00000030 pinctrl-single
pin 111 (PIN111) NA 44e109bc 00000028 pinctrl-single
pin 112 (PIN112) NA 44e109c0 00000030 pinctrl-single
pin 113 (PIN113) NA 44e109c4 00000028 pinctrl-single
pin 114 (PIN114) NA 44e109c8 00000028 pinctrl-single
Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Suggested-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Drew Fustini <drew@beagleboard.org>
---
drivers/pinctrl/core.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
v2 changes:
- print 'NA' if pin does not have a GPIO number
- change gpio_num from unsigned to unsigned int per checkpatch
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
index 821242bb4b16..8478025926a2 100644
--- a/drivers/pinctrl/core.c
+++ b/drivers/pinctrl/core.c
@@ -1601,6 +1601,8 @@ static int pinctrl_pins_show(struct seq_file *s, void *what)
struct pinctrl_dev *pctldev = s->private;
const struct pinctrl_ops *ops = pctldev->desc->pctlops;
unsigned i, pin;
+ struct pinctrl_gpio_range *range;
+ unsigned int gpio_num;
seq_printf(s, "registered pins: %d\n", pctldev->desc->npins);
@@ -1618,6 +1620,18 @@ static int pinctrl_pins_show(struct seq_file *s, void *what)
seq_printf(s, "pin %d (%s) ", pin, desc->name);
+ gpio_num = 0;
+ list_for_each_entry(range, &pctldev->gpio_ranges, node) {
+ if ((pin >= range->pin_base) &&
+ (pin < (range->pin_base + range->npins)))
+ gpio_num = range->base + (pin - range->pin_base);
+ }
+
+ if (gpio_num > 0)
+ seq_printf(s, "GPIO-%u ", gpio_num);
+ else
+ seq_puts(s, "NA ");
+
/* Driver-specific info per pin */
if (ops->pin_dbg_show)
ops->pin_dbg_show(pctldev, s, pin);
--
2.25.1
^ permalink raw reply related
* Re: [PATCH v2] pinctrl: core: print gpio in pins debugfs file
From: Drew Fustini @ 2020-07-19 13:28 UTC (permalink / raw)
To: Andy Shevchenko, Tony Lindgren, Linus Walleij, linux-omap,
linux-gpio, linux-kernel, Jason Kridner, Robert Nelson
In-Reply-To: <20200719132200.1878265-1-drew@beagleboard.org>
On Sun, Jul 19, 2020 at 03:22:01PM +0200, Drew Fustini wrote:
> If there is a gpio range mapping for the pin, then print out the gpio
> number for the pin in the debugfs 'pins' file.
>
> Here is an example output on the BeagleBone Black from:
> /sys/kernel/debug/pinctrl/44e10800.pinmux-pinctrl-single/pins
>
> pin 103 (PIN103) GPIO-113 44e1099c 00000027 pinctrl-single
> pin 104 (PIN104) GPIO-114 44e109a0 0000002c pinctrl-single
> pin 105 (PIN105) GPIO-115 44e109a4 00000027 pinctrl-single
> pin 106 (PIN106) GPIO-116 44e109a8 00000027 pinctrl-single
> pin 107 (PIN107) GPIO-117 44e109ac 00000027 pinctrl-single
> pin 108 (PIN108) GPIO-19 44e109b0 00000027 pinctrl-single
> pin 109 (PIN109) GPIO-20 44e109b4 00000027 pinctrl-single
> pin 110 (PIN110) NA 44e109b8 00000030 pinctrl-single
> pin 111 (PIN111) NA 44e109bc 00000028 pinctrl-single
> pin 112 (PIN112) NA 44e109c0 00000030 pinctrl-single
> pin 113 (PIN113) NA 44e109c4 00000028 pinctrl-single
> pin 114 (PIN114) NA 44e109c8 00000028 pinctrl-single
>
> Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> Suggested-by: Tony Lindgren <tony@atomide.com>
> Signed-off-by: Drew Fustini <drew@beagleboard.org>
> ---
> drivers/pinctrl/core.c | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> v2 changes:
> - print 'NA' if pin does not have a GPIO number
> - change gpio_num from unsigned to unsigned int per checkpatch
>
> diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
> index 821242bb4b16..8478025926a2 100644
> --- a/drivers/pinctrl/core.c
> +++ b/drivers/pinctrl/core.c
> @@ -1601,6 +1601,8 @@ static int pinctrl_pins_show(struct seq_file *s, void *what)
> struct pinctrl_dev *pctldev = s->private;
> const struct pinctrl_ops *ops = pctldev->desc->pctlops;
> unsigned i, pin;
> + struct pinctrl_gpio_range *range;
> + unsigned int gpio_num;
>
> seq_printf(s, "registered pins: %d\n", pctldev->desc->npins);
>
> @@ -1618,6 +1620,18 @@ static int pinctrl_pins_show(struct seq_file *s, void *what)
>
> seq_printf(s, "pin %d (%s) ", pin, desc->name);
>
> + gpio_num = 0;
> + list_for_each_entry(range, &pctldev->gpio_ranges, node) {
> + if ((pin >= range->pin_base) &&
> + (pin < (range->pin_base + range->npins)))
> + gpio_num = range->base + (pin - range->pin_base);
> + }
> +
> + if (gpio_num > 0)
> + seq_printf(s, "GPIO-%u ", gpio_num);
> + else
> + seq_puts(s, "NA ");
> +
> /* Driver-specific info per pin */
> if (ops->pin_dbg_show)
> ops->pin_dbg_show(pctldev, s, pin);
> --
> 2.25.1
>
Linus - would it better if I printed the gpio chip and line number
instead of the GPIO number?
If so, any advice on how to best convert the gpio number to the gpio
descriptor inside pinctrl_pins_show()?
Thanks,
Drew
^ permalink raw reply
* Re: [PATCH] gpio: max732x: Use irqchip template
From: Sam Protsenko @ 2020-07-19 16:34 UTC (permalink / raw)
To: Linus Walleij; +Cc: linux-gpio, Bartosz Golaszewski
In-Reply-To: <20200717141924.57887-1-linus.walleij@linaro.org>
Hi Linus,
On Fri, 17 Jul 2020 at 17:19, Linus Walleij <linus.walleij@linaro.org> wrote:
>
> This makes the driver use the irqchip template to assign
> properties to the gpio_irq_chip instead of using the
> explicit calls to gpiochip_irqchip_add_nested() and
> gpiochip_set_nested_irqchip(). The irqchip is instead
> added while adding the gpiochip.
>
> Cc: Sam Protsenko <semen.protsenko@linaro.org>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
I can test it on my MAX7325 board with BeagleBone Black in a day or
two. Do you want me to verify your patch on top of linux-mainline or
linux-next? Also, is there any specific stuff you want me to look at,
or making sure there are no regressions w.r.t. IRQ from the chip is
enough?
Thanks!
> drivers/gpio/gpio-max732x.c | 26 +++++++++++++-------------
> 1 file changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/gpio/gpio-max732x.c b/drivers/gpio/gpio-max732x.c
> index 63472f308857..347415344a20 100644
> --- a/drivers/gpio/gpio-max732x.c
> +++ b/drivers/gpio/gpio-max732x.c
> @@ -503,6 +503,8 @@ static int max732x_irq_setup(struct max732x_chip *chip,
>
> if (((pdata && pdata->irq_base) || client->irq)
> && has_irq != INT_NONE) {
> + struct gpio_irq_chip *girq;
> +
> if (pdata)
> irq_base = pdata->irq_base;
> chip->irq_features = has_irq;
> @@ -517,19 +519,17 @@ static int max732x_irq_setup(struct max732x_chip *chip,
> client->irq);
> return ret;
> }
> - ret = gpiochip_irqchip_add_nested(&chip->gpio_chip,
> - &max732x_irq_chip,
> - irq_base,
> - handle_simple_irq,
> - IRQ_TYPE_NONE);
> - if (ret) {
> - dev_err(&client->dev,
> - "could not connect irqchip to gpiochip\n");
> - return ret;
> - }
> - gpiochip_set_nested_irqchip(&chip->gpio_chip,
> - &max732x_irq_chip,
> - client->irq);
> +
> + girq = &chip->gpio_chip.irq;
> + girq->chip = &max732x_irq_chip;
> + /* This will let us handle the parent IRQ in the driver */
> + girq->parent_handler = NULL;
> + girq->num_parents = 0;
> + girq->parents = NULL;
> + girq->default_type = IRQ_TYPE_NONE;
> + girq->handler = handle_simple_irq;
> + girq->threaded = true;
> + girq->first = irq_base; /* FIXME: get rid of this */
> }
>
> return 0;
> --
> 2.26.2
>
^ permalink raw reply
* Re: [RFC v2 GPIO lines [was: GPIO User I/O]
From: Andy Shevchenko @ 2020-07-19 18:35 UTC (permalink / raw)
To: Rodolfo Giometti
Cc: Linus Walleij, Geert Uytterhoeven, Geert Uytterhoeven,
open list:GPIO SUBSYSTEM, Bartosz Golaszewski, Rob Herring,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
In-Reply-To: <80bf1236-aacd-1044-b0e5-5b5718b7e9f0@enneenne.com>
On Thu, Jul 16, 2020 at 6:17 PM Rodolfo Giometti <giometti@enneenne.com> wrote:
> On 16/07/2020 15:38, Linus Walleij wrote:
...
> I see but this interface is not designed for such complex usage nor to compete
> with the current character interface! It is designed to allow boards
> manufactures to "describe" some I/O lines that are not used by any driver in the
> device tree,
Why are they not in firmware tables? Platform is a set of hardware
that makes it so.
If something is not in DT, then there is no possible way to know what
is that line?
Or in other words how does the OS know that the certain line is
connected to a relay?
> and that users may desire to manage in a very simple manner. Let's
> thing about relay lines, or just a locked/unlocked input line which can be
> easily polled.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply
* [PATCH] gpio: Correct kernel-doc inconsistency
From: Colton Lewis @ 2020-07-19 21:08 UTC (permalink / raw)
To: linux.walleij; +Cc: linux-gpio, Colton Lewis
Silence documentation build warnings by correcting kernel-doc comment
for gpiochip_add_data function.
./include/linux/gpio/driver.h:512: warning: Function parameter or member 'gc' not described in 'gpiochip_add_data'
./include/linux/gpio/driver.h:512: warning: Excess function parameter 'chip' description in 'gpiochip_add_data'
Signed-off-by: Colton Lewis <colton.w.lewis@protonmail.com>
---
include/linux/gpio/driver.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
index c4f272af7af5..ee5f86f67ef8 100644
--- a/include/linux/gpio/driver.h
+++ b/include/linux/gpio/driver.h
@@ -481,25 +481,25 @@ extern int gpiochip_add_data_with_key(struct gpio_chip *gc, void *data,
/**
* gpiochip_add_data() - register a gpio_chip
- * @chip: the chip to register, with chip->base initialized
+ * @gc: the chip to register, with gc->base initialized
* @data: driver-private data associated with this chip
*
* Context: potentially before irqs will work
*
* When gpiochip_add_data() is called very early during boot, so that GPIOs
- * can be freely used, the chip->parent device must be registered before
+ * can be freely used, the gc->parent device must be registered before
* the gpio framework's arch_initcall(). Otherwise sysfs initialization
* for GPIOs will fail rudely.
*
* gpiochip_add_data() must only be called after gpiolib initialization,
* ie after core_initcall().
*
- * If chip->base is negative, this requests dynamic assignment of
+ * If gc->base is negative, this requests dynamic assignment of
* a range of valid GPIOs.
*
* Returns:
* A negative errno if the chip can't be registered, such as because the
- * chip->base is invalid or already associated with a different chip.
+ * gc->base is invalid or already associated with a different chip.
* Otherwise it returns zero as a success code.
*/
#ifdef CONFIG_LOCKDEP
--
2.26.2
^ permalink raw reply related
* [PATCH] gpio: Correct kernel-doc inconsistency
From: Colton Lewis @ 2020-07-19 21:09 UTC (permalink / raw)
To: linus.walleij; +Cc: linux-gpio, Colton Lewis
Silence documentation build warnings by correcting kernel-doc comment
for gpiochip_add_data function.
./include/linux/gpio/driver.h:512: warning: Function parameter or member 'gc' not described in 'gpiochip_add_data'
./include/linux/gpio/driver.h:512: warning: Excess function parameter 'chip' description in 'gpiochip_add_data'
Signed-off-by: Colton Lewis <colton.w.lewis@protonmail.com>
---
include/linux/gpio/driver.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
index c4f272af7af5..ee5f86f67ef8 100644
--- a/include/linux/gpio/driver.h
+++ b/include/linux/gpio/driver.h
@@ -481,25 +481,25 @@ extern int gpiochip_add_data_with_key(struct gpio_chip *gc, void *data,
/**
* gpiochip_add_data() - register a gpio_chip
- * @chip: the chip to register, with chip->base initialized
+ * @gc: the chip to register, with gc->base initialized
* @data: driver-private data associated with this chip
*
* Context: potentially before irqs will work
*
* When gpiochip_add_data() is called very early during boot, so that GPIOs
- * can be freely used, the chip->parent device must be registered before
+ * can be freely used, the gc->parent device must be registered before
* the gpio framework's arch_initcall(). Otherwise sysfs initialization
* for GPIOs will fail rudely.
*
* gpiochip_add_data() must only be called after gpiolib initialization,
* ie after core_initcall().
*
- * If chip->base is negative, this requests dynamic assignment of
+ * If gc->base is negative, this requests dynamic assignment of
* a range of valid GPIOs.
*
* Returns:
* A negative errno if the chip can't be registered, such as because the
- * chip->base is invalid or already associated with a different chip.
+ * gc->base is invalid or already associated with a different chip.
* Otherwise it returns zero as a success code.
*/
#ifdef CONFIG_LOCKDEP
--
2.26.2
^ permalink raw reply related
* Re: [PATCH v5 02/13] mfd: add simple regmap based I2C driver
From: Michael Walle @ 2020-07-19 22:25 UTC (permalink / raw)
To: Lee Jones
Cc: linux-gpio, devicetree, linux-kernel, linux-hwmon, linux-pwm,
linux-watchdog, linux-arm-kernel, Linus Walleij,
Bartosz Golaszewski, Rob Herring, Jean Delvare, Guenter Roeck,
Thierry Reding, Uwe Kleine-König, Wim Van Sebroeck,
Shawn Guo, Li Yang, Thomas Gleixner, Jason Cooper, Marc Zyngier,
Mark Brown, Greg Kroah-Hartman, Andy Shevchenko
In-Reply-To: <20200717090444.GE3165313@dell>
Am 2020-07-17 11:04, schrieb Lee Jones:
> On Mon, 06 Jul 2020, Michael Walle wrote:
>
>> There are I2C devices which contain several different functions but
>> doesn't require any special access functions. For these kind of
>> drivers
>> an I2C regmap should be enough.
>>
>> Create an I2C driver which creates an I2C regmap and enumerates its
>> children. If a device wants to use this as its MFD core driver, it has
>> to add an individual compatible string. It may provide its own regmap
>> configuration.
>>
>> Subdevices can use dev_get_regmap() on the parent to get their regmap
>> instance.
>>
>> Signed-off-by: Michael Walle <michael@walle.cc>
>> ---
>> Changes since v4:
>> - new patch. Lee, please bear with me. I didn't want to delay the
>> new version (where a lot of remarks on the other patches were
>> addressed) even more, just because we haven't figured out how
>> to deal with the MFD part. So for now, I've included this one.
>>
>> drivers/mfd/Kconfig | 9 +++++++
>> drivers/mfd/Makefile | 1 +
>> drivers/mfd/simple-mfd-i2c.c | 50
>> ++++++++++++++++++++++++++++++++++++
>> 3 files changed, 60 insertions(+)
>> create mode 100644 drivers/mfd/simple-mfd-i2c.c
>>
>> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
>> index 33df0837ab41..f1536a710aca 100644
>> --- a/drivers/mfd/Kconfig
>> +++ b/drivers/mfd/Kconfig
>> @@ -1162,6 +1162,15 @@ config MFD_SI476X_CORE
>> To compile this driver as a module, choose M here: the
>> module will be called si476x-core.
>>
>> +config MFD_SIMPLE_MFD_I2C
>> + tristate "Simple regmap based I2C devices"
>> + depends on I2C
>> + select MFD_CORE
>> + select REGMAP_I2C
>> + help
>> + This is a consolidated driver for all MFD devices which are
>> + basically just a regmap bus driver.
>> +
>> config MFD_SM501
>> tristate "Silicon Motion SM501"
>> depends on HAS_DMA
>> diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
>> index a60e5f835283..78d24a3e7c9e 100644
>> --- a/drivers/mfd/Makefile
>> +++ b/drivers/mfd/Makefile
>> @@ -264,3 +264,4 @@ obj-$(CONFIG_MFD_STMFX) += stmfx.o
>> obj-$(CONFIG_MFD_KHADAS_MCU) += khadas-mcu.o
>>
>> obj-$(CONFIG_SGI_MFD_IOC3) += ioc3.o
>> +obj-$(CONFIG_MFD_SIMPLE_MFD_I2C) += simple-mfd-i2c.o
>> diff --git a/drivers/mfd/simple-mfd-i2c.c
>> b/drivers/mfd/simple-mfd-i2c.c
>> new file mode 100644
>> index 000000000000..1fdca89964b1
>> --- /dev/null
>> +++ b/drivers/mfd/simple-mfd-i2c.c
>> @@ -0,0 +1,49 @@
>> +// SPDX-License-Identifier: GPL-2.0-only
>> +#include <linux/i2c.h>
>> +#include <linux/interrupt.h>
>> +#include <linux/kernel.h>
>> +#include <linux/mfd/core.h>
>> +#include <linux/mod_devicetable.h>
>> +#include <linux/module.h>
>> +#include <linux/of_platform.h>
>> +#include <linux/regmap.h>
>
> I'm pretty sure you do not require all of these headers.
Shot, I'll clean that up.
>> +struct simple_mfd_i2c_config {
>> + const struct regmap_config *regmap_config;
>> +};
>
> No need for this yet I feel.
>
> Let's keep it as simple as possible.
ok
>> +static const struct regmap_config simple_regmap_config = {
>> + .reg_bits = 8,
>> + .val_bits = 8,
>> +};
>> +
>> +static int simple_mfd_i2c_probe(struct i2c_client *i2c)
>> +{
>> + const struct regmap_config *regmap_config = &simple_regmap_config;
>> + const struct simple_mfd_i2c_config *config;
>> + struct regmap *regmap;
>> +
>> + config = device_get_match_data(&i2c->dev);
>
> Have this return regmap_config.
ok
>> + if (config && config->regmap_config)
>> + regmap_config = config->regmap_config;
>> +
>> + regmap = devm_regmap_init_i2c(i2c, regmap_config);
>> + if (IS_ERR(regmap))
>> + return PTR_ERR(regmap);
>> +
>> + return devm_of_platform_populate(&i2c->dev);
>> +}
>> +
>> +static const struct of_device_id simple_mfd_i2c_of_match[] = {
>> + {}
>> +};
>> +
>> +static struct i2c_driver simple_mfd_i2c_driver = {
>> + .probe_new = simple_mfd_i2c_probe,
>> + .driver = {
>> + .name = "simple-mfd-i2c",
>> + .of_match_table = simple_mfd_i2c_of_match,
>> + },
>> +};
>> +builtin_i2c_driver(simple_mfd_i2c_driver);
--
-michael
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox