lkml.org 
[lkml]   [2022]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v1 02/11] spi: pxa2xx-pci: Refactor Quark X1000 to use ->setup()
Date
Refactor Quark X1000 handling code to use ->setup() instead of using
the configuration data structure directly.

It will allow to refactor further to avoid intermediate storage for
the used configuration parameters.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/spi/spi-pxa2xx-pci.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-pxa2xx-pci.c b/drivers/spi/spi-pxa2xx-pci.c
index bd20379d9342..4d617ad72bca 100644
--- a/drivers/spi/spi-pxa2xx-pci.c
+++ b/drivers/spi/spi-pxa2xx-pci.c
@@ -167,6 +167,14 @@ static int mrfld_spi_setup(struct pci_dev *dev, struct pxa_spi_info *c)
return 0;
}

+static int qrk_spi_setup(struct pci_dev *dev, struct pxa_spi_info *c)
+{
+ c->num_chipselect = 1;
+ c->max_clk_rate = 50000000;
+
+ return 0;
+}
+
static struct pxa_spi_info spi_info_configs[] = {
[PORT_CE4100] = {
.type = PXA25x_SSP,
@@ -209,8 +217,7 @@ static struct pxa_spi_info spi_info_configs[] = {
[PORT_QUARK_X1000] = {
.type = QUARK_X1000_SSP,
.port_id = -1,
- .num_chipselect = 1,
- .max_clk_rate = 50000000,
+ .setup = qrk_spi_setup,
},
[PORT_LPT0] = {
.type = LPSS_LPT_SSP,
--
2.34.1
\
 
 \ /
  Last update: 2022-02-25 18:27    [W:0.062 / U:1.396 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site