[PATCH 4/8] staging: mt7621-gpio: avoid check for NULL in 'to_mediatek_gpio' calls

2018-06-12 Thread Sergio Paracuellos
Function 'to_mediatek_gpio' cannot return NULL, so this NULL checkings are pointless. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 9 - 1 file changed, 9 deletions(-) diff --git a/drivers/staging/mt7621-gpio/gpio-mt7621.c b/drivers/staging/mt7621

[PATCH 2/8] staging: mt7621-gpio: update kerneldoc for state containers

2018-06-12 Thread Sergio Paracuellos
Update kernel doc for mtk_data and also remove no needed documentation for mtk_gc which is clear enough to don't need it. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 15 +++ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers

[PATCH 3/8] staging: mt7621-gpio: align indentation for all defines

2018-06-12 Thread Sergio Paracuellos
There was two remaining defines which weren't properly aligned with the rest. Align them improving readability. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/mt7621-gpio

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

2018-06-12 Thread Sergio Paracuellos
Now that all seems to be working these are the last minor cleanups in order to make a second try to get this out of staging. Sergio Paracuellos (7): staging: mt7621-gpio: remove no more necessary PIN_MASK macro staging: mt7621-gpio: update kerneldoc for state containers staging: mtk7621

Re: [PATCH v3 0/8] staging: mt7621-gpio: last cleanups

2018-06-12 Thread Sergio Paracuellos
On Tue, Jun 12, 2018 at 12:33:42PM +1000, NeilBrown wrote: > On Mon, Jun 11 2018, Sergio Paracuellos wrote: > > > After submiting this driver to try to get mainlined and get > > out of staging some new cleanups seems to be necessary. > > According to this main of Lin

Re: [PATCH v2 0/7] staging: mt7621-gpio: last cleanups

2018-06-12 Thread Sergio Paracuellos
On Tue, Jun 12, 2018 at 12:01:38PM +1000, NeilBrown wrote: > On Mon, Jun 11 2018, Sergio Paracuellos wrote: > > > On Mon, Jun 11, 2018 at 06:33:44PM +1000, NeilBrown wrote: > >> On Mon, Jun 11 2018, Sergio Paracuellos wrote: > >> > >> > After submiting t

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

2018-06-08 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/pinctrl-rt2880.c | 16

[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/pinctrl-rt2880.c | 27

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

2018-06-08 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 v2 04/18] staging: mt7621-pinctrl: replace ENOSYS with better fitting error code

2018-06-08 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(+), 1 deletion

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

2018-06-08 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 insertion

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

2018-06-08 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 a/drivers

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

2018-06-08 Thread Sergio Paracuellos
This commit silence checkpatch warnings about lines which exceeds 80 chars. Some devm_kzalloc has been modified with dev_kcalloc to get this lines more properly indented. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 34 +++-- 1 file

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

2018-06-08 Thread Sergio Paracuellos
According to documentation 'pinctrl-bindings.txt' bindings 'group' 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, 24 insertions(+), 24 deletions

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

2018-06-08 Thread Sergio Paracuellos
, 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-pinctrl

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

2018-06-08 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 deletions(-) diff

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

2018-06-08 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

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

2018-06-08 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

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

2018-06-08 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

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

2018-06-08 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, 9 insertions(+), 3

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

2018-06-08 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/drivers

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

2018-06-08 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/pinctrl-rt2880.c | 7 +++ 1 file

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

2018-06-08 Thread Sergio Paracuellos
' - PATCH 15: use 'for_each_node_with_property' to count groups nodes. The rest of patches are the same. Best regards, Sergio Paracuellos Sergio Paracuellos (18): staging: mt7621-pinctrl: add SPDX identifier staging: mt7621-pinctrl: replace 'unsigned' types with 'unsigned int

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

2018-06-08 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 v2 15/18] staging: mt7621-pinctrl: refactor rt2880_pinctrl_dt_node_to_map function

2018-06-08 Thread Sergio Paracuellos
' 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/mt7621-pinctrl/pinctrl-rt2880.c | 58 +++-- 1 file

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

2018-06-08 Thread Sergio Paracuellos
that 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

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 'si

Re: [PATCH v2] staging: mt7621-gpio: avoid use banks in device tree

2018-06-18 Thread Sergio Paracuellos
On Mon, Jun 18, 2018 at 10:53:31AM +0200, Greg KH wrote: > On Mon, Jun 18, 2018 at 09:07:57AM +0200, Sergio Paracuellos wrote: > > Banks shouldn't be defined in DT if number of resources > > per bank is not variable. We actually know that this SoC > > has three banks so t

[PATCH v5 00/18] staging: mt7621-gpio: last cleanups

2018-06-18 Thread Sergio Paracuellos
H 7. Avoid the use of a switch-case statement which was wrong and distinc if we have RISSING AND FALLING EDGE interrupt or HIGH LOW level ones. This last two are exclusive and cannot be generated at the same time. Hope this helps. Thanks in advance. Best regards, Sergio P

[PATCH v5 07/18] staging: mt7621-gpio: implement high level and low level irqs

2018-06-18 Thread Sergio Paracuellos
This chip support high level and low level interrupts. Those have to be implemented also to get a complete and clean driver. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 47 --- 1 file changed, 37 insertions(+), 10 deletions

[PATCH v5 10/18] staging: mt7621-gpio: update kerneldoc for state containers

2018-06-18 Thread Sergio Paracuellos
Update kernel doc for mtk_data and also remove no needed documentation for mtk_gc which is clear enough to don't need it. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 15 +++ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers

[PATCH v5 09/18] staging: mt7621-gpio: remove no more necessary PIN_MASK macro

2018-06-18 Thread Sergio Paracuellos
PIN_MASK macro was being used because of the fact we were only using one interrupt controller for all of the gpio chips. This has been changed to use one per gpio chip and each has 32 irqs. Because of this this macro is not needed anymore. Use BIT macro instead. Signed-off-by: Sergio Paracuellos

[PATCH v5 14/18] staging: mt7621-gpio: avoid one level indentation in interrupt handler

2018-06-18 Thread Sergio Paracuellos
There is no need to check for 'pending' before loop over the interrupts using 'for_each_set_bit' if nothing is set the return values will be the same so just avoid this check avoiding also one level intentation and improving readability. Signed-off-by: Sergio Paracuellos --- drivers/staging

[PATCH v5 15/18] staging: mt7621-gpio: set different names for each gpio_chip and irq_chip

2018-06-18 Thread Sergio Paracuellos
ll: 'mt7621-bank[0-2]'. Create a new 'mediatek_gpio_bank_name' function which return the name depending on the bank number. This function is allways called with a valid index 0, 1 or 2. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 14 -- 1 fil

[PATCH v5 05/18] staging: mt7621-gpio: add COMPILE_TEST

2018-06-18 Thread Sergio Paracuellos
This driver is actually platform-agnostic. Add COMPILE_TEST for the compilation test coverage. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/mt7621-gpio/Kconfig b/drivers/staging

[PATCH v5 01/18] staging: mt7621-gpio: make use 'bgpio_init' from GPIO_GENERIC

2018-06-18 Thread Sergio Paracuellos
write and read functions which are being used for remaining irq handling stuff have been updated also as well as its dependencies along the code. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/Kconfig | 1 + drivers/staging/mt7621-gpio/gpio-mt7621.c | 136

[PATCH v5 12/18] staging: mt7621-gpio: avoid check for NULL in 'to_mediatek_gpio' calls

2018-06-18 Thread Sergio Paracuellos
Function 'to_mediatek_gpio' cannot return NULL, so this NULL checkings are pointless. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 9 - 1 file changed, 9 deletions(-) diff --git a/drivers/staging/mt7621-gpio/gpio-mt7621.c b/drivers/staging/mt7621

[PATCH v5 04/18] staging: mt7621-gpio: implement '.irq_[request|release]_resources' functions

2018-06-18 Thread Sergio Paracuellos
' with the device from 'mediatek_request_resources' function. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 42 +++ 1 file changed, 37 insertions(+), 5 deletions(-) diff --git a/drivers/staging/mt7621-gpio/gpio-mt7621.c b/drivers/staging

[PATCH v5 06/18] staging: mt7621-gpio: add kerneldoc for state data containers

2018-06-18 Thread Sergio Paracuellos
This commit adds kerneldoc for the two data containers in order to better understanding of its existence. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/drivers/staging/mt7621-gpio/gpio

[PATCH v5 03/18] staging: mt7621-gpio: make use of 'builtin_platform_driver'

2018-06-18 Thread Sergio Paracuellos
This driver was being registered using 'module_platform_driver' but it is not a module at all. Instead of this use 'builtin_platform_driver' which seems to be the correct one. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 2 +- 1 file changed, 1 insertion

[PATCH v5 02/18] staging: mt7621-gpio: avoid including 'gpio.h'

2018-06-18 Thread Sergio Paracuellos
Including file '' should be avoided in new drivers code, so just remove it because it is no necessary at all. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/mt7621-gpio/gpio-mt7621.c b/drivers

[PATCH v5 11/18] staging: mt7621-gpio: align indentation for all defines

2018-06-18 Thread Sergio Paracuellos
There was two remaining defines which weren't properly aligned with the rest. Align them improving readability. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/mt7621-gpio

[PATCH v5 18/18] staging: mt7621-gpio: avoid use banks in device tree

2018-06-18 Thread Sergio Paracuellos
accordly. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-dts/gbpc1.dts | 10 ++-- drivers/staging/mt7621-dts/mt7621.dtsi | 31 ++-- drivers/staging/mt7621-gpio/gpio-mt7621.c | 21 .../staging/mt7621-gpio/mediatek,mt7621-gpio.txt

[PATCH v5 13/18] staging: mt7621-gpio: avoid to set up irqs if not defined in dts

2018-06-18 Thread Sergio Paracuellos
If there is no interrupt defined in the dts 'irq_of_parse_and_map' returns 0 and we should't set up interrupts for each gpio chip in that case. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 42 --- 1 file changed, 22 insertions

[PATCH v5 16/18] staging: mt7621-gpio: avoid long line in a comment

2018-06-18 Thread Sergio Paracuellos
Checkpatch script is complaining about a comment line which exceeds 80 characteres. Just silence it. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/mt7621-gpio/gpio-mt7621.c

[PATCH v5 08/18] staging: mt7621-gpio: avoid custom irq_domain for gpio

2018-06-18 Thread Sergio Paracuellos
domain from the gpio_chip in 'irq_find_mapping' function. Function 'mediatek_gpio_bank_probe' has been moved a it to the botton to have all the irq related functions together and avoid some forward declarations to resolve some symbols along the code. Signed-off-by: Sergio Paracuellos --- drivers

[PATCH v5 17/18] staging: mt7621-gpio: update Kconfig with SoC details

2018-06-18 Thread Sergio Paracuellos
Kconfig is using a generic 'Mediatek GPIO Support' in description and help which is not specific at all about the current SoC which is MT7621. Update it. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

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

2018-06-13 Thread Sergio Paracuellos
Hi Rob, Thanks for your time in reviewing this. On Tue, Jun 12, 2018 at 10:56 PM, Rob Herring wrote: > On Sat, Jun 02, 2018 at 09:30:10AM +0200, Sergio Paracuellos wrote: >> Add a devicetree binding documentation for the mt7621 driver. > > Bindings are for h/w, not a driver.

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

2018-06-13 Thread Sergio Paracuellos
On Wed, Jun 13, 2018 at 01:28:35PM -0600, Rob Herring wrote: > On Wed, Jun 13, 2018 at 10:23 AM, Sergio Paracuellos > wrote: > > Hi Rob, > > > > Thanks for your time in reviewing this. > > > > On Tue, Jun 12, 2018 at 10:56 PM, Rob Herring wrote: > >

[PATCH v4 06/18] staging: mt7621-gpio: add kerneldoc for state data containers

2018-06-14 Thread Sergio Paracuellos
This commit adds kerneldoc for the two data containers in order to better understanding of its existence. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/drivers/staging/mt7621-gpio/gpio

[PATCH v4 07/18] staging: mt7621-gpio: implement high level and low level irqs

2018-06-14 Thread Sergio Paracuellos
This chip support high level and low level interrupts. Those have to be implemented also to get a complete and clean driver. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 47 --- 1 file changed, 37 insertions(+), 10 deletions

[PATCH v4 04/18] staging: mt7621-gpio: implement '.irq_[request|release]_resources' functions

2018-06-14 Thread Sergio Paracuellos
' with the device from 'mediatek_request_resources' function. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 42 +++ 1 file changed, 37 insertions(+), 5 deletions(-) diff --git a/drivers/staging/mt7621-gpio/gpio-mt7621.c b/drivers/staging

[PATCH v4 15/18] staging: mt7621-gpio: set different names for each gpio_chip and irq_chip

2018-06-14 Thread Sergio Paracuellos
ll: 'mt7621-bank[0-2]'. Create a new 'mediatek_gpio_bank_name' function which return the name depending on the bank number. This function is allways called with a valid index 0, 1 or 2. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 14 -- 1 fil

[PATCH v4 09/18] staging: mt7621-gpio: remove no more necessary PIN_MASK macro

2018-06-14 Thread Sergio Paracuellos
PIN_MASK macro was being used because of the fact we were only using one interrupt controller for all of the gpio chips. This has been changed to use one per gpio chip and each has 32 irqs. Because of this this macro is not needed anymore. Use BIT macro instead. Signed-off-by: Sergio Paracuellos

[PATCH v4 08/18] staging: mt7621-gpio: avoid custom irq_domain for gpio

2018-06-14 Thread Sergio Paracuellos
domain from the gpio_chip in 'irq_find_mapping' function. Function 'mediatek_gpio_bank_probe' has been moved a it to the botton to have all the irq related functions together and avoid some forward declarations to resolve some symbols along the code. Signed-off-by: Sergio Paracuellos --- drivers

[PATCH v4 00/18] staging: mt7621-gpio: last cleanups

2018-06-14 Thread Sergio Paracuellos
level ones. This last two are exclusive and cannot be generated at the same time. Hope this helps. Thanks in advance. Best regards, Sergio Paracuellos Sergio Paracuellos (18): staging: mt7621-gpio: make use 'bgpio_init' from GPIO_GENERIC staging: mt7621-gpio: avoid including 'gpio.h'

[PATCH v4 02/18] staging: mt7621-gpio: avoid including 'gpio.h'

2018-06-14 Thread Sergio Paracuellos
Including file '' should be avoided in new drivers code, so just remove it because it is no necessary at all. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/mt7621-gpio/gpio-mt7621.c b/drivers

[PATCH v4 03/18] staging: mt7621-gpio: make use of 'builtin_platform_driver'

2018-06-14 Thread Sergio Paracuellos
This driver was being registered using 'module_platform_driver' but it is not a module at all. Instead of this use 'builtin_platform_driver' which seems to be the correct one. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 2 +- 1 file changed, 1 insertion

[PATCH v4 14/18] staging: mt7621-gpio: avoid one level indentation in interrupt handler

2018-06-14 Thread Sergio Paracuellos
There is no need to check for 'pending' before loop over the interrupts using 'for_each_set_bit' if nothing is set the return values will be the same so just avoid this check avoiding also one level intentation and improving readability. Signed-off-by: Sergio Paracuellos --- drivers/staging

[PATCH v4 12/18] staging: mt7621-gpio: avoid check for NULL in 'to_mediatek_gpio' calls

2018-06-14 Thread Sergio Paracuellos
Function 'to_mediatek_gpio' cannot return NULL, so this NULL checkings are pointless. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 9 - 1 file changed, 9 deletions(-) diff --git a/drivers/staging/mt7621-gpio/gpio-mt7621.c b/drivers/staging/mt7621

[PATCH v4 11/18] staging: mt7621-gpio: align indentation for all defines

2018-06-14 Thread Sergio Paracuellos
There was two remaining defines which weren't properly aligned with the rest. Align them improving readability. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/mt7621-gpio

[PATCH v4 16/18] staging: mt7621-gpio: avoid long line in a comment

2018-06-14 Thread Sergio Paracuellos
Checkpatch script is complaining about a comment line which exceeds 80 characteres. Just silence it. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/mt7621-gpio/gpio-mt7621.c

[PATCH v4 05/18] staging: mt7621-gpio: add COMPILE_TEST

2018-06-14 Thread Sergio Paracuellos
This driver is actually platform-agnostic. Add COMPILE_TEST for the compilation test coverage. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/mt7621-gpio/Kconfig b/drivers/staging

[PATCH v4 18/18] staging: mt7621-gpio: avoid use banks in device tree

2018-06-14 Thread Sergio Paracuellos
accordly. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-dts/gbpc1.dts | 10 ++-- drivers/staging/mt7621-dts/mt7621.dtsi | 31 ++-- drivers/staging/mt7621-gpio/gpio-mt7621.c | 19 +++ .../staging/mt7621-gpio/mediatek,mt7621-gpio.txt

[PATCH v4 01/18] staging: mt7621-gpio: make use 'bgpio_init' from GPIO_GENERIC

2018-06-14 Thread Sergio Paracuellos
write and read functions which are being used for remaining irq handling stuff have been updated also as well as its dependencies along the code. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/Kconfig | 1 + drivers/staging/mt7621-gpio/gpio-mt7621.c | 136

[PATCH v4 13/18] staging: mt7621-gpio: avoid to set up irqs if not defined in dts

2018-06-14 Thread Sergio Paracuellos
If there is no interrupt defined in the dts 'irq_of_parse_and_map' returns 0 and we should't set up interrupts for each gpio chip in that case. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 42 --- 1 file changed, 22 insertions

[PATCH v4 10/18] staging: mt7621-gpio: update kerneldoc for state containers

2018-06-14 Thread Sergio Paracuellos
Update kernel doc for mtk_data and also remove no needed documentation for mtk_gc which is clear enough to don't need it. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 15 +++ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers

[PATCH v4 17/18] staging: mt7621-gpio: update Kconfig with SoC details

2018-06-14 Thread Sergio Paracuellos
Kconfig is using a generic 'Mediatek GPIO Support' in description and help which is not specific at all about the current SoC which is MT7621. Update it. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

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

2018-06-14 Thread Sergio Paracuellos
On Thu, Jun 14, 2018 at 4:17 PM, Linus Walleij wrote: > On Thu, Jun 14, 2018 at 6:45 AM, Sergio Paracuellos > wrote: > >> Ok, so... does the following single node sounds acceptable? >> >> gpio: gpio@600 { >> #gpio-cells = <2>; >> #interrupt-ce

[PATCH v2] staging: mt7621-gpio: avoid use banks in device tree

2018-06-18 Thread Sergio Paracuellos
accordly. Signed-off-by: Sergio Paracuellos --- Changes in v2: Last patch in previous 'last cleanups' series is wrong passing around a not initialized 'bank' to the 'mediatek_gpio_bank_probe' function. Fix it here and because that patch is the last one in the series just only resend this. drivers

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

2018-06-08 Thread Sergio Paracuellos
On Fri, Jun 8, 2018 at 1:59 PM, Linus Walleij wrote: > Hi Sergio! > > Thanks for your patch! Hi Linus, First of all, thanks for your feedback and effort reviewing this. > > On Sat, Jun 2, 2018 at 9:30 AM, Sergio Paracuellos > wrote: > >> Add driver support for gpio

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

2018-06-09 Thread Sergio Paracuellos
ee banks until you find a hit, provided > you code it up properly. Ok, I'll give it a try to use this also. > > There were some problems with removing an irqchip like > that but your driver is anyway a bool so I think it might work > just fine. > > Yours, > Linus Walleij Thanks again

[PATCH v2 1/7] staging: mt7621-gpio: make use 'bgpio_init' from GPIO_GENERIC

2018-06-10 Thread Sergio Paracuellos
write and read functions which are being used for remaining irq handling stuff have been updated also as well as its dependencies along the code. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/Kconfig | 1 + drivers/staging/mt7621-gpio/gpio-mt7621.c | 136

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

2018-06-10 Thread Sergio Paracuellos
irq_domain. Correct me if I am wrong, please. Hope this helps. Thanks in advance. Best regards, Sergio Paracuellos Sergio Paracuellos (7): staging: mt7621-gpio: make use 'bgpio_init' from GPIO_GENERIC staging: mt7621-gpio: avoid including 'gpio.h' staging: mt7621-gpio: make use

[PATCH v2 6/7] staging: mt7621-gpio: add kerneldoc for state data containers

2018-06-10 Thread Sergio Paracuellos
This commit adds kerneldoc for the two data containers in order to better understanding of its existence. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/drivers/staging/mt7621-gpio/gpio

[PATCH v2 2/7] staging: mt7621-gpio: avoid including 'gpio.h'

2018-06-10 Thread Sergio Paracuellos
Including file '' should be avoided in new drivers code, so just remove it because it is no necessary at all. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/mt7621-gpio/gpio-mt7621.c b/drivers

[PATCH v2 5/7] staging: mt7621-gpio: add COMPILE_TEST

2018-06-10 Thread Sergio Paracuellos
This driver is actually platform-agnostic. Add COMPILE_TEST for the compilation test coverage. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/mt7621-gpio/Kconfig b/drivers/staging

[PATCH v2 3/7] staging: mt7621-gpio: make use of 'builtin_platform_driver'

2018-06-10 Thread Sergio Paracuellos
This driver was being registered using 'module_platform_driver' but it is not a module at all. Instead of this use 'builtin_platform_driver' which seems to be the correct one. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 2 +- 1 file changed, 1 insertion

[PATCH v2 7/7] staging: mt7621-gpio: implement high level and low level irqs

2018-06-10 Thread Sergio Paracuellos
This chip support high level and low level interrupts. Those have to be implemented also to get a complete and clean driver. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 51 +++ 1 file changed, 38 insertions(+), 13 deletions

[PATCH v2 4/7] staging: mt7621-gpio: implement '.irq_[request|release]_resources' functions

2018-06-10 Thread Sergio Paracuellos
' with the device from 'mediatek_request_resources' function. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 42 +++ 1 file changed, 37 insertions(+), 5 deletions(-) diff --git a/drivers/staging/mt7621-gpio/gpio-mt7621.c b/drivers/staging

[PATCH v2] staging: mt7621-gpio: avoid custom irq_domain for gpio

2018-06-11 Thread Sergio Paracuellos
domain from the gpio_chip in 'irq_find_mapping' function. Function 'mediatek_gpio_bank_probe' has been moved a it to the botton to have all the irq related functions together and avoid some forward declarations to resolve some symbols along the code. Signed-off-by: Sergio Paracuellos --- Changes in v2

[PATCH v3] staging: mt7621-gpio: avoid custom irq_domain for gpio

2018-06-11 Thread Sergio Paracuellos
domain from the gpio_chip in 'irq_find_mapping' function. Function 'mediatek_gpio_bank_probe' has been moved a it to the botton to have all the irq related functions together and avoid some forward declarations to resolve some symbols along the code. Signed-off-by: Sergio Paracuellos --- Changes in v3

[PATCH v3 1/8] staging: mt7621-gpio: make use 'bgpio_init' from GPIO_GENERIC

2018-06-11 Thread Sergio Paracuellos
write and read functions which are being used for remaining irq handling stuff have been updated also as well as its dependencies along the code. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/Kconfig | 1 + drivers/staging/mt7621-gpio/gpio-mt7621.c | 136

[PATCH v3 5/8] staging: mt7621-gpio: add COMPILE_TEST

2018-06-11 Thread Sergio Paracuellos
This driver is actually platform-agnostic. Add COMPILE_TEST for the compilation test coverage. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/mt7621-gpio/Kconfig b/drivers/staging

[PATCH v3 3/8] staging: mt7621-gpio: make use of 'builtin_platform_driver'

2018-06-11 Thread Sergio Paracuellos
This driver was being registered using 'module_platform_driver' but it is not a module at all. Instead of this use 'builtin_platform_driver' which seems to be the correct one. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 2 +- 1 file changed, 1 insertion

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

2018-06-11 Thread Sergio Paracuellos
Paracuellos Sergio Paracuellos (8): staging: mt7621-gpio: make use 'bgpio_init' from GPIO_GENERIC staging: mt7621-gpio: avoid including 'gpio.h' staging: mt7621-gpio: make use of 'builtin_platform_driver' staging: mt7621-gpio: implement '.irq_[request|release]_resources' functions

[PATCH v3 4/8] staging: mt7621-gpio: implement '.irq_[request|release]_resources' functions

2018-06-11 Thread Sergio Paracuellos
' with the device from 'mediatek_request_resources' function. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 42 +++ 1 file changed, 37 insertions(+), 5 deletions(-) diff --git a/drivers/staging/mt7621-gpio/gpio-mt7621.c b/drivers/staging

[PATCH v3 2/8] staging: mt7621-gpio: avoid including 'gpio.h'

2018-06-11 Thread Sergio Paracuellos
Including file '' should be avoided in new drivers code, so just remove it because it is no necessary at all. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/mt7621-gpio/gpio-mt7621.c b/drivers

[PATCH v3 6/8] staging: mt7621-gpio: add kerneldoc for state data containers

2018-06-11 Thread Sergio Paracuellos
This commit adds kerneldoc for the two data containers in order to better understanding of its existence. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/drivers/staging/mt7621-gpio/gpio

[PATCH v3 8/8] staging: mt7621-gpio: avoid custom irq_domain for gpio

2018-06-11 Thread Sergio Paracuellos
domain from the gpio_chip in 'irq_find_mapping' function. Function 'mediatek_gpio_bank_probe' has been moved a it to the botton to have all the irq related functions together and avoid some forward declarations to resolve some symbols along the code. Signed-off-by: Sergio Paracuellos --- drivers

[PATCH v3 7/8] staging: mt7621-gpio: implement high level and low level irqs

2018-06-11 Thread Sergio Paracuellos
This chip support high level and low level interrupts. Those have to be implemented also to get a complete and clean driver. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 47 --- 1 file changed, 37 insertions(+), 10 deletions

Re: [PATCH v2 0/7] staging: mt7621-gpio: last cleanups

2018-06-11 Thread Sergio Paracuellos
On Mon, Jun 11, 2018 at 06:33:44PM +1000, NeilBrown wrote: > On Mon, Jun 11 2018, Sergio Paracuellos wrote: > > > After submiting this driver to try to get mainlined and get > > out of staging some new cleanups seems to be necessary. > > According to this main of Lin

Re: [PATCH v2] staging: mt7621-gpio: avoid custom irq_domain for gpio

2018-06-11 Thread Sergio Paracuellos
On Mon, Jun 11, 2018 at 06:26:09PM +1000, NeilBrown wrote: > On Mon, Jun 11 2018, Sergio Paracuellos wrote: > > > Instead of create a custom irq_domain for this chip, use > > 'gpiochip_set_chained_irqchip' from GPIOLIB_IRQCHIP. It > > is ok to call this function seve

[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/mt7621-gpio/gpio-mt7621

[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 +++--- 1 file

[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 deletions(-) diff --git

[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(-) diff --git a/drivers/staging

[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

<    2   3   4   5   6   7   8   9   10   11   >