aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/spi/spi-pxa2xx-pci.c8
-rw-r--r--drivers/spi/spi-pxa2xx.c44
-rw-r--r--include/linux/pxa2xx_ssp.h3
3 files changed, 36 insertions, 19 deletions
diff --git a/drivers/spi/spi-pxa2xx-pci.c b/drivers/spi/spi-pxa2xx-pci.c
index fa7399e84bbb..3cfd4357489a 100644
--- a/drivers/spi/spi-pxa2xx-pci.c
+++ b/drivers/spi/spi-pxa2xx-pci.c
@@ -62,7 +62,7 @@ static struct pxa_spi_info spi_info_configs[] = {
62 .max_clk_rate = 3686400, 62 .max_clk_rate = 3686400,
63 }, 63 },
64 [PORT_BYT] = { 64 [PORT_BYT] = {
65 .type = LPSS_SSP, 65 .type = LPSS_BYT_SSP,
66 .port_id = 0, 66 .port_id = 0,
67 .num_chipselect = 1, 67 .num_chipselect = 1,
68 .max_clk_rate = 50000000, 68 .max_clk_rate = 50000000,
@@ -70,7 +70,7 @@ static struct pxa_spi_info spi_info_configs[] = {
70 .rx_param = &byt_rx_param, 70 .rx_param = &byt_rx_param,
71 }, 71 },
72 [PORT_BSW0] = { 72 [PORT_BSW0] = {
73 .type = LPSS_SSP, 73 .type = LPSS_BYT_SSP,
74 .port_id = 0, 74 .port_id = 0,
75 .num_chipselect = 1, 75 .num_chipselect = 1,
76 .max_clk_rate = 50000000, 76 .max_clk_rate = 50000000,
@@ -78,7 +78,7 @@ static struct pxa_spi_info spi_info_configs[] = {
78 .rx_param = &bsw0_rx_param, 78 .rx_param = &bsw0_rx_param,
79 }, 79 },
80 [PORT_BSW1] = { 80 [PORT_BSW1] = {
81 .type = LPSS_SSP, 81 .type = LPSS_BYT_SSP,
82 .port_id = 1, 82 .port_id = 1,
83 .num_chipselect = 1, 83 .num_chipselect = 1,
84 .max_clk_rate = 50000000, 84 .max_clk_rate = 50000000,
@@ -86,7 +86,7 @@ static struct pxa_spi_info spi_info_configs[] = {
86 .rx_param = &bsw1_rx_param, 86 .rx_param = &bsw1_rx_param,
87 }, 87 },
88 [PORT_BSW2] = { 88 [PORT_BSW2] = {
89 .type = LPSS_SSP, 89 .type = LPSS_BYT_SSP,
90 .port_id = 2, 90 .port_id = 2,
91 .num_chipselect = 1, 91 .num_chipselect = 1,
92 .max_clk_rate = 50000000, 92 .max_clk_rate = 50000000,
diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c
index e3223ac75a7c..a85b7496a3cd 100644
--- a/drivers/spi/spi-pxa2xx.c
+++ b/drivers/spi/spi-pxa2xx.c
@@ -74,7 +74,13 @@ MODULE_ALIAS("platform:pxa2xx-spi");
74 74
75static bool is_lpss_ssp(const struct driver_data *drv_data) 75static bool is_lpss_ssp(const struct driver_data *drv_data)
76{ 76{
77 return drv_data->ssp_type == LPSS_SSP; 77 switch (drv_data->ssp_type) {
78 case LPSS_LPT_SSP:
79 case LPSS_BYT_SSP:
80 return true;
81 default:
82 return false;
83 }
78} 84}
79 85
80static bool is_quark_x1000_ssp(const struct driver_data *drv_data) 86static bool is_quark_x1000_ssp(const struct driver_data *drv_data)
@@ -1085,7 +1091,8 @@ static int setup(struct spi_device *spi)
1085 tx_hi_thres = 0; 1091 tx_hi_thres = 0;
1086 rx_thres = RX_THRESH_QUARK_X1000_DFLT; 1092 rx_thres = RX_THRESH_QUARK_X1000_DFLT;
1087 break; 1093 break;
1088 case LPSS_SSP: 1094 case LPSS_LPT_SSP:
1095 case LPSS_BYT_SSP:
1089 tx_thres = LPSS_TX_LOTHRESH_DFLT; 1096 tx_thres = LPSS_TX_LOTHRESH_DFLT;
1090 tx_hi_thres = LPSS_TX_HITHRESH_DFLT; 1097 tx_hi_thres = LPSS_TX_HITHRESH_DFLT;
1091 rx_thres = LPSS_RX_THRESH_DFLT; 1098 rx_thres = LPSS_RX_THRESH_DFLT;
@@ -1242,6 +1249,18 @@ static void cleanup(struct spi_device *spi)
1242} 1249}
1243 1250
1244#ifdef CONFIG_ACPI 1251#ifdef CONFIG_ACPI
1252
1253static struct acpi_device_id pxa2xx_spi_acpi_match[] = {
1254 { "INT33C0", LPSS_LPT_SSP },
1255 { "INT33C1", LPSS_LPT_SSP },
1256 { "INT3430", LPSS_LPT_SSP },
1257 { "INT3431", LPSS_LPT_SSP },
1258 { "80860F0E", LPSS_BYT_SSP },
1259 { "8086228E", LPSS_BYT_SSP },
1260 { },
1261};
1262MODULE_DEVICE_TABLE(acpi, pxa2xx_spi_acpi_match);
1263
1245static struct pxa2xx_spi_master * 1264static struct pxa2xx_spi_master *
1246pxa2xx_spi_acpi_get_pdata(struct platform_device *pdev) 1265pxa2xx_spi_acpi_get_pdata(struct platform_device *pdev)
1247{ 1266{
@@ -1249,12 +1268,19 @@ pxa2xx_spi_acpi_get_pdata(struct platform_device *pdev)
1249 struct acpi_device *adev; 1268 struct acpi_device *adev;
1250 struct ssp_device *ssp; 1269 struct ssp_device *ssp;
1251 struct resource *res; 1270 struct resource *res;
1252 int devid; 1271 const struct acpi_device_id *id;
1272 int devid, type;
1253 1273
1254 if (!ACPI_HANDLE(&pdev->dev) || 1274 if (!ACPI_HANDLE(&pdev->dev) ||
1255 acpi_bus_get_device(ACPI_HANDLE(&pdev->dev), &adev)) 1275 acpi_bus_get_device(ACPI_HANDLE(&pdev->dev), &adev))
1256 return NULL; 1276 return NULL;
1257 1277
1278 id = acpi_match_device(pdev->dev.driver->acpi_match_table, &pdev->dev);
1279 if (id)
1280 type = (int)id->driver_data;
1281 else
1282 return NULL;
1283
1258 pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); 1284 pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
1259 if (!pdata) 1285 if (!pdata)
1260 return NULL; 1286 return NULL;
@@ -1272,7 +1298,7 @@ pxa2xx_spi_acpi_get_pdata(struct platform_device *pdev)
1272 1298
1273 ssp->clk = devm_clk_get(&pdev->dev, NULL); 1299 ssp->clk = devm_clk_get(&pdev->dev, NULL);
1274 ssp->irq = platform_get_irq(pdev, 0); 1300 ssp->irq = platform_get_irq(pdev, 0);
1275 ssp->type = LPSS_SSP; 1301 ssp->type = type;
1276 ssp->pdev = pdev; 1302 ssp->pdev = pdev;
1277 1303
1278 ssp->port_id = -1; 1304 ssp->port_id = -1;
@@ -1285,16 +1311,6 @@ pxa2xx_spi_acpi_get_pdata(struct platform_device *pdev)
1285 return pdata; 1311 return pdata;
1286} 1312}
1287 1313
1288static struct acpi_device_id pxa2xx_spi_acpi_match[] = {
1289 { "INT33C0", 0 },
1290 { "INT33C1", 0 },
1291 { "INT3430", 0 },
1292 { "INT3431", 0 },
1293 { "80860F0E", 0 },
1294 { "8086228E", 0 },
1295 { },
1296};
1297MODULE_DEVICE_TABLE(acpi, pxa2xx_spi_acpi_match);
1298#else 1314#else
1299static inline struct pxa2xx_spi_master * 1315static inline struct pxa2xx_spi_master *
1300pxa2xx_spi_acpi_get_pdata(struct platform_device *pdev) 1316pxa2xx_spi_acpi_get_pdata(struct platform_device *pdev)
diff --git a/include/linux/pxa2xx_ssp.h b/include/linux/pxa2xx_ssp.h
index dab545bb66b3..95a4b3bd7a5c 100644
--- a/include/linux/pxa2xx_ssp.h
+++ b/include/linux/pxa2xx_ssp.h
@@ -194,8 +194,9 @@ enum pxa_ssp_type {
194 PXA168_SSP, 194 PXA168_SSP,
195 PXA910_SSP, 195 PXA910_SSP,
196 CE4100_SSP, 196 CE4100_SSP,
197 LPSS_SSP,
198 QUARK_X1000_SSP, 197 QUARK_X1000_SSP,
198 LPSS_LPT_SSP,
199 LPSS_BYT_SSP,
199}; 200};
200 201
201struct ssp_device { 202struct ssp_device {