RALINK_PCI_PCICFG_ADDR and RALINK_PCI_PCIMSK_ADDR are defined to be directly
referenced for read and write. Use pcie_read and pcie_write instead changing
its definition to a simple relative offset to pcie base address.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621
Instead of custom macros use pcie_read and pcie_write functions.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 67 -
1 file changed, 32 insertions(+), 35 deletions(-)
diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c
b
The driver is not using PCI_LEGACY code anymore and shall use the
PCI_DRIVERS_GENERIC option to correct compile it. Add new Kconfig
file for this controller setting there its correct dependencies.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/Kconfig| 2 ++
drivers/staging
map_bus callback is called before every .read/.write operation.
Implement it and change custom read write operations for the
pci subsystem generics. Make the probe function to don't use
legacy stuff and request bus resources directly. Get pci register
base from device tree.
Signed-off-by: Sergio
RALINK_PCI_BASE has no sense and this driver has base address readed
and mapped from device tree. Remove remaining uses of it and
change code to use pcie_read and pcie_write functions in places
where this was being used.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci
The pcie node of the device tree only contains registers
for the host-bridge and pcie port 0. Add the pcie port 1
and pcie port 2 also.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-dts/mt7621.dtsi | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers
Driver is using now pci subsystem generics reads and writes and requesting
bus resources without using legacy code functions. Because of this there is
a lot of dead code that can be removed.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 171
Use pcie_[read|write] fucntions to read and write controller registers.
Define those only by offset and pass controller offset + register offset
relative to base address to functions.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 62
There are some includes that are being used that are not really
needed to correct driver compilation. Remove them and reorder the
rest alphabetically.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 22 --
1 file changed, 8 insertions(+), 14
Introdice this functions to make easier to write/read to/from
an offset relative to base address
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 10 ++
1 file changed, 10 insertions(+)
diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c
b/drivers
RALINK_PCI_CONFIG_DATA_VIRTUAL_REG is a very long name. Make it a bit
shorter renaming it to RALINK_PCI_CONFIG_DATA.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/mt7621
Introdice this functions to make easier to write/read to/from
an offset relative to base address
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 10 ++
1 file changed, 10 insertions(+)
diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c
b/drivers
Driver is using now pci subsystem generics reads and writes and requesting
bus resources without using legacy code functions. Because of this there is
a lot of dead code that can be removed.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 171
There some macros that are not being used. Remove them.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 29 +
1 file changed, 1 insertion(+), 28 deletions(-)
diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c
b/drivers/staging
Instead of custom macros use pcie_read and pcie_write functions.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 67 -
1 file changed, 32 insertions(+), 35 deletions(-)
diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c
b
read_config function is always called with bus and func
being 0. Avoid those params and just use 0 inside the
function. Return readed value instead pass a reference
parameter.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 32 +++-
1
ate a new port structure (platform has 3 pcie controllers)
- Replace the use of pci_generic_config_[read|write]32 in favour
of pci_generic_config_[read|write] and change map_bus implemen-
tation for hopefully the right one.
Best regards,
Sergio Paracuellos
Sergio Paracuellos
pcibios_* remaining code is not neccessary at all. We are mapping
irq using of_irq_parse_and_map_pci and swizzle_irq which are set
in driver 'probe' function. Remove this code. No kernel config
option CONFIG_PCI_DRIVERS_LEGACY should be included anymore.
Signed-off-by: Sergio Paracuellos
map_bus callback is called before every .read/.write operation.
Implement it and change custom read write operations for the
pci subsystem generics. Make the probe function to don't use
legacy stuff and request bus resources directly. Get pci register
base from device tree.
Signed-off-by: Sergio
Use pcie_[read|write] fucntions to read and write controller registers.
Define those only by offset and pass controller offset + register offset
relative to base address to functions.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 62
write_config function is always called with bus and func
being 0. Avoid those params and just use 0 inside the
function. Review parameter types changing for more proper
ones.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 20 +---
1 file changed
Some preprocessor definitions are using a custom implementation of
BIT macro. Just use linux kernel BIT macro instead.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 20 ++--
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers
There are some includes that are being used that are not really
needed to correct driver compilation. Remove them and reorder the
rest alphabetically.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 22 --
1 file changed, 8 insertions(+), 14
The pcie node of the device tree only contains registers
for the host-bridge and pcie port 0. Add the pcie port 1
and pcie port 2 also.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-dts/mt7621.dtsi | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers
RALINK_PCI_CONFIG_DATA_VIRTUAL_REG is a very long name. Make it a bit
shorter renaming it to RALINK_PCI_CONFIG_DATA.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/mt7621
RALINK_PCI_BASE has no sense and this driver has base address readed
and mapped from device tree. Remove remaining uses of it and
change code to use pcie_read and pcie_write functions in places
where this was being used.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci
RALINK_PCI_PCICFG_ADDR and RALINK_PCI_PCIMSK_ADDR are defined to be directly
referenced for read and write. Use pcie_read and pcie_write instead changing
its definition to a simple relative offset to pcie base address.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621
The driver is not using PCI_LEGACY code anymore and shall use the
PCI_DRIVERS_GENERIC option to correct compile it. Add new Kconfig
file for this controller setting there its correct dependencies.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/Kconfig| 2 ++
drivers/staging
On Mon, Aug 6, 2018 at 2:21 AM, NeilBrown wrote:
> On Fri, Aug 03 2018, Sergio Paracuellos wrote:
>
>> This patch series include an attempt to avoid the use of custom
>> read and writes in driver code and use PCI subsystem common ones.
>>
>> In order to do this 'ma
,
Sergio Paracuellos
Sergio Paracuellos (11):
staging: mt7621-pci: parse and init port data from device tree
staging: mt7621-pci: replace return value if
devm_pci_alloc_host_bridge call fails
staging: mt7621-pci: add two helpers for read and write pcie register
ports
staging: mt7621-pci
mt7621-pcie_port data structure has filed 'base' as the base address for
read and write related port registers. Create two inline functions
'pcie_port_read' and 'pcie_port_write' to make this task easier and
code more readable.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci
Driver probe function calls 'devm_pci_alloc_host_bridge'. If this call fails
it is returning -ENODEV. Return -ENOMEM instead which is more accurate for
this.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff
Driver probe function is a mess and shall be refactored a lot. At first
make use of assert and deassert control factoring out a new function
called 'mt7621_pcie_enable_port'.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 92 -
1
Add initialization of each PCIe port reading and initializing
data using device tree.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 74 +++--
1 file changed, 70 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/mt7621-pci
This file has a valid SPDX license line added so reamining
GPL2+ boilerplate text is not needed at all. Remove it.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 31 +++
1 file changed, 3 insertions(+), 28 deletions(-)
diff --git
Reset bits related macros are in different parts. Reagroup
all of them together to improve readability.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c
There are some functions in driver code that can be declared
'static'. Just do it.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c
b/drivers/staging
Driver is using reset_control kernel API's to manage this so this
two macros are not needed anymore. Remove them.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 15 ---
1 file changed, 15 deletions(-)
diff --git a/drivers/staging/mt7621-pci/pci
This two lines whch are commented are not needed at all.
Remove them.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 5 -
1 file changed, 5 deletions(-)
diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c
b/drivers/staging/mt7621-pci/pci-mt7621.c
index
There are some printk's which can be replaced properly
using dev_* kernel functions. Use dev_info to show
N_FTS status for each port using a loop instead of duplicating
lines of code.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 13 +
1 file
There are three macros which are not being used at all.
Remove them.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 4
1 file changed, 4 deletions(-)
diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c
b/drivers/staging/mt7621-pci/pci-mt7621.c
index
On Wed, Aug 8, 2018 at 2:08 PM, Greg KH wrote:
> On Mon, Aug 06, 2018 at 10:21:46AM +1000, NeilBrown wrote:
>> On Fri, Aug 03 2018, Sergio Paracuellos wrote:
>>
>> > This patch series include an attempt to avoid the use of custom
>> > read and writes in driver
mt7621-pcie_port data structure has filed 'base' as the base address for
read and write related port registers. Create two inline functions
'pcie_port_read' and 'pcie_port_write' to make this task easier and
code more readable.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci
of the driver
- fix some checkpatch complains
- make use of sysctl from DT
Hope this helps.
Best regards,
Sergio Paracuellos
Sergio Paracuellos (20):
staging: mt7621-pci: parse and init port data from device tree
staging: mt7621-pci: replace return value
checkpatch script is complaining about the use of printk instead
of use more proper dev_* kernel functions. Replace all of them
removing warnings.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 14 --
1 file changed, 8 insertions(+), 6 deletions
Static variables are initialised to 0 by GCC and checkpatch
script also complains about that. Make it happy.
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
macros also
resetting and adding bits using bitwise operators directly in the
code. Now these function are offset-based on the port to use them
cleaner in driver probe functio and improving readability.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 287
There are some pointer read and writes which can be replaced
properly using sysctl registers readed from device tree. Remap
sysctl registers and replace in proper places.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 38 -
1 file
There are some printk's which can be replaced properly
using dev_* kernel functions. Use dev_info to show
N_FTS status for each port using a loop instead of duplicating
lines of code.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 13 +
1 file
Reset bits related macros are in different parts. Reagroup
all of them together to improve readability.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c
Move debug for the port N_FTS from driver probe function to the more
appropiate one 'mt7621_pcie_enable_port'.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 10 --
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/mt7621-pci
Driver probe function calls 'devm_pci_alloc_host_bridge'. If this call fails
it is returning -ENODEV. Return -ENOMEM instead which is more accurate for
this.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff
There are some functions in driver code that can be declared
'static'. Just do it.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c
b/drivers/staging
Add initialization of each PCIe port reading and initializing
data using device tree.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 74 +++--
1 file changed, 70 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/mt7621-pci
Driver probe function is a mess and shall be refactored a lot. At first
make use of assert and deassert control factoring out a new function
called 'mt7621_pcie_enable_port'.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 92 -
1
This file has a valid SPDX license line added so reamining
GPL2+ boilerplate text is not needed at all. Remove it.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 31 +++
1 file changed, 3 insertions(+), 28 deletions(-)
diff --git
There are three macros which are not being used at all.
Remove them.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 4
1 file changed, 4 deletions(-)
diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c
b/drivers/staging/mt7621-pci/pci-mt7621.c
index
Chackpatch script is compalining about one comment which
is not following the kernel style. Fix it.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c
b
Rename function 'mt7621_pcie_enable_port' with a name which is better
for what the function is really doing calling it 'mt7621_pcie_init_port'.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git
This two lines whch are commented are not needed at all.
Remove them.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 5 -
1 file changed, 5 deletions(-)
diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c
b/drivers/staging/mt7621-pci/pci-mt7621.c
index
Driver is using reset_control kernel API's to manage this so this
two macros are not needed anymore. Remove them.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 15 ---
1 file changed, 15 deletions(-)
diff --git a/drivers/staging/mt7621-pci/pci
Factor out a new function 'mt7621_enable_phy' for enabling the
pcie phy for each port and call it from 'mt7621_pcie_enable_port'.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 13 ++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git
Add missing system control registers address in pcie node of
the device tree.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-dts/mt7621.dtsi | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/mt7621-dts/mt7621.dtsi
b/drivers/staging/mt7621-dts
On Tue, Aug 14, 2018 at 12:51 PM, Dan Carpenter
wrote:
> On Sun, Aug 12, 2018 at 08:45:57PM +0200, Sergio Paracuellos wrote:
>> @@ -561,15 +660,13 @@ static int mt7621_pci_probe(struct platform_device
>> *pdev)
>>
>> mdelay(100);
>>
>> - list_for_
On Tue, Aug 14, 2018 at 12:43 PM, Dan Carpenter
wrote:
> On Sun, Aug 12, 2018 at 08:45:49PM +0200, Sergio Paracuellos wrote:
>> Driver probe function is a mess and shall be refactored a lot. At first
>> make use of assert and deassert control factoring out a new fun
On Tue, Aug 14, 2018 at 12:46 PM, Dan Carpenter
wrote:
> On Sun, Aug 12, 2018 at 08:45:56PM +0200, Sergio Paracuellos wrote:
>> diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c
>> b/drivers/staging/mt7621-pci/pci-mt7621.c
>> index ec1d822..f499c108 100644
>> --- a
On Mon, Aug 20, 2018 at 3:33 AM, NeilBrown wrote:
> On Sun, Aug 12 2018, Sergio Paracuellos wrote:
>
>> This patch series parse remaining port info from device tree storing
>> it in mt7621_pcie_port struct created for this.
>>
>> Also minor cleanups are performed
Driver probe function is a mess and shall be refactored a lot. At first
make use of assert and deassert control factoring out a new function
called 'mt7621_pcie_enable_port'.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 88 +++--
1
mt7621-pcie_port data structure has filed 'base' as the base address for
read and write related port registers. Create two inline functions
'pcie_port_read' and 'pcie_port_write' to make this task easier and
code more readable.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci
of the driver
- fix some checkpatch complains
- make use of sysctl from DT
Hope this helps.
Best regards,
Sergio Paracuellos
Sergio Paracuellos (20):
staging: mt7621-pci: parse and init port data from device tree
staging: mt7621-pci: replace return value
This file has a valid SPDX license line added so reamining
GPL2+ boilerplate text is not needed at all. Remove it.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 31 +++
1 file changed, 3 insertions(+), 28 deletions(-)
diff --git
There are three macros which are not being used at all.
Remove them.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 4
1 file changed, 4 deletions(-)
diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c
b/drivers/staging/mt7621-pci/pci-mt7621.c
index
Add initialization of each PCIe port reading and initializing
data using device tree.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 75 +++--
1 file changed, 71 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/mt7621-pci
This two lines whch are commented are not needed at all.
Remove them.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 5 -
1 file changed, 5 deletions(-)
diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c
b/drivers/staging/mt7621-pci/pci-mt7621.c
index
There are some functions in driver code that can be declared
'static'. Just do it.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c
b/drivers/staging
Reset bits related macros are in different parts. Reagroup
all of them together to improve readability.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c
Factor out a new function 'mt7621_enable_phy' for enabling the
pcie phy for each port and call it from 'mt7621_pcie_enable_port'.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 13 ++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git
Add missing system control registers address in pcie node of
the device tree.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-dts/mt7621.dtsi | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/mt7621-dts/mt7621.dtsi
b/drivers/staging/mt7621-dts
There are some printk's which can be replaced properly
using dev_* kernel functions. Use dev_info to show
N_FTS status for each port using a loop instead of duplicating
lines of code.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 13 +
1 file
checkpatch script is complaining about the use of printk instead
of use more proper dev_* kernel functions. Replace all of them
removing warnings.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 14 --
1 file changed, 8 insertions(+), 6 deletions
Driver probe function calls 'devm_pci_alloc_host_bridge'. If this call fails
it is returning -ENODEV. Return -ENOMEM instead which is more accurate for
this.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff
Driver is using reset_control kernel API's to manage this so this
two macros are not needed anymore. Remove them.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 15 ---
1 file changed, 15 deletions(-)
diff --git a/drivers/staging/mt7621-pci/pci
Move debug for the port N_FTS from driver probe function to the more
appropiate one 'mt7621_pcie_enable_port'.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/mt7621-pci/pci
macros also
resetting and adding bits using bitwise operators directly in the
code. Now these function are offset-based on the port to use them
cleaner in driver probe functio and improving readability.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 295
There are some pointer read and writes which can be replaced
properly using sysctl registers readed from device tree. Remap
sysctl registers and replace in proper places.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 38 -
1 file
Static variables are initialised to 0 by GCC and checkpatch
script also complains about that. Make it happy.
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
This commit adds device tree bindings documentation for PCIEE controller
of MT7621 SoC.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/mediatek,mt7621-pci.txt | 97 ++
1 file changed, 97 insertions(+)
create mode 100644 drivers/staging/mt7621-pci/mediatek
On Sat, Jul 14, 2018 at 10:04:32AM +1000, NeilBrown wrote:
> On Tue, Jul 10 2018, Sergio Paracuellos wrote:
>
> > map_bus callback is called before every .read/.write operation.
> > Implement it and change custom read write operations for the
> > pci subsystem generics.
map_bus callback is called before every .read/.write operation.
Implement it and change custom read write operations for the
pci subsystem generics. Make the probe function to don't use
legacy stuff and request bus resources directly. Get pci register
base from device tree.
Signed-off-by: Sergio
Introdice this functions to make easier to write/read to/from
an offset relative to base address
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 10 ++
1 file changed, 10 insertions(+)
diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c
b/drivers
of pci_generic_config_[read|write] and change map_bus implemen-
tation for hopefully the right one.
Best regards,
Sergio Paracuellos (15):
staging: mt7621-pci: use generic kernel pci subsystem read and write
staging: mt7621-pci: remove dead code derived to not use custom reads
and writes
RALINK_PCI_BASE has no sense and this driver has base address readed
and mapped from device tree. Remove remaining uses of it and
change code to use pcie_read and pcie_write functions in places
where this was being used.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci
There some macros that are not being used. Remove them.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 29 +
1 file changed, 1 insertion(+), 28 deletions(-)
diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c
b/drivers/staging
linux/pci.h is being included twice. Remove one of them.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c
b/drivers/staging/mt7621-pci/pci-mt7621.c
index 41e03e3..3befd76
write_config function is always called with bus and func
being 0. Avoid those params and just use 0 inside the
function. Review parameter types changing for more proper
ones.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 20 +---
1 file changed
RALINK_PCI_CONFIG_DATA_VIRTUAL_REG is a very long name. Make it a bit
shorter renaming it to RALINK_PCI_CONFIG_DATA.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/mt7621
read_config function is always called with bus and func
being 0. Avoid those params and just use 0 inside the
function. Return readed value instead pass a reference
parameter.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 32 +++-
1
RALINK_PCI_PCICFG_ADDR and RALINK_PCI_PCIMSK_ADDR are defined to be directly
referenced for read and write. Use pcie_read and pcie_write instead changing
its definition to a simple relative offset to pcie base address.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621
Instead of custom macros use pcie_read and pcie_write functions.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 67 -
1 file changed, 32 insertions(+), 35 deletions(-)
diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c
b
Driver is using now pci subsystem generics reads and writes and requesting
bus resources without using legacy code functions. Because of this there is
a lot of dead code that can be removed.
Signed-off-by: Sergio Paracuellos
---
drivers/staging/mt7621-pci/pci-mt7621.c | 172
901 - 1000 of 1965 matches
Mail list logo