2022-05-04 23:54:25

by Justin Chen

[permalink] [raw]
Subject: [PATCH 1/2] gpio: pca953xx: Add support for pca6408

Add support for pca6408 which is the 8-bit version of the pca6416.

https://www.nxp.com/docs/en/data-sheet/PCA6408A.pdf

Signed-off-by: Justin Chen <[email protected]>
---
drivers/gpio/gpio-pca953x.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index d2fe76f..2d0b080 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -71,6 +71,7 @@
#define PCA_CHIP_TYPE(x) ((x) & PCA_TYPE_MASK)

static const struct i2c_device_id pca953x_id[] = {
+ { "pca6408", 8 | PCA953x_TYPE | PCA_INT, },
{ "pca6416", 16 | PCA953X_TYPE | PCA_INT, },
{ "pca9505", 40 | PCA953X_TYPE | PCA_INT, },
{ "pca9506", 40 | PCA953X_TYPE | PCA_INT, },
@@ -1198,6 +1199,7 @@ static int pca953x_resume(struct device *dev)
#define OF_957X(__nrgpio, __int) (void *)(__nrgpio | PCA957X_TYPE | __int)

static const struct of_device_id pca953x_dt_ids[] = {
+ { .compatible = "nxp,pca6408", .data = OF_953X(8, PCA_INT), },
{ .compatible = "nxp,pca6416", .data = OF_953X(16, PCA_INT), },
{ .compatible = "nxp,pca9505", .data = OF_953X(40, PCA_INT), },
{ .compatible = "nxp,pca9506", .data = OF_953X(40, PCA_INT), },
--
2.7.4



2022-05-05 09:22:59

by Justin Chen

[permalink] [raw]
Subject: Re: [PATCH 1/2] gpio: pca953xx: Add support for pca6408

On Wed, May 4, 2022 at 10:25 AM Justin Chen <[email protected]> wrote:
>
> Add support for pca6408 which is the 8-bit version of the pca6416.
>
> https://www.nxp.com/docs/en/data-sheet/PCA6408A.pdf
>
> Signed-off-by: Justin Chen <[email protected]>
> ---
> drivers/gpio/gpio-pca953x.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
> index d2fe76f..2d0b080 100644
> --- a/drivers/gpio/gpio-pca953x.c
> +++ b/drivers/gpio/gpio-pca953x.c
> @@ -71,6 +71,7 @@
> #define PCA_CHIP_TYPE(x) ((x) & PCA_TYPE_MASK)
>
> static const struct i2c_device_id pca953x_id[] = {
> + { "pca6408", 8 | PCA953x_TYPE | PCA_INT, },
Apologies, typo here. Should be capital "x". Will send a v2.

Justin
> { "pca6416", 16 | PCA953X_TYPE | PCA_INT, },
> { "pca9505", 40 | PCA953X_TYPE | PCA_INT, },
> { "pca9506", 40 | PCA953X_TYPE | PCA_INT, },
> @@ -1198,6 +1199,7 @@ static int pca953x_resume(struct device *dev)
> #define OF_957X(__nrgpio, __int) (void *)(__nrgpio | PCA957X_TYPE | __int)
>
> static const struct of_device_id pca953x_dt_ids[] = {
> + { .compatible = "nxp,pca6408", .data = OF_953X(8, PCA_INT), },
> { .compatible = "nxp,pca6416", .data = OF_953X(16, PCA_INT), },
> { .compatible = "nxp,pca9505", .data = OF_953X(40, PCA_INT), },
> { .compatible = "nxp,pca9506", .data = OF_953X(40, PCA_INT), },
> --
> 2.7.4
>

2022-05-06 21:57:16

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH 1/2] gpio: pca953xx: Add support for pca6408

Hi Justin,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on v5.18-rc5]
[also build test ERROR on next-20220504]
[cannot apply to linusw-gpio/for-next]
[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/intel-lab-lkp/linux/commits/Justin-Chen/Add-support-for-NXP-PCA6408/20220505-020844
base: 672c0c5173427e6b3e2a9bbb7be51ceeec78093a
config: microblaze-randconfig-r031-20220501 (https://download.01.org/0day-ci/archive/20220505/[email protected]/config)
compiler: microblaze-linux-gcc (GCC) 11.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
# https://github.com/intel-lab-lkp/linux/commit/d45d7c84e1613b51cb1eb90ef6d92f4112a45925
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Justin-Chen/Add-support-for-NXP-PCA6408/20220505-020844
git checkout d45d7c84e1613b51cb1eb90ef6d92f4112a45925
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=microblaze SHELL=/bin/bash drivers/gpio/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>

All errors (new ones prefixed by >>):

>> drivers/gpio/gpio-pca953x.c:74:27: error: 'PCA953x_TYPE' undeclared here (not in a function); did you mean 'PCA953X_TYPE'?
74 | { "pca6408", 8 | PCA953x_TYPE | PCA_INT, },
| ^~~~~~~~~~~~
| PCA953X_TYPE


vim +74 drivers/gpio/gpio-pca953x.c

72
73 static const struct i2c_device_id pca953x_id[] = {
> 74 { "pca6408", 8 | PCA953x_TYPE | PCA_INT, },
75 { "pca6416", 16 | PCA953X_TYPE | PCA_INT, },
76 { "pca9505", 40 | PCA953X_TYPE | PCA_INT, },
77 { "pca9506", 40 | PCA953X_TYPE | PCA_INT, },
78 { "pca9534", 8 | PCA953X_TYPE | PCA_INT, },
79 { "pca9535", 16 | PCA953X_TYPE | PCA_INT, },
80 { "pca9536", 4 | PCA953X_TYPE, },
81 { "pca9537", 4 | PCA953X_TYPE | PCA_INT, },
82 { "pca9538", 8 | PCA953X_TYPE | PCA_INT, },
83 { "pca9539", 16 | PCA953X_TYPE | PCA_INT, },
84 { "pca9554", 8 | PCA953X_TYPE | PCA_INT, },
85 { "pca9555", 16 | PCA953X_TYPE | PCA_INT, },
86 { "pca9556", 8 | PCA953X_TYPE, },
87 { "pca9557", 8 | PCA953X_TYPE, },
88 { "pca9574", 8 | PCA957X_TYPE | PCA_INT, },
89 { "pca9575", 16 | PCA957X_TYPE | PCA_INT, },
90 { "pca9698", 40 | PCA953X_TYPE, },
91
92 { "pcal6416", 16 | PCA953X_TYPE | PCA_LATCH_INT, },
93 { "pcal6524", 24 | PCA953X_TYPE | PCA_LATCH_INT, },
94 { "pcal9535", 16 | PCA953X_TYPE | PCA_LATCH_INT, },
95 { "pcal9554b", 8 | PCA953X_TYPE | PCA_LATCH_INT, },
96 { "pcal9555a", 16 | PCA953X_TYPE | PCA_LATCH_INT, },
97
98 { "max7310", 8 | PCA953X_TYPE, },
99 { "max7312", 16 | PCA953X_TYPE | PCA_INT, },
100 { "max7313", 16 | PCA953X_TYPE | PCA_INT, },
101 { "max7315", 8 | PCA953X_TYPE | PCA_INT, },
102 { "max7318", 16 | PCA953X_TYPE | PCA_INT, },
103 { "pca6107", 8 | PCA953X_TYPE | PCA_INT, },
104 { "tca6408", 8 | PCA953X_TYPE | PCA_INT, },
105 { "tca6416", 16 | PCA953X_TYPE | PCA_INT, },
106 { "tca6424", 24 | PCA953X_TYPE | PCA_INT, },
107 { "tca9539", 16 | PCA953X_TYPE | PCA_INT, },
108 { "tca9554", 8 | PCA953X_TYPE | PCA_INT, },
109 { "xra1202", 8 | PCA953X_TYPE },
110 { }
111 };
112 MODULE_DEVICE_TABLE(i2c, pca953x_id);
113

--
0-DAY CI Kernel Test Service
https://01.org/lkp