[PATCH v3 02/11] staging: mt7621-gpio: update TODO file

2018-05-16 Thread Sergio Paracuellos
This commit updates TODO file with missing things to get this driver ready to be mainlined. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/TODO | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/mt7621-gpio/TODO b/drivers/staging/mt7621

[PATCH v3 06/11] staging: mt7621-dts: add interrupt device tree nodes for the gpio controller

2018-05-16 Thread Sergio Paracuellos
The GPIO controller of mt7621 can receive interrupts on any of the GPIOs, either edge or level. It then interrupts the CPU using GIC INT12. Update device tree accordly. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-dts/mt7621.dtsi | 3 +++ 1 file changed, 3 insertions(+) diff

[PATCH] staging: ks7010: avoid casting inside cpu_to_* assignments

2018-05-16 Thread Sergio Paracuellos
cpu_to_*() functions already have a cast to u* built in, so the cast is never required. Review and remove all of them along the code. Signed-off-by: Sergio Paracuellos --- drivers/staging/ks7010/ks7010_sdio.c | 4 +-- drivers/staging/ks7010/ks_hostif.c | 59

Re: [PATCH v2 08/11] staging: mt7621-gpio: avoid devm_kzalloc() hidden inside declarations

2018-05-16 Thread Sergio Paracuellos
On Wed, May 16, 2018 at 12:40:57PM +0300, Dan Carpenter wrote: > On Wed, May 16, 2018 at 10:56:05AM +0200, Sergio Paracuellos wrote: > > On Wed, May 16, 2018 at 11:04:52AM +0300, Dan Carpenter wrote: > > > On Wed, May 16, 2018 at 07:30:01AM +0200, Sergio Paracuellos wrote: &g

[PATCH v4 00/11] staging: mt7621-gpio: use mediatek as binding instead of custom mtk

2018-05-19 Thread Sergio Paracuellos
them - Other minor code cleanups have been added also. After this changes only testing interrupts should be remaining to get this out of staging. Hope this helps. Best regards, Sergio Sergio Paracuellos (11): staging: mt7621-gpio: dt-bindings: add documentation for mt7621-gpio staging: m

[PATCH v4 05/11] staging: mt7621-gpio: avoid use of globals and use platform_data instead

2018-05-19 Thread Sergio Paracuellos
driver data along the code using kernel api's so globals are not needed anymore. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 92 ++- 1 file changed, 65 insertions(+), 27 deletions(-) diff --git a/drivers/staging/mt7621-gpio

[PATCH v4 11/11] staging: mt7621-gpio: update TODO list

2018-05-19 Thread Sergio Paracuellos
Some of the remaining stuff included in TODO list have been complete. So update this file accordly. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/TODO | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/mt7621-gpio/TODO b/drivers/staging/mt7621-gpio/TODO

[PATCH v4 07/11] staging: mt7621-gpio: dt-bindings: add interrupt nodes to bindings doc

2018-05-19 Thread Sergio Paracuellos
Interrupt related stuff for gpio controller in mt7621 was missing in device tree documentation. Add it to complete documentation for this driver. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/mediatek,mt7621-gpio.txt | 9 - 1 file changed, 8 insertions(+), 1 deletion

[PATCH v4 10/11] staging: mt7621-gpio: use MTK_BANK_WIDTH instead of magic number

2018-05-19 Thread Sergio Paracuellos
There are some places where magic number '32' is being used to get the gpio bank. There already exist a definition MTK_BANK_WIDTH with this value, so just use it instead. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 6 +++--- 1 file changed, 3

[PATCH v4 03/11] staging: mt7621-dts: update gpios related entries to use 'mediatek'

2018-05-19 Thread Sergio Paracuellos
Gpio driver for mt7621 is using 'mtk' as binding but in the kernel is already defined one for this maker which is 'mediatek'. Update device tree to use the correct one. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-dts/mt7621.dtsi | 8 1 file changed

[PATCH v4 06/11] staging: mt7621-dts: add interrupt device tree nodes for the gpio controller

2018-05-19 Thread Sergio Paracuellos
The GPIO controller of mt7621 can receive interrupts on any of the GPIOs, either edge or level. It then interrupts the CPU using GIC INT12. Update device tree accordly. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-dts/mt7621.dtsi | 3 +++ 1 file changed, 3 insertions(+) diff

[PATCH v4 01/11] staging: mt7621-gpio: dt-bindings: add documentation for mt7621-gpio

2018-05-19 Thread Sergio Paracuellos
This commit add missing dt bindings documentation for mt7621-gpio driver. There is some missing stuff here about interrupts with is not also being used in the mt7621.dtsi file. So just include in staging a incomplete version before moving this to kernel's dt-bindings place. Signed-off-by: S

[PATCH v4 08/11] staging: mt7621-gpio: avoid devm_kzalloc() hidden inside declarations and refactor function a bit

2018-05-19 Thread Sergio Paracuellos
for a valid gpio id is wrong and it should be greater or equal instead of only greater so update to be the good one. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/staging/mt7

[PATCH v4 02/11] staging: mt7621-gpio: update TODO file

2018-05-19 Thread Sergio Paracuellos
This commit updates TODO file with missing things to get this driver ready to be mainlined. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/TODO | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/mt7621-gpio/TODO b/drivers/staging/mt7621

[PATCH v4 04/11] staging: mt7621-gpio: replace 'mtk' to use correct one 'mediatek'

2018-05-19 Thread Sergio Paracuellos
Gpio driver is using mtk and there is already 'mediatek' binding defined for this maker. Update driver to use it instead the custom one 'mtk'. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deleti

[PATCH v4 00/11] staging: mt7621-gpio: use mediatek as binding instead of custom mtk

2018-05-19 Thread Sergio Paracuellos
them - Other minor code cleanups have been added also. After this changes only testing interrupts should be remaining to get this out of staging. Hope this helps. Best regards, Sergio Sergio Paracuellos (11): staging: mt7621-gpio: dt-bindings: add documentation for mt7621-gpio staging: m

[PATCH v4 09/11] staging: mt7621-gpio: use ternary operator in return in mediatek_gpio_get_direction

2018-05-19 Thread Sergio Paracuellos
This commits replaces if statement and two returns in favour of a only one return using a ternary operator. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging/mt7621-gpio/gpio

Re: [PATCH v3 05/11] staging: mt7621-gpio: avoid use of globals and use platform_data instead

2018-05-19 Thread Sergio Paracuellos
On Sat, May 19, 2018 at 08:51:43PM +1000, NeilBrown wrote: > On Wed, May 16 2018, Sergio Paracuellos wrote: > > > Gpio driver have a some globals which can be avoided just > > using platform_data in a proper form. This commit adds a new > > struct mtk_data which inclu

Re: [PATCH v3 05/11] staging: mt7621-gpio: avoid use of globals and use platform_data instead

2018-05-20 Thread Sergio Paracuellos
On Sun, May 20, 2018 at 08:44:18AM +1000, NeilBrown wrote: > On Sat, May 19 2018, Sergio Paracuellos wrote: > > > On Sat, May 19, 2018 at 08:51:43PM +1000, NeilBrown wrote: > >> On Wed, May 16 2018, Sergio Paracuellos wrote: > >> > >> > Gpio driver hav

[PATCH] staging: mt7621-gpio: retrieve correct pointers in interrupt related functions

2018-05-20 Thread Sergio Paracuellos
The data passed between irq related functions and the ones which have been retrieved where different. Also first data haven't properly set on irq_domain_add_linear call where it was passing NULL instead. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c

Re: [PATCH] staging: mt7621-gpio: retrieve correct pointers in interrupt related functions

2018-05-20 Thread Sergio Paracuellos
On Sun, May 20, 2018 at 07:53:08PM +1000, NeilBrown wrote: > On Sun, May 20 2018, Sergio Paracuellos wrote: > > > The data passed between irq related functions and the ones which have > > been retrieved where different. Also first data haven't properly > > set on irq

[PATCH v5 02/10] staging: mt7621-dts: update gpios related entries to use 'mediatek'

2018-05-20 Thread Sergio Paracuellos
Gpio driver for mt7621 is using 'mtk' as binding but in the kernel is already defined one for this maker which is 'mediatek'. Update device tree to use the correct one. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-dts/mt7621.dtsi | 8 1 file changed

[PATCH v5 00/10] staging: mt7621-gpio: use mediatek as binding instead of custom mtk

2018-05-20 Thread Sergio Paracuellos
viewed and tested by NeilBrown but I don't know if I have to add those information to the patches by myself if I resend the series or should be added by you Greg when the patches are added to the kernel tree. Hope this helps. Best regards, Sergio Paracuellos Sergio Paracuellos (10): sta

[PATCH v5 01/10] staging: mt7621-gpio: dt-bindings: add documentation for mt7621-gpio

2018-05-20 Thread Sergio Paracuellos
This commit add missing dt bindings documentation for mt7621-gpio driver. There is some missing stuff here about interrupts with is not also being used in the mt7621.dtsi file. So just include in staging a incomplete version before moving this to kernel's dt-bindings place. Signed-off-by: S

[PATCH v5 05/10] staging: mt7621-dts: add interrupt device tree nodes for the gpio controller

2018-05-20 Thread Sergio Paracuellos
The GPIO controller of mt7621 can receive interrupts on any of the GPIOs, either edge or level. It then interrupts the CPU using GIC INT12. Update device tree accordly. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-dts/mt7621.dtsi | 3 +++ 1 file changed, 3 insertions(+) diff

[PATCH v5 03/10] staging: mt7621-gpio: replace 'mtk' to use correct one 'mediatek'

2018-05-20 Thread Sergio Paracuellos
Gpio driver is using mtk and there is already 'mediatek' binding defined for this maker. Update driver to use it instead the custom one 'mtk'. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deleti

[PATCH v5 08/10] staging: mt7621-gpio: use ternary operator in return in mediatek_gpio_get_direction

2018-05-20 Thread Sergio Paracuellos
This commits replaces if statement and two returns in favour of a only one return using a ternary operator. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging/mt7621-gpio/gpio

[PATCH v5 06/10] staging: mt7621-gpio: dt-bindings: add interrupt nodes to bindings doc

2018-05-20 Thread Sergio Paracuellos
Interrupt related stuff for gpio controller in mt7621 was missing in device tree documentation. Add it to complete documentation for this driver. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/mediatek,mt7621-gpio.txt | 9 - 1 file changed, 8 insertions(+), 1 deletion

[PATCH v5 04/10] staging: mt7621-gpio: avoid use of globals and use platform_data instead

2018-05-20 Thread Sergio Paracuellos
driver data along the code using kernel api's so globals are not needed anymore. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 90 +-- 1 file changed, 62 insertions(+), 28 deletions(-) diff --git a/drivers/staging/mt7621-gpio

[PATCH v5 10/10] staging: mt7621-gpio: update TODO file

2018-05-20 Thread Sergio Paracuellos
Remaining stuff included in TODO list have been complete. So update this file accordly. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/TODO | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/mt7621-gpio/TODO b/drivers/staging/mt7621-gpio/TODO index 7143905

[PATCH v5 09/10] staging: mt7621-gpio: use MTK_BANK_WIDTH instead of magic number

2018-05-20 Thread Sergio Paracuellos
There are some places where magic number '32' is being used to get the gpio bank. There already exist a definition MTK_BANK_WIDTH with this value, so just use it instead. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 6 +++--- 1 file changed, 3

[PATCH v5 07/10] staging: mt7621-gpio: avoid devm_kzalloc() hidden inside declarations and refactor function a bit

2018-05-20 Thread Sergio Paracuellos
for a valid gpio id is wrong and it should be greater or equal instead of only greater so update to be the good one. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/staging/mt7

[RESEND PATCH v5 06/10] staging: mt7621-gpio: dt-bindings: add interrupt nodes to bindings doc

2018-05-20 Thread Sergio Paracuellos
Interrupt related stuff for gpio controller in mt7621 was missing in device tree documentation. Add it to complete documentation for this driver. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/mediatek,mt7621-gpio.txt | 9 - 1 file changed, 8 insertions(+), 1 deletion

[RESEND PATCH v5 01/10] staging: mt7621-gpio: dt-bindings: add documentation for mt7621-gpio

2018-05-20 Thread Sergio Paracuellos
This commit add missing dt bindings documentation for mt7621-gpio driver. There is some missing stuff here about interrupts with is not also being used in the mt7621.dtsi file. So just include in staging a incomplete version before moving this to kernel's dt-bindings place. Signed-off-by: S

[RESEND PATCH v5 07/10] staging: mt7621-gpio: avoid devm_kzalloc() hidden inside declarations and refactor function a bit

2018-05-20 Thread Sergio Paracuellos
for a valid gpio id is wrong and it should be greater or equal instead of only greater so update to be the good one. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/staging/mt7

[RESEND PATCH v5 08/10] staging: mt7621-gpio: use ternary operator in return in mediatek_gpio_get_direction

2018-05-20 Thread Sergio Paracuellos
This commits replaces if statement and two returns in favour of a only one return using a ternary operator. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging/mt7621-gpio/gpio

[RESEND PATCH v5 00/10] staging: mt7621-gpio: use mediatek as binding instead of custom mtk

2018-05-20 Thread Sergio Paracuellos
d also. This changes have been reviewed and tested by NeilBrown but I don't know if I have to add those information to the patches by myself if I resend the series or should be added by you Greg when the patches are added to the kernel tree. Hope this helps. Best regards, Sergio Para

[RESEND PATCH v5 03/10] staging: mt7621-gpio: replace 'mtk' to use correct one 'mediatek'

2018-05-20 Thread Sergio Paracuellos
Gpio driver is using mtk and there is already 'mediatek' binding defined for this maker. Update driver to use it instead the custom one 'mtk'. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deleti

[RESEND PATCH v5 04/10] staging: mt7621-gpio: avoid use of globals and use platform_data instead

2018-05-20 Thread Sergio Paracuellos
driver data along the code using kernel api's so globals are not needed anymore. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 90 +-- 1 file changed, 62 insertions(+), 28 deletions(-) diff --git a/drivers/staging/mt7621-gpio

[RESEND PATCH v5 02/10] staging: mt7621-dts: update gpios related entries to use 'mediatek'

2018-05-20 Thread Sergio Paracuellos
Gpio driver for mt7621 is using 'mtk' as binding but in the kernel is already defined one for this maker which is 'mediatek'. Update device tree to use the correct one. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-dts/mt7621.dtsi | 8 1 file changed

[RESEND PATCH v5 09/10] staging: mt7621-gpio: use MTK_BANK_WIDTH instead of magic number

2018-05-20 Thread Sergio Paracuellos
There are some places where magic number '32' is being used to get the gpio bank. There already exist a definition MTK_BANK_WIDTH with this value, so just use it instead. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 6 +++--- 1 file changed, 3

[RESEND PATCH v5 05/10] staging: mt7621-dts: add interrupt device tree nodes for the gpio controller

2018-05-20 Thread Sergio Paracuellos
The GPIO controller of mt7621 can receive interrupts on any of the GPIOs, either edge or level. It then interrupts the CPU using GIC INT12. Update device tree accordly. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-dts/mt7621.dtsi | 3 +++ 1 file changed, 3 insertions(+) diff

[RESEND PATCH v5 10/10] staging: mt7621-gpio: update TODO file

2018-05-20 Thread Sergio Paracuellos
update TODO file accordly to last changes. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/TODO | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/mt7621-gpio/TODO b/drivers/staging/mt7621-gpio/TODO index 7143905..674930a 100644 --- a/drivers/staging/mt7621

Re: [PATCH] staging: mt7621-gpio: retrieve correct pointers in interrupt related functions

2018-05-20 Thread Sergio Paracuellos
On Sun, May 20, 2018 at 02:39:14PM +0200, Greg KH wrote: > On Sun, May 20, 2018 at 02:38:09PM +0200, Greg KH wrote: > > On Sun, May 20, 2018 at 12:18:23PM +0200, Sergio Paracuellos wrote: > > > On Sun, May 20, 2018 at 07:53:08PM +1000, NeilBrown wrote: > > > &g

Re: [PATCH] staging: mt7621-gpio: retrieve correct pointers in interrupt related functions

2018-05-20 Thread Sergio Paracuellos
On Sun, May 20, 2018 at 09:21:48PM +1000, NeilBrown wrote: > On Sun, May 20 2018, Sergio Paracuellos wrote: > > > On Sun, May 20, 2018 at 07:53:08PM +1000, NeilBrown wrote: > >> On Sun, May 20 2018, Sergio Paracuellos wrote: > >> > >> > The data passed

[PATCH 0/7] staging: mt7621-gpio: cleanups to move this driver out of staging

2018-05-25 Thread Sergio Paracuellos
nk is better to review and test this before and if all is likely to be alright just move all this stuff afterwards. Hope this helps. Best regards, Sergio Paracuellos Sergio Paracuellos (7): staging: mt7621-gpio: rename MTK_MAX_BANK into MTK_BANK_CNT staging: mt7621-gpio

[PATCH 6/7] staging: mt7621-dts: add missing properties to gpio node

2018-05-25 Thread Sergio Paracuellos
In order to let other devices reference the GPIO interrupts if necessary properties 'interrupt-controller' and '#interrupt-cells' becomes necessary. Add both of them to complete gpio device tree node. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-dts/mt7621

[PATCH 2/7] staging: mt7621-gpio: use module_platform_driver() instead subsys initcall

2018-05-25 Thread Sergio Paracuellos
rently the macro is not being used because the driver is initialized at subsys init call level but this isn't necessary since platform devices are defined in the DT as dependencies so there's no need for init calls order. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gp

[PATCH 4/7] staging: mt7621-gpio: avoid locking in mediatek_gpio_get_direction

2018-05-25 Thread Sergio Paracuellos
mediatek_gpio_get_direction function is holding across a simple read which it seems to be not neccessary at all. Just remove this locking cleaning code of this function a bit. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 7 +-- 1 file changed, 1

[PATCH 1/7] staging: mt7621-gpio: rename MTK_MAX_BANK into MTK_BANK_CNT

2018-05-25 Thread Sergio Paracuellos
his definition. Also there is another definitions which start with the same prefix MKK_BANK_ of the new name so having those with the same prefix makes all preprocessor structure to be the same. This improves readability. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt762

[PATCH 5/7] staging: mt7621-gpio: change lock place in irq mask and unmask functions

2018-05-25 Thread Sergio Paracuellos
Functions mediatek_gpio_irq_umask mediatek_gpio_irq_unmask are reading and modifying registers but only the write is being hold. It should be a complete lock instead for those which are type of "read-modify-write". This makes more sense. Signed-off-by: Sergio Paracuellos --- drive

[PATCH 7/7] staging: mt7621-gpio: dt-bindings: complete documentation for the gpio

2018-05-25 Thread Sergio Paracuellos
This commit reviews and complete documentation for gpio related stuff in the mt7621 device. It should be complete now. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/mediatek,mt7621-gpio.txt | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a

[PATCH 3/7] staging: mt7621-gpio: fix masks for gpio pin

2018-05-25 Thread Sergio Paracuellos
s into account pin and WIDTH of the bank in order to make a proper mask for the gpio pin. Also 'd->hwirq' has been replaced by 'pin' in some places because there was a 'pin' variable in changed functions with the proper value. This improves readability. Signed-off-by:

Re: [PATCH 0/7] staging: mt7621-gpio: cleanups to move this driver out of staging

2018-05-27 Thread Sergio Paracuellos
On Mon, May 28, 2018 at 1:09 AM, NeilBrown wrote: > On Fri, May 25 2018, Sergio Paracuellos wrote: > >> This patch series review all the probably missing stuff >> in order to get this driver out of staging.. >> >> All of these are described in the following mail b

[PATCH 5/6] staging: mt7621-gpio: change gc_map to don't use pointers

2018-05-28 Thread Sergio Paracuellos
There is no special gain in using pointers for 'gc_map' inside 'mtk_data' structure. We know the number of banks which is fixed to MTK_BANK_CNT and we can just statically allocate them without using kernel allocators. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7

[PATCH 0/6] staging: mt7621-gpio: last cleanups

2018-05-28 Thread Sergio Paracuellos
after previous series which are before in this mail thread. Hope this helps. Best regards, Sergio Paracuellos Sergio Paracuellos (6): staging: mt7621-dts: fix property #interrupt-cells for the gpio node staging: mt7621-gpio: dt-bindings: update documentation for #interrupt-cells

[PATCH 3/6] staging: mt7621-gpio: change 'to_mediatek_gpio' to make just a one line return

2018-05-28 Thread Sergio Paracuellos
Function to_mediatek_gpio can directly return without declaring anything else in its body improving readability. Also change pointer '*' declaration to be with return type in the upper line. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 10 +++-

[PATCH 2/6] staging: mt7621-gpio: dt-bindings: update documentation for #interrupt-cells property

2018-05-28 Thread Sergio Paracuellos
This commit update documentation for #interrupt-cells property in the gpio node which has been changed from '1' to '2'. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/mediatek,mt7621-gpio.txt | 10 -- 1 file changed, 8 insertions(+), 2 deleti

[PATCH 6/6] staging: mt7621-gpio: reorder includes alphabetically

2018-05-28 Thread Sergio Paracuellos
This commit reviews driver includes reordering them in alphabetic order. This improves readability. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/mt7621-gpio/gpio-mt7621

[PATCH 4/6] staging: mt7621-gpio: use GPIOF_DIR_OUT and GPIOF_DIR_IN macros instead of custom values

2018-05-28 Thread Sergio Paracuellos
There are macros in gpio kernel's headers to define direction of a gpio. Use them instead of return custom '0' and '1' values. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) dif

[PATCH 1/6] staging: mt7621-dts: fix property #interrupt-cells for the gpio node

2018-05-28 Thread Sergio Paracuellos
Most gpio chips have two cells for interrupts and this should be also. Set this property accordly fixing this up. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-dts/mt7621.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/mt7621-dts/mt7621

[PATCH v2] staging: mt7621-gpio: update #interrupt-cells for the gpio node

2018-05-29 Thread Sergio Paracuellos
. One more minimal change is needed two refer gpio's interrupt-parent from other nodes which is to add new 'gpio' label in the device tree. Signed-off-by: Sergio Paracuellos --- Changes in v2: - commit message has been changed with more proper one - new label to refer gpio from ot

Re: [PATCH 1/6] staging: mt7621-dts: fix property #interrupt-cells for the gpio node

2018-05-29 Thread Sergio Paracuellos
On Wed, May 30, 2018 at 09:34:39AM +1000, NeilBrown wrote: > On Tue, May 29 2018, Sergio Paracuellos wrote: > > > Most gpio chips have two cells for interrupts and this should be also. > > Set this property accordly fixing this up. > > > > Signed-off-by: Sergio Par

Re: [PATCH v2] staging: mt7621-gpio: update #interrupt-cells for the gpio node

2018-05-31 Thread Sergio Paracuellos
On Thu, May 31, 2018 at 03:27:46PM +1000, NeilBrown wrote: > On Wed, May 30 2018, Sergio Paracuellos wrote: > > > Most gpio chips have two cells for interrupts and this should be also. > > Set this property in the device tree accordly fixing this up. In order > > to make t

[RESEND PATCH 3/6] staging: mt7621-gpio: change 'to_mediatek_gpio' to make just a one line return

2018-06-01 Thread Sergio Paracuellos
Function to_mediatek_gpio can directly return without declaring anything else in its body improving readability. Also change pointer '*' declaration to be with return type in the upper line. Signed-off-by: Sergio Paracuellos Reviewed-by: NeilBrown --- drivers/staging/mt7621-gpio/gpi

[RESEND PATCH 2/6] staging: mt7621-gpio: dt-bindings: update documentation for #interrupt-cells property

2018-06-01 Thread Sergio Paracuellos
This commit update documentation for #interrupt-cells property in the gpio node which has been changed from '1' to '2'. Signed-off-by: Sergio Paracuellos Reviewed-by: NeilBrown --- drivers/staging/mt7621-gpio/mediatek,mt7621-gpio.txt | 10 -- 1 file changed

[RESEND PATCH 6/6] staging: mt7621-gpio: reorder includes alphabetically

2018-06-01 Thread Sergio Paracuellos
This commit reviews driver includes reordering them in alphabetic order. This improves readability. Signed-off-by: Sergio Paracuellos Reviewed-by: NeilBrown --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging

[RESEND PATCH 5/6] staging: mt7621-gpio: change gc_map to don't use pointers

2018-06-01 Thread Sergio Paracuellos
There is no special gain in using pointers for 'gc_map' inside 'mtk_data' structure. We know the number of banks which is fixed to MTK_BANK_CNT and we can just statically allocate them without using kernel allocators. Signed-off-by: Sergio Paracuellos Reviewed-by: NeilBrown

[RESEND PATCH 1/6] staging: mt7621-gpio: update #interrupt-cells for the gpio node

2018-06-01 Thread Sergio Paracuellos
. One more minimal change is needed two refer gpio's interrupt-parent from other nodes which is to add new 'gpio' label in the device tree. Signed-off-by: Sergio Paracuellos Reviewed-by: NeilBrown --- drivers/staging/mt7621-dts/mt7621.dtsi| 4 ++-- drivers/staging/mt7621-gpio/gpio

[RESEND PATCH 4/6] staging: mt7621-gpio: use GPIOF_DIR_OUT and GPIOF_DIR_IN macros instead of custom values

2018-06-01 Thread Sergio Paracuellos
There are macros in gpio kernel's headers to define direction of a gpio. Use them instead of return custom '0' and '1' values. Signed-off-by: Sergio Paracuellos Reviewed-by: NeilBrown --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 3 ++- 1 file changed, 2 insertion

Re: [PATCH v2] staging: mt7621-gpio: update #interrupt-cells for the gpio node

2018-06-01 Thread Sergio Paracuellos
On Fri, Jun 01, 2018 at 11:18:07AM +0200, Greg KH wrote: > On Thu, May 31, 2018 at 02:20:49PM +0200, Sergio Paracuellos wrote: > > On Thu, May 31, 2018 at 03:27:46PM +1000, NeilBrown wrote: > > > On Wed, May 30 2018, Sergio Paracuellos wrote: > > > > > >

[PATCH] staging: mt7621-gpio: move out of staging

2018-06-01 Thread Sergio Paracuellos
Move the mt7621-gpio driver out of staging and into mainline Signed-off-by: Sergio Paracuellos --- .../devicetree/bindings/gpio}/mediatek,mt7621-gpio.txt | 0 drivers/gpio/Kconfig | 7 +++ drivers/gpio/Makefile

Re: [PATCH] staging: mt7621-gpio: move out of staging

2018-06-01 Thread Sergio Paracuellos
. I see. Ok, I'll send this in the way you are pointing out here hopefully tomorrow morning :-) Thanks, Greg, > > thanks, > > greg k-h Best regards, Sergio Paracuellos ___ devel mailing list de...@linuxdriverproject.org http://dri

[PATCH 2/2] dt-bindings: document gpio-mt7621 bindings

2018-06-02 Thread Sergio Paracuellos
Add a devicetree binding documentation for the mt7621 driver. Signed-off-by: Sergio Paracuellos Reviewed-by: NeilBrown --- .../bindings/gpio/mediatek,mt7621-gpio.txt | 68 ++ 1 file changed, 68 insertions(+) create mode 100644 Documentation/devicetree/bindings

[PATCH 1/2] gpio: mediatek: add driver for MT7621

2018-06-02 Thread Sergio Paracuellos
Add driver support for gpio of MT7621 SoC. Signed-off-by: Sergio Paracuellos Reviewed-by: NeilBrown --- drivers/gpio/Kconfig | 7 + drivers/gpio/Makefile | 1 + drivers/gpio/gpio-mt7621.c | 370 + 3 files changed, 378 insertions

[PATCH 0/2] gpio: mediatek: driver for gpio chip in MT7621 SoC

2018-06-02 Thread Sergio Paracuellos
. Is this acceptable, or does it need to be changed? We'd like to have review comments and feedback specially for this. Hope this helps and thanks in advance. Best regards, Sergio Paracuellos Sergio Paracuellos (2): gpio: mediatek: add driver for MT7621 dt-bindings: document gpio-m

Re: [PATCH] staging: mt7621-gpio: move out of staging

2018-06-02 Thread Sergio Paracuellos
On Sat, Jun 2, 2018 at 1:30 AM, NeilBrown wrote: > On Fri, Jun 01 2018, Sergio Paracuellos wrote: > >>> I suggest you submit this as a new driver to the gpio maintainer and >>> developers and then if/when it is merged into that tree, we can then >>> delete the sta

Re: [PATCH] staging: mt7621-gpio: move out of staging

2018-06-05 Thread Sergio Paracuellos
On Mon, Jun 04, 2018 at 12:09:38PM +0300, Dan Carpenter wrote: > Looks like a nice driver to me now. Thanks! Thanks, Dan. Let's wait for feedback from gpio and device tree guys. > > regards, > dan carpenter > Best regards,

[PATCH 06/18] staging: mt7621-pinctrl: add space in function call parameter list

2018-06-07 Thread Sergio Paracuellos
Call to kernel function 'devm_kzalloc' has no space between one of its parameters and checkpatch script complains about. Fix it. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 04/18] staging: mt7621-pinctrl: replace ENOSYS with better fitting error code

2018-06-07 Thread Sergio Paracuellos
This commit replaces ENOSYS return with ENOTSUPP silencing the following checkpatch warning: WARNING: ENOSYS means 'invalid syscall nr' and nothing else Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 2 +- 1 file changed, 1 insertion(+),

[PATCH 01/18] staging: mt7621-pinctrl: add SPDX identifier

2018-06-07 Thread Sergio Paracuellos
thand, which can be used instead of the full boiler plate text. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c b/drivers/staging/mt7621-pi

[PATCH 00/18] staging: mt7621-pinctrl: some cleanups

2018-06-07 Thread Sergio Paracuellos
changes that could be performed to get this out of staging. Hope this helps. Thanks in advance. Best regards, Sergio Paracuellos Sergio Paracuellos (18): staging: mt7621-pinctrl: add SPDX identifier staging: mt7621-pinctrl: replace 'unsigned' types with 'unsigned int' sta

[PATCH 07/18] staging: mt7621-pinctrl: avoid lines over 80 chars

2018-06-07 Thread Sergio Paracuellos
This commit silence checkpatch warnings about lines which exceeds 80 chars. In some cases to improve code redability temporal 'size' variable has been included and assigned before allocations. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pinctrl/pinctrl-rt2

[PATCH 08/18] staging: mt7621-pinctrl: replace seq_printf with seq_puts

2018-06-07 Thread Sergio Paracuellos
For a constant format without additional arguments, use seq_puts() instead of seq_printf() fixing also the following checkpatch.pl warning: 'Prefer seq_puts to seq_printf' Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 2 +- 1 file changed, 1

[PATCH 02/18] staging: mt7621-pinctrl: replace 'unsigned' types with 'unsigned int'

2018-06-07 Thread Sergio Paracuellos
This commit replaces all 'unsigned' type declarations along the driver code in favour of the preferred one 'unsigned int'. This also silence checkpatch script warnings about this issue. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pinctrl/p

[PATCH 14/18] staging: mt7621-dts: use 'function' and 'groups' for pinctrl bindings

2018-06-07 Thread Sergio Paracuellos
According to documentation 'pinctrl-bindings.txt' bindings 'groups' and 'function' can be used directly. So replace all of them. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-dts/mt7621.dtsi | 48 +- 1 file changed,

[PATCH 16/18] staging: mt7621-pinctrl: use ternary operator return in rt2880_get_group_name

2018-06-07 Thread Sergio Paracuellos
Trivial change to have only one return in 'rt2880_get_group_name' function using a ternary operator instead of an if statement and two returns. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 5 + 1 file changed, 1 insertion(+), 4 deletion

[PATCH 09/18] staging: mt7621-pinctrl: align function parameters in some functions

2018-06-07 Thread Sergio Paracuellos
Function parameters along the code has different alignment styles. Just unify all of them making style consistent. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 29 - 1 file changed, 14 insertions(+), 15 deletions(-) diff --git

[PATCH 05/18] staging: mt7621-pinctrl: avoid space after if condition

2018-06-07 Thread Sergio Paracuellos
Adding spaces between if condition and parenthesis are not needed at all and checkpatch script complains about them. Fix one in driver code. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a

[PATCH 13/18] staging: mt7621-pinctrl: make use of pinctrl_utils_reserve_map

2018-06-07 Thread Sergio Paracuellos
Function rt2880_pinctrl_dt_node_to_map was using 'kzalloc' to reserve map memory. There is a 'pinctrl_utils_reserve_map' to do this function. Just use it. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 12 +--- 1 file changed

[PATCH 03/18] staging: mt7621-pinctrl: remove unnecessary 'out of memory' message

2018-06-07 Thread Sergio Paracuellos
Messages when memory allocation fails are not needed at all and checkpatch script complains about them. Remove one in this driver code. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a

[PATCH 12/18] staging: mt7621-pinctrl: replace uint8_t type with u8 for 'gpio' field

2018-06-07 Thread Sergio Paracuellos
Struct 'rt2880_priv' contains a field 'gpio' which is defined as uint8_t and should be defined with 'u8' which is preferred. Update some cast along the code related with this new change. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pinctrl/pinct

[PATCH 15/18] staging: mt7621-pinctrl: refactor rt2880_pinctrl_dt_node_to_map function

2018-06-07 Thread Sergio Paracuellos
roups using 'of_property_for_each_string' calling 'pinctrl_utils_add_map_mux' function which is the same of the custom function in this driver code 'rt2880_pinctrl_dt_subnode_to_map' which is not needed anymore. Signed-off-by: Sergio Paracuellos --- drivers/staging/

[PATCH 18/18] staging: mt7621-pinctrl: replace core_initcall_sync with module_platform_driver

2018-06-07 Thread Sergio Paracuellos
We don't really need initialization of this at such an early stage. Just use module_platform_driver to initialize this driver. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/dr

[PATCH 10/18] staging: mt7621-pinctrl: use tabs instead of spaces in some indentations

2018-06-07 Thread Sergio Paracuellos
Kernel coding style use tabs for indent code instead of spaces. Fix some places where spaces were being used silencing also checkpatch script complains. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions

[PATCH 11/18] staging: mt7621-pinctrl: make use of pinctrl_utils_free_map

2018-06-07 Thread Sergio Paracuellos
There was a custom 'rt2880_pinctrl_dt_free_map' function which it was doing the same as pinctrl_utils_free_map defined in 'pinctrl-utils.h' header file. Use it instead avoiding code duplications. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pinctrl/p

[PATCH 17/18] staging: mt7621-pinctrl: remove 'rt2880_pinctrl_pin_dbg_show' callback

2018-06-07 Thread Sergio Paracuellos
The debug information provided by this function does not make sense at all, so just remove it. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 8 1 file changed, 8 deletions(-) diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c b

Re: [PATCH 07/18] staging: mt7621-pinctrl: avoid lines over 80 chars

2018-06-08 Thread Sergio Paracuellos
On Fri, Jun 08, 2018 at 02:20:20PM +0300, Dan Carpenter wrote: > On Thu, Jun 07, 2018 at 01:00:48PM +0200, Sergio Paracuellos wrote: > > This commit silence checkpatch warnings about lines which > > exceeds 80 chars. In some cases to improve code redability > > temporal &#x

Re: [PATCH 07/18] staging: mt7621-pinctrl: avoid lines over 80 chars

2018-06-08 Thread Sergio Paracuellos
hat have to be changed because there unlikely work properly. > > regards, > dan carpenter > Best regards, Sergio Paracuellos ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

[PATCH v2 02/18] staging: mt7621-pinctrl: replace 'unsigned' types with 'unsigned int'

2018-06-08 Thread Sergio Paracuellos
This commit replaces all 'unsigned' type declarations along the driver code in favour of the preferred one 'unsigned int'. This also silence checkpatch script warnings about this issue. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pinctrl/p

<    8   9   10   11   12   13   14   15   16   17   >