[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

[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 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 deletion

[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/dr

[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

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

2018-06-18 Thread Sergio Paracuellos
same for all: '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-mt762

Re: [bug report] staging: mt7621-pinctrl: ralink: add pinctrl driver

2018-06-21 Thread Sergio Paracuellos
Hi Dan, There are some patches (they haven't been tested now, I think) that should solve the issue pointed here. The following should resolve it: http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2018-June/121761.html Best regards, Sergio Paracu

[PATCH] staging: mt7621-pci: simplify 'mt7621_pcie_init_virtual_bridges' function

2020-03-08 Thread Sergio Paracuellos
Function 'mt7621_pcie_init_virtual_bridges' is a bit mess and can be refactorized properly in a cleaner way. Introduce new 'pcie_rmw' inline function helper to do clear and set the correct bits this function needs to work. Signed-off-by: Sergio Paracuellos --- Changes are

[PATCH] staging: mt7621-pci: enable clock bit for each port

2020-03-10 Thread Sergio Paracuellos
eeded at all and the proper thing to do is just enable the clock bit for each pcie port. Hence remove useless code and do the right thing which is setting up the clock bit for each port enabled. Signed-off-by: Sergio Paracuellos --- Changes are only compile-tested. drivers/staging/mt7621-p

[PATCH 3/5] staging: mt7621-pci: remove not used definitions

2020-03-11 Thread Sergio Paracuellos
GPIO mode is not needed to be set up anymore. Hence remove useless related definitions. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci

[PATCH 5/5] staging: mt7621-pci: bindings: update doc accordly to last changes

2020-03-11 Thread Sergio Paracuellos
Properly update bindings documentation with added 'reset-gpios' property. Delete also 'perst-gpio' which is not being used anymore. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/mediatek,mt7621-pci.txt | 7 +-- 1 file changed, 5 insertions(+), 2 deleti

[PATCH 1/5] staging: mt7621-pci: use gpios for properly reset

2020-03-11 Thread Sergio Paracuellos
order to make all assert and deassert in the 'probe' process makes more sense: * Parse device tree. * make assert of the RC's and EP's before doing anything else. * make deassert of the RC's before initializing the phy. * Init the phy. * make deassert of the EP's befor

[PATCH 0/5] staging: mt7621-pci: re-do reset boot process

2020-03-11 Thread Sergio Paracuellos
91dd9256c8a65c36 Because of all of this this patch series tries to avoid random hangs of boot trying to use the 'reset-gpios' approach. Changes are only compile tested. Hope this helps. Best regards, Sergio Paracuellos Sergio Paracuellos (5): staging: mt7621-pci: use gpios for p

[PATCH 4/5] staging: mt7621-dts: make use of 'reset-gpios' property for pci

2020-03-11 Thread Sergio Paracuellos
Properly set pins for group pcie as 'gpio' function and declare gpio's in the pci node to make reset stuff properly functional. Delete no more needed general reset and previous pers gpio which is now being used in 'reset-gpios' property. Signed-off-by: Sergio Paracuel

[PATCH 2/5] staging: mt7621-pci: change value for 'PERST_DELAY_US'

2020-03-11 Thread Sergio Paracuellos
Value of 'PERST_DELAY_US' is too high and it is ok just to set up to 100 us. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/

[PATCH v2 1/5] staging: mt7621-pci: use gpios for properly reset

2020-03-11 Thread Sergio Paracuellos
oing anything else. * make deassert of the RC's before initializing the phy. * Init the phy. * make deassert of the EP's before initialize pci ports. * Normal PCI initialization. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 82 +++---

[PATCH v2 0/5] staging: mt7621-pci: re-do reset boot process

2020-03-11 Thread Sergio Paracuellos
* Avoid to read FTS_NUM register in reset state. Best regards, Sergio Paracuellos Sergio Paracuellos (5): staging: mt7621-pci: use gpios for properly reset staging: mt7621-pci: change value for 'PERST_DELAY_US' staging: mt7621-dts: make use of 'reset-gpios' prope

[PATCH v2 2/5] staging: mt7621-pci: change value for 'PERST_DELAY_US'

2020-03-11 Thread Sergio Paracuellos
Value of 'PERST_DELAY_US' is too high and it is ok just to set up to 100 us. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/

[PATCH v2 5/5] staging: mt7621-pci: release gpios after pci initialization

2020-03-11 Thread Sergio Paracuellos
R3G's LEDs fail to initialize because one of them uses GPIO8 Hence, release the GPIO resources after PCIe initialization. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/staging/mt7621-pc

[PATCH v2 3/5] staging: mt7621-dts: make use of 'reset-gpios' property for pci

2020-03-11 Thread Sergio Paracuellos
Properly set pins for group pcie as 'gpio' function and declare gpio's in the pci node to make reset stuff properly functional. Delete no more needed general reset and previous pers gpio which is now being used in 'reset-gpios' property. Signed-off-by: Sergio Paracuel

[PATCH v2 4/5] staging: mt7621-pci: bindings: update doc accordly to last changes

2020-03-11 Thread Sergio Paracuellos
Properly update bindings documentation with added 'reset-gpios' property. Delete also 'perst-gpio' which is not being used anymore. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/mediatek,mt7621-pci.txt | 7 +-- 1 file changed, 5 insertions(+), 2 deleti

Re: [PATCH v2 0/5] staging: mt7621-pci: re-do reset boot process

2020-03-11 Thread Sergio Paracuellos
Hi Greg, On Thu, Mar 12, 2020 at 5:56 AM Greg Ungerer wrote: > > Hi Sergio, > > On 12/3/20 4:58 am, Sergio Paracuellos wrote: > > Some time ago Greg Ungerer reported some random hangs using > > the staging mt7621-pci driver: > > > > See: > > * &

[PATCH v3 0/5] staging: mt7621-pci: re-do reset boot process

2020-03-12 Thread Sergio Paracuellos
state. * Release gpio's patch added Best regards, Sergio Paracuellos Sergio Paracuellos (5): staging: mt7621-pci: use gpios for properly reset staging: mt7621-pci: change value for 'PERST_DELAY_US' staging: mt7621-dts: make use of 'reset-gpios' property for

[PATCH v3 1/5] staging: mt7621-pci: use gpios for properly reset

2020-03-12 Thread Sergio Paracuellos
ice tree. * make assert of the RC's and EP's before doing anything else. * make deassert of the RC's before initializing the phy. * Init the phy. * make deassert of the EP's before initialize pci ports. * Normal PCI initialization. Signed-off-by: Sergio Paracuellos

[PATCH v3 2/5] staging: mt7621-pci: change value for 'PERST_DELAY_US'

2020-03-12 Thread Sergio Paracuellos
Value of 'PERST_DELAY_US' is too high and it is ok just to set up to 100 us. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/

[PATCH v3 4/5] staging: mt7621-pci: bindings: update doc accordly to last changes

2020-03-12 Thread Sergio Paracuellos
Properly update bindings documentation with added 'reset-gpios' property. Delete also 'perst-gpio' which is not being used anymore. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/mediatek,mt7621-pci.txt | 7 +-- 1 file changed, 5 insertions(+), 2 deleti

[PATCH v3 3/5] staging: mt7621-dts: make use of 'reset-gpios' property for pci

2020-03-12 Thread Sergio Paracuellos
Properly set pins for group pcie as 'gpio' function and declare gpio's in the pci node to make reset stuff properly functional. Delete no more needed general reset and previous pers gpio which is now being used in 'reset-gpios' property. Signed-off-by: Sergio Paracuel

[PATCH v3 5/5] staging: mt7621-pci: release gpios after pci initialization

2020-03-12 Thread Sergio Paracuellos
R3G's LEDs fail to initialize because one of them uses GPIO8 Hence, release the GPIO resources after PCIe initialization and properly release also in driver error path. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 23 ++- 1 file change

Re: [PATCH v3 0/5] staging: mt7621-pci: re-do reset boot process

2020-03-12 Thread Sergio Paracuellos
x94 > [<80400a74>] really_probe+0x104/0x364 > [<803feb74>] bus_for_each_drv+0x84/0xdc > [<80400924>] __device_attach+0xdc/0x120 > [<803ffb5c>] bus_probe_device+0xa0/0xbc > [<80400124>] deferred_probe_work_func+0x7c/0xbc > [<800420e8>] process_one

Re: [PATCH v3 0/5] staging: mt7621-pci: re-do reset boot process

2020-03-12 Thread Sergio Paracuellos
Hi again Greg, On Fri, Mar 13, 2020 at 6:45 AM Sergio Paracuellos wrote: > > Hi Greg, > > On Fri, Mar 13, 2020 at 4:51 AM Greg Ungerer wrote: > [snip] > > > > I applied the patches to the staging git tree for testing. > > I have seen a couple

[PATCH v4 3/6] staging: mt7621-dts: make use of 'reset-gpios' property for pci

2020-03-13 Thread Sergio Paracuellos
Properly set pins for group pcie as 'gpio' function and declare gpio's in the pci node to make reset stuff properly functional. Delete no more needed general reset and previous pers gpio which is now being used in 'reset-gpios' property. Signed-off-by: Sergio Paracuel

[PATCH v4 0/6] staging: mt7621-pci: re-do reset boot process

2020-03-13 Thread Sergio Paracuellos
for pers mode to GPIO. * Avoid to read FTS_NUM register in reset state. * Release gpio's patch added Best regards, Sergio Paracuellos Sergio Paracuellos (6): staging: mt7621-pci: use gpios for properly reset staging: mt7621-pci: change value for 'PERST_DELAY_MS' staging:

[PATCH v4 4/6] staging: mt7621-pci: bindings: update doc accordly to last changes

2020-03-13 Thread Sergio Paracuellos
Properly update bindings documentation with added 'reset-gpios' property. Delete also 'perst-gpio' which is not being used anymore. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/mediatek,mt7621-pci.txt | 7 +-- 1 file changed, 5 insertions(+), 2 deleti

[PATCH v4 6/6] staging: mt7621-pci: delete no more needed 'mt7621_reset_port'

2020-03-13 Thread Sergio Paracuellos
After review all the resets at the beggining the function 'mt7621_reset_port' is not needed anymore. Hence delete it and its uses. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 13 - 1 file changed, 13 deletions(-) diff --git a/drive

[PATCH v4 5/6] staging: mt7621-pci: release gpios after pci initialization

2020-03-13 Thread Sergio Paracuellos
R3G's LEDs fail to initialize because one of them uses GPIO8 Hence, release the GPIO resources after PCIe initialization and properly release also in driver error path. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 23 ++- 1 file change

[PATCH v4 2/6] staging: mt7621-pci: change value for 'PERST_DELAY_MS'

2020-03-13 Thread Sergio Paracuellos
Value of 'PERST_DELAY_MS' is too high and it is ok just to set up to 100 ms. Update also define name from 'PERST_DELAY_US' into 'PERST_DELAY_MS' Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 6 +++--- 1 file changed, 3 insertions(

[PATCH v4 1/6] staging: mt7621-pci: use gpios for properly reset

2020-03-13 Thread Sergio Paracuellos
ice tree. * make assert of the RC's and EP's before doing anything else. * make deassert of the RC's before initializing the phy. * Init the phy. * make deassert of the EP's before initialize pci ports. * Normal PCI initialization. Signed-off-by: Sergio Paracuellos

Re: [PATCH v4 0/6] staging: mt7621-pci: re-do reset boot process

2020-03-14 Thread Sergio Paracuellos
Hi, On Fri, Mar 13, 2020 at 9:09 PM Sergio Paracuellos wrote: > > Some time ago Greg Ungerer reported some random hangs using > the staging mt7621-pci driver: > > See: > * > http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2019-June/134947.html > >

Re: [PATCH v4 0/6] staging: mt7621-pci: re-do reset boot process

2020-03-15 Thread Sergio Paracuellos
Hi, On Sat, Mar 14, 2020 at 11:42 AM Sergio Paracuellos wrote: [snip] > > > > Changes in v4: > > * Make use of 'devm_gpiod_get_index_optional' instead of > > 'devm_gpiod_get_index'. > > * Use 'dev_err' instead of 'dev_notice

Re: [PATCH v3 0/5] staging: mt7621-pci: re-do reset boot process

2020-03-15 Thread Sergio Paracuellos
Hi Greg, On Sun, Mar 15, 2020 at 1:32 PM Greg Ungerer wrote: > > Hi Sergio, > > On 13/3/20 3:45 pm, Sergio Paracuellos wrote: > > On Fri, Mar 13, 2020 at 4:51 AM Greg Ungerer wrote: > > [snip] > >> > >> I applied the patches to the staging git tree

[PATCH] staging: mt7621-pci-phy: add 'mt7621_phy_rmw' to simplify code

2020-03-15 Thread Sergio Paracuellos
In order to simplify driver code and decrease a bit LOC add new function 'mt7621_phy_rmw' where clear and set bits are passed as arguments. Signed-off-by: Sergio Paracuellos --- .../staging/mt7621-pci-phy/pci-mt7621-phy.c | 158 -- 1 file changed, 71 inserti

[PATCH] staging: mt7621-pci: fix io space and properly set resource limits

2020-03-18 Thread Sergio Paracuellos
o properly setup resource limits and io and memory windows with properly parsed values instead of set them as 'no limit' which it is wrong. For any reason I don't really know legacy driver sets up mem window as 0x and any other value seems to does not work as expected, so

[PATCH] staging: mt7621-pci: fix register to set up virtual bridges

2020-03-19 Thread Sergio Paracuellos
Instead of being using PCI Configuration and Status Register to set up virtual bridges we are using CONFIG_ADDR Register which is wrong. Hence, set the correct value. Fixes: 9a5e71a68d20 ("staging: mt7621-pci: simplify 'mt7621_pcie_init_virtual_bridges' function") S

Re: [PATCH v4 0/6] staging: mt7621-pci: re-do reset boot process

2020-03-19 Thread Sergio Paracuellos
Hi Greg, On Thu, Mar 19, 2020 at 1:42 PM Greg Ungerer wrote: > > Hi Sergio, > > On 14/3/20 6:09 am, Sergio Paracuellos wrote: > > Some time ago Greg Ungerer reported some random hangs using > > the staging mt7621-pci driver: > > > > See: > > * &

Re: [PATCH v4 0/6] staging: mt7621-pci: re-do reset boot process

2020-03-19 Thread Sergio Paracuellos
Sorry the mail was sent while I was still writing :) On Thu, Mar 19, 2020 at 2:43 PM Sergio Paracuellos wrote: > > Hi Greg, > > On Thu, Mar 19, 2020 at 1:42 PM Greg Ungerer wrote: > > > > Hi Sergio, > > > > On 14/3/20 6:09 am, Sergio Paracuellos wrote: >

[PATCH] staging: mt7621-pci: don't return if get gpio fails

2020-03-19 Thread Sergio Paracuellos
ormal boot. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt7621.c index 2a01645162a5..d6fc8a08c9bd 100644 --- a/drive

[PATCH 4/5] staging: mt7621-pci: change variable to print for slot

2020-03-20 Thread Sergio Paracuellos
We are using the counter to print the slot which has been enabled. Use the correct associated slot for the port instead. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/mt7621-pci

[PATCH 3/5] staging: mt7621-pci: use only two phys from device tree

2020-03-20 Thread Sergio Paracuellos
0 is instantiated. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt7621.c index d6fc8a08c9bd..a521653d8dba 100644 --- a/dr

[PATCH 2/5] staging: mt7621-dts: set up only two pcie phys

2020-03-20 Thread Sergio Paracuellos
This soc has only two real pcie phys one of them having a different register to enable and disable it. Change this to have only two dt nodes for the phys and use 'phy-cells' properly to say if the phy has dual ports. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-dts/m

[PATCH 5/5] staging: mt7621-pci: be sure gpio descriptor is null on fails

2020-03-20 Thread Sergio Paracuellos
his happen set descriptor to NULL in the driver port structure. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt76

[PATCH 1/5] staging: mt7621-pci-phy: avoid to create to different phys for a dual port one

2020-03-20 Thread Sergio Paracuellos
le pcie links in both hard and soft resets. Signed-off-by: Sergio Paracuellos --- .../staging/mt7621-pci-phy/pci-mt7621-phy.c | 144 +++--- 1 file changed, 59 insertions(+), 85 deletions(-) diff --git a/drivers/staging/mt7621-pci-phy/pci-mt7621-phy.c b/drivers/staging/mt7621-pci-phy/

[PATCH 0/5] staging: mt7621-pci-phy: Use only two phys to avoid unstable pcie links

2020-03-20 Thread Sergio Paracuellos
] pci :00:02.0: bridge window [mem 0x6040-0x604f] [ 18.261675] pci :00:02.0: bridge window [mem 0x6050-0x605f pref] Sergio Paracuellos (5): staging: mt7621-pci-phy: avoid to create to different phys for a dual port one staging: mt7621-dts: set up only two p

Re: [PATCH] staging: mt7621-pci: don't return if get gpio fails

2020-03-20 Thread Sergio Paracuellos
Hi Greg, On Fri, Mar 20, 2020 at 3:30 PM Greg Ungerer wrote: > > Hi Sergio, > > On 20/3/20 2:14 am, Sergio Paracuellos wrote: > > In some platforms gpio's are not used for reset but > > for other purposes. Because of that when we try to > > get them are va

Re: [PATCH] staging: mt7621-pci: don't return if get gpio fails

2020-03-20 Thread Sergio Paracuellos
Hi Greg, On Fri, Mar 20, 2020 at 4:08 PM Greg Ungerer wrote: > > Hi Sergio, > > On 21/3/20 12:38 am, Sergio Paracuellos wrote: > > On Fri, Mar 20, 2020 at 3:30 PM Greg Ungerer wrote: > >> On 20/3/20 2:14 am, Sergio Paracuellos wrote: > [snip] > >> rt2880-

Re: [PATCH v4 5/6] staging: mt7621-pci: release gpios after pci initialization

2020-03-20 Thread Sergio Paracuellos
Hi Chuanhong, On Fri, Mar 20, 2020 at 3:59 PM Chuanhong Guo wrote: > > Hi! > > On Sat, Mar 14, 2020 at 4:10 AM Sergio Paracuellos > wrote: > > > > R3G's LEDs fail to initialize because one of them uses GPIO8 > > A gpio can't be used as pcie reset an

[PATCH] staging: mt7621-pci: avoid to poweroff the phy for slot one

2020-03-20 Thread Sergio Paracuellos
c [<80048eb0>] kthread+0x12c/0x134 [<80007438>] ret_from_kernel_thread+0x14/0x1c Code: 24050002 27bdfff8 8f83 14a5 00600825 e081 1020fffa Fixes: bf516f413f4e ("staging: mt7621-pci: use only two phys from device tree") Signed-off-by: Sergio Paracuel

Re: [PATCH v4 5/6] staging: mt7621-pci: release gpios after pci initialization

2020-03-20 Thread Sergio Paracuellos
Hi, On Fri, Mar 20, 2020 at 4:39 PM Chuanhong Guo wrote: > > Hi! > > On Fri, Mar 20, 2020 at 11:29 PM Sergio Paracuellos > wrote: > > > This pin conflict comes from incorrectly occupying pins that are not > > > used by pcie, > > > and should be fixe

Re: [PATCH v4 5/6] staging: mt7621-pci: release gpios after pci initialization

2020-03-20 Thread Sergio Paracuellos
On Fri, Mar 20, 2020 at 5:32 PM Sergio Paracuellos wrote: > > Hi, > > On Fri, Mar 20, 2020 at 4:39 PM Chuanhong Guo wrote: > > > > Hi! > > > > On Fri, Mar 20, 2020 at 11:29 PM Sergio Paracuellos > > wrote: > > > > This pin conflict comes fro

Re: [PATCH] staging: mt7621-pci: don't return if get gpio fails

2020-03-21 Thread Sergio Paracuellos
Hi Greg, On Sat, Mar 21, 2020 at 7:28 AM Greg Ungerer wrote: > > Hi Sergio, > > On 21/3/20 1:25 am, Sergio Paracuellos wrote: > > On Fri, Mar 20, 2020 at 4:08 PM Greg Ungerer wrote: > >> On 21/3/20 12:38 am, Sergio Paracuellos wrote: > >>> On Fri, Mar

[PATCH 1/2] staging: mt7621-dts: gpio 8 and 9 are vendor specific

2020-03-21 Thread Sergio Paracuellos
pcie reset and are vendor specific. Hence, maintain common mt7621.dtsi with only gpio19 which is common and make an overlay for gnubee board which uses all gpio's as resets for pcie. After this changes release gpios in driver code is not needed anymore. Signed-off-by: Sergio Paracuellos --- dr

[PATCH 0/2] staging: mt7621-pci: make gpios 8 and 9 vendor specific

2020-03-21 Thread Sergio Paracuellos
ly in the fact that device tree is correct. This changes have been tested in a gnubee pc1. Sergio Paracuellos (2): staging: mt7621-dts: gpio 8 and 9 are vendor specific staging: mt7621-pci: delete release gpios related code drivers/staging/mt7621-dts/gbpc1.dts| 4 drivers/staging/m

[PATCH 2/2] staging: mt7621-pci: delete release gpios related code

2020-03-21 Thread Sergio Paracuellos
in the fact that the related device for the board is correct. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 27 +++-- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging

Re: [PATCH v4 5/6] staging: mt7621-pci: release gpios after pci initialization

2020-03-21 Thread Sergio Paracuellos
Hi, On Sat, Mar 21, 2020 at 7:36 AM Chuanhong Guo wrote: > > Hi! > > On Sat, Mar 21, 2020 at 12:34 AM Sergio Paracuellos > wrote: > > > If I am understanding correctly for example for my gnubee this should > > > be as follows: > > > > > >

[PATCH 3/4] staging: mt7621-pci-phy: use builtin_platform_driver()

2020-03-21 Thread Sergio Paracuellos
Macro builtin_platform_driver can be used for builtin drivers that don't do anything in driver init. So, use the macro builtin_platform_driver and remove some boilerplate code. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci-phy/pci-mt7621-phy.c | 7 +-- 1 file chang

[PATCH 2/4] staging: mt7621-pci: add myself as a contributor of the driver

2020-03-21 Thread Sergio Paracuellos
d-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt7621.c index b8065b777ff6..5e80479ce653 100644 --- a/drivers/staging/mt7621-pci/pci-mt7621.c

[PATCH 4/4] staging: mt7621-pci-phy: re-do 'xtal_mode' detection

2020-03-21 Thread Sergio Paracuellos
Detection of the Xtal mode is using magic numbers that can be avoided using properly some definitions and a more accurate variable name from 'reg' into 'xtal_mode'. This increase readability. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci-phy/p

[PATCH 1/4] staging: mt7621-pci: use builtin_platform_driver()

2020-03-21 Thread Sergio Paracuellos
Macro builtin_platform_driver can be used for builtin drivers that don't do anything in driver init. So, use the macro builtin_platform_driver and remove some boilerplate code. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 7 +-- 1 file changed, 1 inse

[PATCH] staging: mt7621-pci: avoid to set 'iomem_resource' addresses

2020-03-22 Thread Sergio Paracuellos
6 Don't assign it and maintain the default addresses for this resource seems to fix the problem. Checking legacy driver it is being only setting the 'ioport_resource'. Fixes: 09dd629eeabb ("staging: mt7621-pci: fix io space and properly set resource limits") Signed-

Re: [PATCH 2/4] staging: mt7621-pci: add myself as a contributor of the driver

2020-03-23 Thread Sergio Paracuellos
Hi Greg, On Mon, Mar 23, 2020 at 11:32 AM Greg KH wrote: > > On Sat, Mar 21, 2020 at 02:36:22PM +0100, Sergio Paracuellos wrote: > > During a long time I have been cleaning and fixing this driver > > in order to use current kernel's apis and try to get it out of > >

[PATCH] staging: mt7621-pci: properly power off dual-ported pcie phy

2020-04-09 Thread Sergio Paracuellos
a power off of the phy for slots 0 and 2 if nothing is connected in them. Hence, only poweroff the phy if nothing is connected in both slot 0 and slot 1 avoiding the kernel to hang. Fixes: 5737cfe87a9c ("staging: mt7621-pci: avoid to poweroff the phy for slot one") Signed-off-by: Sergio

[PATCH 1/2] staging: mt7621-pci-phy: dt: bindings: add mediatek, mt7621-pci-phy.yaml

2020-04-10 Thread Sergio Paracuellos
Add bindings to describe Mediatek MT7621 PCIe PHY. Signed-off-by: Sergio Paracuellos --- .../mediatek,mt7621-pci-phy.yaml | 36 +++ 1 file changed, 36 insertions(+) create mode 100644 drivers/staging/mt7621-pci-phy/mediatek,mt7621-pci-phy.yaml diff --git a/drivers

[PATCH 2/2] staging: mt7621-pci-phy: dt: bindings: remove bindings txt file

2020-04-10 Thread Sergio Paracuellos
Yaml file for bindings has been properly added. Hence, remove the old txt file. Signed-off-by: Sergio Paracuellos --- .../mediatek,mt7621-pci-phy.txt | 28 --- 1 file changed, 28 deletions(-) delete mode 100644 drivers/staging/mt7621-pci-phy/mediatek,mt7621-pci

[PATCH 0/2] staging: mt7621-pci-phy: dt: bindings: convert bindings file from txt to yaml

2020-04-10 Thread Sergio Paracuellos
th soft and hard resets and the phy driver code got simplified a lot. Rob, It would be nice to know if this is a valid approach. Thanks in advance for your time. Best regards, Sergio Paracuellos Sergio Paracuellos (2): staging: mt7621-pci-phy: dt: bindings: add mediatek,mt7621-pci-phy.

Re: [PATCH] staging: mt7621-pci: simplify 'mt7621_pcie_init_virtual_bridges' function

2020-04-10 Thread Sergio Paracuellos
Hi Neil, On Sat, Apr 11, 2020 at 5:26 AM NeilBrown wrote: > > On Sun, Mar 08 2020, Sergio Paracuellos wrote: > > > Function 'mt7621_pcie_init_virtual_bridges' is a bit mess and can be > > refactorized properly in a cleaner way. Introduce new 'pcie_rmw' i

Re: [PATCH 0/2] staging: mt7621-pci-phy: dt: bindings: convert bindings file from txt to yaml

2020-04-10 Thread Sergio Paracuellos
n just forget about clocks and clock-names stuff in the pci controller binding and do what we are doing with the clock gate now which is setting up the bit manually as other similar drivers do. What do you think? (your tree has the patches of the thread I am pointed out here applied) &g

[PATCH] staging: mt7621-dts: fix PCIe interrupt mapping

2020-04-12 Thread Sergio Paracuellos
child nodes and properly update the global pcie node information. Fixes: 46d093124df4 ("staging: mt7621-pci: improve interrupt mapping") Signed-off-by: Sergio Paracuellos --- Tested in gnubee pc1 (which uses all the buses and also worked without changes) and tested also in ZyXEL LTE3301-

Re: [PATCH] staging: mt7621-dts: fix PCIe interrupt mapping

2020-04-12 Thread Sergio Paracuellos
Hi all, On Sun, Apr 12, 2020 at 12:29 PM Sergio Paracuellos wrote: > > MT7621 has three assigned interrupts for the pcie. This > interrupts should properly being mapped taking into account > which devices are finally connected in which bus. Because of > this current information of

[PATCH] staging: mt7621-pci: fix PCIe interrupt mapping

2020-04-12 Thread Sergio Paracuellos
er data node to properly map correct irq using a new 'mt7621_map_irq' function where this map will be read and the correct irq returned. Fixes: 46d093124df4 ("staging: mt7621-pci: improve interrupt mapping") Signed-off-by: Sergio Paracuellos --- Tested in gnubee pc1 (which uses a

[PATCH 2/3] staging: mt7621-pci: add clarification comment in 'mt7621_pcie_init_virtual_bridges'

2020-04-13 Thread Sergio Paracuellos
Add a comment explaining a bit what is going on in this function. It would be helfulp for other people for a better understanding of the code. Suggested-by: NeilBrown Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 5 + 1 file changed, 5 insertions(+) diff

[PATCH 3/3] staging: mt7621-pci: initialize 'n' variable when it is declared

2020-04-13 Thread Sergio Paracuellos
Variable 'n' in 'mt7621_pcie_init_virtual_bridges' function can be directly initialized when it is declared instead of doing it before using it first. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 3 +-- 1 file changed, 1 insertion(+),

[PATCH 1/3] staging: mt7621-pci: rename 'PCIE_P2P_MAX' into 'PCIE_P2P_CNT'

2020-04-13 Thread Sergio Paracuellos
Definition 'PCIE_P2P_MAX' is '3'. The value here is not a MAXimum. It is a count or a number. It is how many masks there are. The masks are numbered 0, 1, 2 so the maximum is 2. Hence rename variable into 'PCIE_P2P_CNT' which is a more accurate name. Suggested-by: Ne

Re: [PATCH] staging: rts5208: Comparisons should place the constant on the right side of the test

2016-09-15 Thread Sergio Paracuellos
That's true. It seems that checkpatch script is getting a false positive. Just trying to do checkpatch happy. Sorry for inconvenience. I'll be careful with Changelog stuff from now. Thanks for advice. Cheers, Sergio Paracuellos El 2016年09月15日 a las 16:51, Greg KH escribi

[PATCH] staging: rts5208: make some vars to lower case to keep the style consistent

2016-09-15 Thread Sergio Paracuellos
This patch fixes the checkpatch.pl warning: WARNING: Comparisons should place the constant on the right side of the test Signed-off-by: Sergio Paracuellos --- drivers/staging/rts5208/rtsx_card.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers

[PATCH 3/8] staging: rts5208: fix style warnings in rtsx_chip.h

2016-09-22 Thread Sergio Paracuellos
This patch fixes the following checkpatch.pl warning in rtsx_chip.h: WARNING: Block comments use a trailing */ on a separate line Signed-off-by: Sergio Paracuellos --- drivers/staging/rts5208/rtsx_chip.h | 52 +++-- 1 file changed, 27 insertions(+), 25 deletions

[PATCH 2/8] staging: rts5208: fix style warnings in rtsx.c

2016-09-22 Thread Sergio Paracuellos
This patch fixes the following checkpatch.pl warning in rtsx.c: WARNING: Symbolic permissions are not preferred. Signed-off-by: Sergio Paracuellos --- drivers/staging/rts5208/rtsx.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/rts5208/rtsx.c b

[PATCH 4/8] staging: rts5208: fix style warnings in rtsx.h

2016-09-22 Thread Sergio Paracuellos
This patch fixes the following checkpatch.pl warning in rtsx.h: WARNING: Block comments use a trailing */ on a separate line Signed-off-by: Sergio Paracuellos --- drivers/staging/rts5208/rtsx.h | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rts5208

[PATCH 0/8] staging: rts5208: Fix several style warnings

2016-09-22 Thread Sergio Paracuellos
This patchset fix several style warnings reported by checkpatch.pl script. Sergio Paracuellos (8): staging: rts5208: fix style warnings in rtsx.h staging: rts5208: fix style warnings in rtsx.c staging: rts5208: fix style warnings in rtsx_chip.h staging: rts5208: fix style warnings in

[PATCH 5/8] staging: rts5208: fix style warnings in rtsx_sys.h

2016-09-22 Thread Sergio Paracuellos
This patch fixes the following checkpatch.pl warning in rtsx_sys.h: WARNING: do not add new typedefs Signed-off-by: Sergio Paracuellos --- drivers/staging/rts5208/rtsx_sys.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/rts5208/rtsx_sys.h b/drivers/staging/rts5208

[PATCH 8/8] staging: rts5208: fix style warnings in xd.c

2016-09-22 Thread Sergio Paracuellos
This patch fixes the following checkpatch.pl warning in xd.c: WARNING: else is not generally useful after a break or return It also makes code more uniform with the new changes Signed-off-by: Sergio Paracuellos --- drivers/staging/rts5208/xd.c | 38 ++ 1

[PATCH 7/8] staging: rts5208: fix style warnings in sd.c

2016-09-22 Thread Sergio Paracuellos
This patch fixes the following checkpatch.pl warning in sd.c: WARNING: else is not generally useful after a break or return It also makes code more uniform with the new changes Signed-off-by: Sergio Paracuellos --- drivers/staging/rts5208/sd.c | 173

[PATCH 6/8] staging: rts5208: fix style warnings in spi.c

2016-09-22 Thread Sergio Paracuellos
This patch fixes the following checkpatch.pl warning in spi.c: WARNING: line over 80 characters Signed-off-by: Sergio Paracuellos --- drivers/staging/rts5208/spi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/rts5208/spi.c b/drivers/staging/rts5208

[PATCH 1/8] staging: rts5208: fix style warnings in rtsx.h

2016-09-22 Thread Sergio Paracuellos
This patch fixes the following checkpatch.pl warning in rtsx.h: WARNING: do not add new typedefs Signed-off-by: Sergio Paracuellos --- drivers/staging/rts5208/rtsx.h | 4 drivers/staging/rts5208/rtsx_chip.h | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers

[PATCH] staging: wlan-ng: avoid to introduce new typedefs

2016-09-22 Thread Sergio Paracuellos
This patch fixes the following checkpatch.pl warning in p80211types.h: WARNING: do not add new typedefs Signed-off-by: Sergio Paracuellos --- drivers/staging/wlan-ng/cfg80211.c | 12 +- drivers/staging/wlan-ng/p80211metastruct.h | 248 ++--- drivers/staging/wlan

[PATCH 00/20] staging: wlan-ng: fix some style issues in p80211types.h

2016-09-23 Thread Sergio Paracuellos
This patchset fix some style issues reported by checkpatch.pl script. Sergio Paracuellos (20): staging: wlan-ng: avoid new typedef: p80211enumpair_t staging: wlan-ng: avoid new typedef: p80211enum_t staging: wlan-ng: avoid new typedef: p80211pstr_t staging: wlan-ng: avoid new typedef

[PATCH] staging: wlan-ng: avoid to introduce new typedefs

2016-09-23 Thread Sergio Paracuellos
This patch fixes the following checkpatch.pl warning in p80211types.h: WARNING: do not add new typedefs Signed-off-by: Sergio Paracuellos --- drivers/staging/wlan-ng/cfg80211.c | 12 +- drivers/staging/wlan-ng/p80211metastruct.h | 248 ++--- drivers/staging/wlan

[PATCH 03/20] staging: wlan-ng: avoid new typedef: p80211pstr_t

2016-09-23 Thread Sergio Paracuellos
This patch fixes the following checkpatch.pl warning in p80211types.h: WARNING: do not add new typedefs It applies for typedef p80211pstr_t Signed-off-by: Sergio Paracuellos --- drivers/staging/wlan-ng/p80211types.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a

[PATCH 01/20] staging: wlan-ng: avoid new typedef: p80211enumpair_t

2016-09-23 Thread Sergio Paracuellos
This patch fixes the following checkpatch.pl warning in p80211types.h: WARNING: do not add new typedefs It applies for typedef p80211enumpair_t. Signed-off-by: Sergio Paracuellos --- drivers/staging/wlan-ng/p80211types.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a

[PATCH 02/20] staging: wlan-ng: avoid new typedef: p80211enum_t

2016-09-23 Thread Sergio Paracuellos
This patch fixes the following checkpatch.pl warning in p80211types.h: WARNING: do not add new typedefs It applies for typedef p80211enum_t. Signed-off-by: Sergio Paracuellos --- drivers/staging/wlan-ng/p80211types.h | 44 +-- 1 file changed, 22 insertions

<    10   11   12   13   14   15   16   17   18   19   >