Re: [PATCH v4 19/21] regulator: hi6421v600-regulator: move it from staging

2021-01-19 Thread Mauro Carvalho Chehab
Em Tue, 19 Jan 2021 16:19:50 + Mark Brown escreveu: > On Tue, Jan 19, 2021 at 05:10:45PM +0100, Mauro Carvalho Chehab wrote: > > > +static int hi6421_spmi_regulator_get_voltage_sel(struct regulator_dev > > *rdev) > > +{ > > > +static int hi6421_spmi_regulator_set_voltage_sel(struct regul

Re: [PATCH v4 19/21] regulator: hi6421v600-regulator: move it from staging

2021-01-19 Thread Mark Brown
On Tue, Jan 19, 2021 at 05:10:45PM +0100, Mauro Carvalho Chehab wrote: > +static int hi6421_spmi_regulator_get_voltage_sel(struct regulator_dev *rdev) > +{ > +static int hi6421_spmi_regulator_set_voltage_sel(struct regulator_dev *rdev, > + unsigned int

[PATCH v4 04/21] staging: hikey9xx: hi6421v600-regulator: do some cleanups

2021-01-19 Thread Mauro Carvalho Chehab
Use C99 comments at the beginning of the file and remove uneeded includes. Signed-off-by: Mauro Carvalho Chehab --- .../staging/hikey9xx/hi6421v600-regulator.c | 43 +++ 1 file changed, 16 insertions(+), 27 deletions(-) diff --git a/drivers/staging/hikey9xx/hi6421v600-regulato

[PATCH v4 12/21] staging: hikey9xx: hi6421v600-regulator: fix get_optimum_mode

2021-01-19 Thread Mauro Carvalho Chehab
During the driver refactor, a regression broke the logic inside hi6421_spmi_regulator_get_optimum_mode(). Basically, if a LDO has eco_uA == 0, it doesn't support economic mode. So, it should return REGULATOR_MODE_NORMAL. If economic mode is supported, it can return either REGULATOR_MODE_IDLE or RE

[PATCH v4 15/21] staging: hikey9xx: hi6421-spmi-pmic: update copyright

2021-01-19 Thread Mauro Carvalho Chehab
Remove the GPL boilerplate, as SPDX tag already points to the license terms and add a new copyright for Huawei. Signed-off-by: Mauro Carvalho Chehab --- drivers/staging/hikey9xx/hi6421-spmi-pmic.c | 24 ++--- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/drivers/

[PATCH v4 19/21] regulator: hi6421v600-regulator: move it from staging

2021-01-19 Thread Mauro Carvalho Chehab
This driver is ready for mainstream. Move it out of staging. Signed-off-by: Mauro Carvalho Chehab --- MAINTAINERS | 7 +- drivers/regulator/Kconfig | 8 + drivers/regulator/Makefile| 1 + drivers/regulator/hi6421v600

[PATCH v4 11/21] staging: hikey9xx: hi6421v600-regulator: cleanup comments

2021-01-19 Thread Mauro Carvalho Chehab
Remove obvious comments and fix the comment for the HI6421V600_LDO() macro. While on it, use kernel-doc notation for HI6421V600_LDO(), as kernel-doc can check if the arguments match its description. Signed-off-by: Mauro Carvalho Chehab --- .../staging/hikey9xx/hi6421v600-regulator.c | 27

[PATCH v4 05/21] staging: hikey9xx: hi6421v600-regulator: move LDO config from DT

2021-01-19 Thread Mauro Carvalho Chehab
Instead of storing regulator LDO configuration inside the DT, move it to be part of the driver itself. Signed-off-by: Mauro Carvalho Chehab --- .../staging/hikey9xx/hi6421v600-regulator.c | 381 +++--- 1 file changed, 153 insertions(+), 228 deletions(-) diff --git a/drivers/stagin

[PATCH v4 17/21] spmi: hisi-spmi-controller: move driver from staging

2021-01-19 Thread Mauro Carvalho Chehab
The Hisilicon 6421v600 SPMI driver is ready for mainstream. So, move it from staging. Signed-off-by: Mauro Carvalho Chehab --- .../spmi/hisilicon,hisi-spmi-controller.yaml | 75 MAINTAINERS | 7 + drivers/spmi/Kconfig | 9 +

[PATCH v4 01/21] staging: hikey9xx: hisilicon, hisi-spmi-controller.yaml fix bindings

2021-01-19 Thread Mauro Carvalho Chehab
Fix a few warnings produced by make dt_binding_check. Signed-off-by: Mauro Carvalho Chehab --- .../hisilicon,hisi-spmi-controller.yaml | 19 --- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/drivers/staging/hikey9xx/hisilicon,hisi-spmi-controller.yaml b/dr

[PATCH v4 08/21] staging: hikey9xx: hi6421v600-regulator: do some cleanups

2021-01-19 Thread Mauro Carvalho Chehab
In preparation for de-staging, do some cleanups: - Return error codes from hi6421_spmi_pmic_rmw(); - Remove a debug message; - Change the module description; - a few minor coding style adjustments. Signed-off-by: Mauro Carvalho Chehab --- .../staging/hikey9xx/hi6421v600-regulator.c | 37 +

[PATCH v4 14/21] staging: hikey9xx: spmi driver: convert to regmap

2021-01-19 Thread Mauro Carvalho Chehab
Instead of doing its own SPMI I/O implementation, use the already-existing regmap one. Signed-off-by: Mauro Carvalho Chehab --- drivers/staging/hikey9xx/hi6421-spmi-pmic.c | 115 ++ .../staging/hikey9xx/hi6421v600-regulator.c | 26 ++-- include/linux/mfd/hi6421-spmi-pmic.h

[PATCH v4 18/21] mfd: hi6421-spmi-pmic: move driver from staging

2021-01-19 Thread Mauro Carvalho Chehab
This driver is ready for mainstream. So, move it out of staging. Signed-off-by: Mauro Carvalho Chehab --- .../mfd/hisilicon,hi6421-spmi-pmic.yaml | 135 + MAINTAINERS | 7 + drivers/mfd/Kconfig | 15 + drivers/mfd/Makef

[PATCH v4 06/21] staging: hikey9xx: hi6421v600-regulator: cleanup debug msgs

2021-01-19 Thread Mauro Carvalho Chehab
While those were useful during port time from downstream version, let's get rid of them for good, as it is possible to get about the same things by enabling regulator debugging code. Signed-off-by: Mauro Carvalho Chehab --- .../staging/hikey9xx/hi6421v600-regulator.c | 47 ++-

[PATCH v4 10/21] staging: hikey9xx: hi6421v600-regulator: fix delay logic

2021-01-19 Thread Mauro Carvalho Chehab
The original driver, which can be seen at commit 42f24d9d446a ("staging: regulator: add a regulator driver for HiSilicon 6421v600 SPMI PMIC") had a complex logic to ensure that there won't be multiple power enable/disable commands running at the same time. At the original logic, it were ensured th

[PATCH v4 03/21] staging: hikey9xx: hisi-spmi-controller: clean sparse warnings

2021-01-19 Thread Mauro Carvalho Chehab
Sparse complains about __be32 conversions: drivers/spmi/hisi-spmi-controller.c drivers/spmi/hisi-spmi-controller.c:164:24: warning: cast to restricted __be32 drivers/spmi/hisi-spmi-controller.c drivers/spmi/hisi-spmi-controller.c:164:24: warning: cast to restricted __be32

[PATCH v4 02/21] staging: hikey9xx: hisilicon, hi6421-spmi-pmic.yaml: simplify props

2021-01-19 Thread Mauro Carvalho Chehab
As all regulator-specific properties got moved to be part of the driver, remove them from the DT spec. Signed-off-by: Mauro Carvalho Chehab --- .../hikey9xx/hisilicon,hi6421-spmi-pmic.yaml | 106 +++--- 1 file changed, 40 insertions(+), 66 deletions(-) diff --git a/drivers/staging/

[PATCH v4 00/21] Move Hisilicon 6421v600 SPMI driver set out of staging

2021-01-19 Thread Mauro Carvalho Chehab
Hi Mark/Lee, This patch series finish addressing support for Hikey 970 SPMI controller, PMIC and regulators. I removed some unrelated DT patches from this series, plus the Hikey 970 PHY USB3 code from it, in order to avoid mixing different stuff on this series[1]. [1] Those unrelated patches wer

[PATCH v4 16/21] staging: hikey9xx: simplify includes

2021-01-19 Thread Mauro Carvalho Chehab
There are several uneeded includes. Remove them. Signed-off-by: Mauro Carvalho Chehab --- drivers/staging/hikey9xx/hi6421-spmi-pmic.c | 8 1 file changed, 8 deletions(-) diff --git a/drivers/staging/hikey9xx/hi6421-spmi-pmic.c b/drivers/staging/hikey9xx/hi6421-spmi-pmic.c index 9310a9

[PATCH v4 13/21] staging: hikey9xx: hisilicon, hi6421-spmi-pmic.yaml: cleanup a warning

2021-01-19 Thread Mauro Carvalho Chehab
There's no additionalProperties field at the yaml file, causing a warning when checking it. Signed-off-by: Mauro Carvalho Chehab --- drivers/staging/hikey9xx/hisilicon,hi6421-spmi-pmic.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/hikey9xx/hisilicon,hi6421-spmi-pmic.

[PATCH v4 09/21] staging: hikey9xx: hi6421v600-regulator: update copyright

2021-01-19 Thread Mauro Carvalho Chehab
Remove the GPL boilerplate, as SPDX tag already points to the license terms and add a new copyright for Huawei. Signed-off-by: Mauro Carvalho Chehab --- drivers/staging/hikey9xx/hi6421v600-regulator.c | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/staging/h

[PATCH v4 07/21] staging: hikey9xx: hi6421v600-regulator: get rid of an static data

2021-01-19 Thread Mauro Carvalho Chehab
Move it to be inside the private data struct. Signed-off-by: Mauro Carvalho Chehab --- drivers/staging/hikey9xx/hi6421v600-regulator.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/staging/hikey9xx/hi6421v600-regulator.c b/drivers/staging/hikey9xx/hi6421

Re: [PATCH v3 15/18] mfd: hi6421-spmi-pmic: move driver from staging

2021-01-19 Thread Mauro Carvalho Chehab
Em Tue, 19 Jan 2021 13:46:22 + Mark Brown escreveu: > On Tue, Jan 19, 2021 at 11:14:20AM +0100, Mauro Carvalho Chehab wrote: > > > +int hi6421_spmi_pmic_read(struct hi6421_spmi_pmic *pmic, int reg) > > +{ > > + struct spmi_device *pdev; > > + u8 read_value = 0; > > + u32 ret; > > + > >

Re: [PATCH v3 15/18] mfd: hi6421-spmi-pmic: move driver from staging

2021-01-19 Thread Mark Brown
On Tue, Jan 19, 2021 at 11:14:20AM +0100, Mauro Carvalho Chehab wrote: > +int hi6421_spmi_pmic_read(struct hi6421_spmi_pmic *pmic, int reg) > +{ > + struct spmi_device *pdev; > + u8 read_value = 0; > + u32 ret; > + > + pdev = to_spmi_device(pmic->dev); > + if (!pdev) { > +

[PATCH v4 5/5] phy: phy-hi3670-usb3: move driver from staging into phy

2021-01-19 Thread Mauro Carvalho Chehab
The phy USB3 driver for Hisilicon 970 (hi3670) is ready for mainstream. Mode it from staging into the main driver's phy/ directory. Signed-off-by: Mauro Carvalho Chehab --- .../bindings/phy/hisilicon,hi3670-usb3.yaml | 73 ++ MAINTAINERS | 9 +- drivers/phy

[PATCH v4 1/5] staging: hikey9xx: phy-hi3670-usb3: use bitfield macros

2021-01-19 Thread Mauro Carvalho Chehab
Cleanup the bitfield macros by using FIELD_PREP() and GENMASK(). While here, place all hexadecimal values in lowercase. Signed-off-by: Mauro Carvalho Chehab --- drivers/staging/hikey9xx/phy-hi3670-usb3.c | 61 ++ 1 file changed, 28 insertions(+), 33 deletions(-) diff --git

[PATCH v4 3/5] staging: hikey9xx: phy-hi3670-usb3: hi3670_is_abbclk_seleted() returns bool

2021-01-19 Thread Mauro Carvalho Chehab
There are a few issues on this function: 1. Instead of using 1/0 for true/false, change the type to boolean; 2. there's a typo there: seleted -> selected 3. It's logic is reversed. Address them. Signed-off-by: Mauro Carvalho Chehab --- drivers/staging/hikey9xx/phy-hi3670-usb3.c | 14 ++

[PATCH v4 0/5] Promote Hikey 970 USB phy out of staging

2021-01-19 Thread Mauro Carvalho Chehab
Hi Vinod/Rob, This series moves the Hikey 970 USB PHY driver out of staging. Patches 1 to 4 contain the fixes from staging. Patch 5 moves the driver from staging: $ git show 82ce73ac9a38 --summary ... rename drivers/staging/hikey9xx/phy-hi3670-usb3.yaml => Documentatio

[PATCH v4 4/5] staging: hikey9xx: phy-hi3670-usb3.yaml: add a blank line

2021-01-19 Thread Mauro Carvalho Chehab
Add a blank line after maintainers field. Signed-off-by: Mauro Carvalho Chehab --- drivers/staging/hikey9xx/phy-hi3670-usb3.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/hikey9xx/phy-hi3670-usb3.yaml b/drivers/staging/hikey9xx/phy-hi3670-usb3.yaml index 125a5d6546ae..

[PATCH v4 2/5] staging: hikey9xx: phy-hi3670-usb3: adjust retry logic

2021-01-19 Thread Mauro Carvalho Chehab
Instead of running a loop up to 100k times, add a small delay inside it, running it up to 10 times, waiting up to 100-200 us. It should be noticed that I don't have the datasheet for this PHY. So, not sure if this time will cover all situations. Signed-off-by: Mauro Carvalho Chehab --- drivers/

Re: [PATCH v2 4/4] phy: phy-hi3670-usb3: move driver from staging into phy

2021-01-19 Thread Mauro Carvalho Chehab
Em Thu, 14 Jan 2021 19:47:31 -0600 Rob Herring escreveu: > On Thu, Jan 14, 2021 at 06:35:44PM +0100, Mauro Carvalho Chehab wrote: > > The phy USB3 driver for Hisilicon 970 (hi3670) is ready > > for mainstream. Mode it from staging into the main driver's > > phy/ directory. > > > > Signed-off-by:

Re: [PATCH v2 3/4] staging: hikey9xx: phy-hi3670-usb3.c: hi3670_is_abbclk_seleted() returns bool

2021-01-19 Thread Mauro Carvalho Chehab
Em Tue, 19 Jan 2021 09:56:31 +0300 Dan Carpenter escreveu: > On Thu, Jan 14, 2021 at 09:56:41AM -0800, Joe Perches wrote: > > On Thu, 2021-01-14 at 18:35 +0100, Mauro Carvalho Chehab wrote: > > > Instead of using 1/0 for true/false, change the type to boolean > > > and change the returned value

[PATCH v3 15/18] mfd: hi6421-spmi-pmic: move driver from staging

2021-01-19 Thread Mauro Carvalho Chehab
This driver is ready for mainstream. So, move it out of staging. Signed-off-by: Mauro Carvalho Chehab --- .../mfd/hisilicon,hi6421-spmi-pmic.yaml | 135 +++ MAINTAINERS | 7 + drivers/mfd/Kconfig | 15 + drivers/mfd/Makefil

[PATCH v3 16/18] regulator: hi6421v600-regulator: move it from staging

2021-01-19 Thread Mauro Carvalho Chehab
This driver is ready for mainstream. Move it out of staging. Signed-off-by: Mauro Carvalho Chehab --- MAINTAINERS | 7 +- drivers/regulator/Kconfig | 8 + drivers/regulator/Makefile| 1 + drivers/regulator/hi6421v600

[PATCH v3 03/18] staging: hikey9xx: hisi-spmi-controller: clean sparse warnings

2021-01-19 Thread Mauro Carvalho Chehab
Sparse complains about __be32 conversions: drivers/spmi/hisi-spmi-controller.c drivers/spmi/hisi-spmi-controller.c:164:24: warning: cast to restricted __be32 drivers/spmi/hisi-spmi-controller.c drivers/spmi/hisi-spmi-controller.c:164:24: warning: cast to restricted __be32

[PATCH v3 14/18] spmi: hi6421-spmi-pmic: move driver from staging

2021-01-19 Thread Mauro Carvalho Chehab
The Hisilicon 6421v600 SPMI driver is ready for mainstream. So, move it from staging. Signed-off-by: Mauro Carvalho Chehab --- .../spmi/hisilicon,hisi-spmi-controller.yaml | 75 MAINTAINERS | 7 + drivers/spmi/Kconfig | 9 +

[PATCH v3 11/18] staging: hikey9xx: hi6421v600-regulator: cleanup comments

2021-01-19 Thread Mauro Carvalho Chehab
Remove obvious comments and fix the comment for the HI6421V600_LDO() macro. While on it, use kernel-doc notation for HI6421V600_LDO(), as kernel-doc can check if the arguments match its description. Signed-off-by: Mauro Carvalho Chehab --- .../staging/hikey9xx/hi6421v600-regulator.c | 27

[PATCH v3 04/18] staging: hikey9xx: hi6421v600-regulator: do some cleanups

2021-01-19 Thread Mauro Carvalho Chehab
Use C99 comments at the beginning of the file and remove uneeded includes. Signed-off-by: Mauro Carvalho Chehab --- .../staging/hikey9xx/hi6421v600-regulator.c | 43 +++ 1 file changed, 16 insertions(+), 27 deletions(-) diff --git a/drivers/staging/hikey9xx/hi6421v600-regulato

[PATCH v3 06/18] staging: hikey9xx: hi6421v600-regulator: cleanup debug msgs

2021-01-19 Thread Mauro Carvalho Chehab
While those were useful during port time from downstream version, let's get rid of them for good, as it is possible to get about the same things by enabling regulator debugging code. Signed-off-by: Mauro Carvalho Chehab --- .../staging/hikey9xx/hi6421v600-regulator.c | 47 ++-

[PATCH v3 02/18] staging: hikey9xx: hisilicon, hi6421-spmi-pmic.yaml: simplify props

2021-01-19 Thread Mauro Carvalho Chehab
As all regulator-specific properties got moved to be part of the driver, remove them from the DT spec. Signed-off-by: Mauro Carvalho Chehab --- .../hikey9xx/hisilicon,hi6421-spmi-pmic.yaml | 106 +++--- 1 file changed, 40 insertions(+), 66 deletions(-) diff --git a/drivers/staging/

[PATCH v3 00/18] Move Hisilicon 6421v600 SPMI driver set out of staging

2021-01-19 Thread Mauro Carvalho Chehab
Hi Mark/Lee, This patch series finish addressing support for Hikey 970 SPMI controller, PMIC and regulators. I removed some unrelated DT patches from this series, plus the Hikey 970 PHY USB3 code from it, in order to avoid mixing different stuff on this series[1]. [1] Those unrelated patches wer

[PATCH v3 08/18] staging: hikey9xx: hi6421v600-regulator: do some cleanups

2021-01-19 Thread Mauro Carvalho Chehab
In preparation for de-staging, do some cleanups: - Return error codes from hi6421_spmi_pmic_rmw(); - Remove a debug message; - Change the module description; - a few minor coding style adjustments. Signed-off-by: Mauro Carvalho Chehab --- .../staging/hikey9xx/hi6421v600-regulator.c | 37 +

[PATCH v3 05/18] staging: hikey9xx: hi6421v600-regulator: move LDO config from DT

2021-01-19 Thread Mauro Carvalho Chehab
Instead of storing regulator LDO configuration inside the DT, move it to be part of the driver itself. Signed-off-by: Mauro Carvalho Chehab --- .../staging/hikey9xx/hi6421v600-regulator.c | 380 +++--- 1 file changed, 152 insertions(+), 228 deletions(-) diff --git a/drivers/stagin

[PATCH v3 09/18] staging: hikey9xx: hi6421v600-regulator: update copyright

2021-01-19 Thread Mauro Carvalho Chehab
Remove the GPL boilerplate, as SPDX tag already points to the license terms and add a new copyright for Huawei. Signed-off-by: Mauro Carvalho Chehab --- drivers/staging/hikey9xx/hi6421v600-regulator.c | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/staging/h

[PATCH v3 13/18] staging: hikey9xx: hisilicon, hi6421-spmi-pmic.yaml: cleanup a warning

2021-01-19 Thread Mauro Carvalho Chehab
There's no additionalProperties field at the yaml file, causing a warning when checking it. Signed-off-by: Mauro Carvalho Chehab --- drivers/staging/hikey9xx/hisilicon,hi6421-spmi-pmic.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/hikey9xx/hisilicon,hi6421-spmi-pmic.

[PATCH v3 10/18] staging: hikey9xx: hi6421v600-regulator: fix delay logic

2021-01-19 Thread Mauro Carvalho Chehab
The original driver, which can be seen at commit 42f24d9d446a ("staging: regulator: add a regulator driver for HiSilicon 6421v600 SPMI PMIC") had a complex logic to ensure that there won't be multiple power enable/disable commands running at the same time. At the original logic, it were ensured th

[PATCH v3 12/18] staging: hikey9xx: hi6421v600-regulator: fix get_optimum_mode

2021-01-19 Thread Mauro Carvalho Chehab
During the driver refactor, a regression broke the logic inside hi6421_spmi_regulator_get_optimum_mode(). Basically, if a LDO has eco_uA == 0, it doesn't support economic mode. So, it should return REGULATOR_MODE_NORMAL. If economic mode is supported, it can return either REGULATOR_MODE_IDLE or RE

[PATCH v3 07/18] staging: hikey9xx: hi6421v600-regulator: get rid of an static data

2021-01-19 Thread Mauro Carvalho Chehab
Move it to be inside the private data struct. Signed-off-by: Mauro Carvalho Chehab --- drivers/staging/hikey9xx/hi6421v600-regulator.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/staging/hikey9xx/hi6421v600-regulator.c b/drivers/staging/hikey9xx/hi6421

[PATCH v3 01/18] staging: hikey9xx: hisilicon, hisi-spmi-controller.yaml fix bindings

2021-01-19 Thread Mauro Carvalho Chehab
Fix a few warnings produced by make dt_binding_check. Signed-off-by: Mauro Carvalho Chehab --- .../hisilicon,hisi-spmi-controller.yaml | 19 --- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/drivers/staging/hikey9xx/hisilicon,hisi-spmi-controller.yaml b/dr

Re: [PATCH 6/6] wlan-ng: clean up reused macros

2021-01-19 Thread Dan Carpenter
On Mon, Jan 18, 2021 at 02:09:56AM +0100, Johannes Czekay wrote: > This patch cleans up two "macro argument reuse" warnings by checkpatch. > This should also make the code much more readable. > > Signed-off-by: Johannes Czekay > Co-developed-by: Nicolai Fischer > Signed-off-by: Nicolai Fischer