Commit 60ba4431 authored by Yang Yingliang's avatar Yang Yingliang Committed by Mark Brown

spi: pxa2xx: switch to use modern name

Change legacy name master/slave to modern name host/target or controller.

No functional changed.
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230818093154.1183529-8-yangyingliang@huawei.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 71345830
...@@ -1102,7 +1102,7 @@ static int pxa2xx_spi_transfer_one(struct spi_controller *controller, ...@@ -1102,7 +1102,7 @@ static int pxa2xx_spi_transfer_one(struct spi_controller *controller,
} }
} }
if (spi_controller_is_slave(controller)) { if (spi_controller_is_target(controller)) {
while (drv_data->write(drv_data)) while (drv_data->write(drv_data))
; ;
if (drv_data->gpiod_ready) { if (drv_data->gpiod_ready) {
...@@ -1121,7 +1121,7 @@ static int pxa2xx_spi_transfer_one(struct spi_controller *controller, ...@@ -1121,7 +1121,7 @@ static int pxa2xx_spi_transfer_one(struct spi_controller *controller,
return 1; return 1;
} }
static int pxa2xx_spi_slave_abort(struct spi_controller *controller) static int pxa2xx_spi_target_abort(struct spi_controller *controller)
{ {
struct driver_data *drv_data = spi_controller_get_devdata(controller); struct driver_data *drv_data = spi_controller_get_devdata(controller);
...@@ -1199,7 +1199,7 @@ static int setup(struct spi_device *spi) ...@@ -1199,7 +1199,7 @@ static int setup(struct spi_device *spi)
break; break;
default: default:
tx_hi_thres = 0; tx_hi_thres = 0;
if (spi_controller_is_slave(drv_data->controller)) { if (spi_controller_is_target(drv_data->controller)) {
tx_thres = 1; tx_thres = 1;
rx_thres = 2; rx_thres = 2;
} else { } else {
...@@ -1248,7 +1248,7 @@ static int setup(struct spi_device *spi) ...@@ -1248,7 +1248,7 @@ static int setup(struct spi_device *spi)
} }
chip->cr1 = 0; chip->cr1 = 0;
if (spi_controller_is_slave(drv_data->controller)) { if (spi_controller_is_target(drv_data->controller)) {
chip->cr1 |= SSCR1_SCFR; chip->cr1 |= SSCR1_SCFR;
chip->cr1 |= SSCR1_SCLKDIR; chip->cr1 |= SSCR1_SCLKDIR;
chip->cr1 |= SSCR1_SFRMDIR; chip->cr1 |= SSCR1_SFRMDIR;
...@@ -1395,7 +1395,7 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev) ...@@ -1395,7 +1395,7 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev)
else else
ssp->port_id = uid; ssp->port_id = uid;
pdata->is_slave = device_property_read_bool(dev, "spi-slave"); pdata->is_target = device_property_read_bool(dev, "spi-slave");
pdata->num_chipselect = 1; pdata->num_chipselect = 1;
pdata->enable_dma = true; pdata->enable_dma = true;
pdata->dma_burst_size = 1; pdata->dma_burst_size = 1;
...@@ -1461,10 +1461,10 @@ static int pxa2xx_spi_probe(struct platform_device *pdev) ...@@ -1461,10 +1461,10 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
return -ENODEV; return -ENODEV;
} }
if (platform_info->is_slave) if (platform_info->is_target)
controller = devm_spi_alloc_slave(dev, sizeof(*drv_data)); controller = devm_spi_alloc_target(dev, sizeof(*drv_data));
else else
controller = devm_spi_alloc_master(dev, sizeof(*drv_data)); controller = devm_spi_alloc_host(dev, sizeof(*drv_data));
if (!controller) { if (!controller) {
dev_err(&pdev->dev, "cannot alloc spi_controller\n"); dev_err(&pdev->dev, "cannot alloc spi_controller\n");
...@@ -1487,7 +1487,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev) ...@@ -1487,7 +1487,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
controller->setup = setup; controller->setup = setup;
controller->set_cs = pxa2xx_spi_set_cs; controller->set_cs = pxa2xx_spi_set_cs;
controller->transfer_one = pxa2xx_spi_transfer_one; controller->transfer_one = pxa2xx_spi_transfer_one;
controller->slave_abort = pxa2xx_spi_slave_abort; controller->target_abort = pxa2xx_spi_target_abort;
controller->handle_err = pxa2xx_spi_handle_err; controller->handle_err = pxa2xx_spi_handle_err;
controller->unprepare_transfer_hardware = pxa2xx_spi_unprepare_transfer; controller->unprepare_transfer_hardware = pxa2xx_spi_unprepare_transfer;
controller->fw_translate_cs = pxa2xx_spi_fw_translate_cs; controller->fw_translate_cs = pxa2xx_spi_fw_translate_cs;
...@@ -1579,7 +1579,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev) ...@@ -1579,7 +1579,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
break; break;
default: default:
if (spi_controller_is_slave(controller)) { if (spi_controller_is_target(controller)) {
tmp = SSCR1_SCFR | tmp = SSCR1_SCFR |
SSCR1_SCLKDIR | SSCR1_SCLKDIR |
SSCR1_SFRMDIR | SSCR1_SFRMDIR |
...@@ -1592,7 +1592,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev) ...@@ -1592,7 +1592,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
} }
pxa2xx_spi_write(drv_data, SSCR1, tmp); pxa2xx_spi_write(drv_data, SSCR1, tmp);
tmp = SSCR0_Motorola | SSCR0_DataSize(8); tmp = SSCR0_Motorola | SSCR0_DataSize(8);
if (!spi_controller_is_slave(controller)) if (!spi_controller_is_target(controller))
tmp |= SSCR0_SCR(2); tmp |= SSCR0_SCR(2);
pxa2xx_spi_write(drv_data, SSCR0, tmp); pxa2xx_spi_write(drv_data, SSCR0, tmp);
break; break;
...@@ -1620,7 +1620,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev) ...@@ -1620,7 +1620,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
controller->num_chipselect = platform_info->num_chipselect; controller->num_chipselect = platform_info->num_chipselect;
controller->use_gpio_descriptors = true; controller->use_gpio_descriptors = true;
if (platform_info->is_slave) { if (platform_info->is_target) {
drv_data->gpiod_ready = devm_gpiod_get_optional(dev, drv_data->gpiod_ready = devm_gpiod_get_optional(dev,
"ready", GPIOD_OUT_LOW); "ready", GPIOD_OUT_LOW);
if (IS_ERR(drv_data->gpiod_ready)) { if (IS_ERR(drv_data->gpiod_ready)) {
......
...@@ -19,7 +19,7 @@ struct pxa2xx_spi_controller { ...@@ -19,7 +19,7 @@ struct pxa2xx_spi_controller {
u16 num_chipselect; u16 num_chipselect;
u8 enable_dma; u8 enable_dma;
u8 dma_burst_size; u8 dma_burst_size;
bool is_slave; bool is_target;
/* DMA engine specific config */ /* DMA engine specific config */
bool (*dma_filter)(struct dma_chan *chan, void *param); bool (*dma_filter)(struct dma_chan *chan, void *param);
...@@ -31,7 +31,7 @@ struct pxa2xx_spi_controller { ...@@ -31,7 +31,7 @@ struct pxa2xx_spi_controller {
}; };
/* /*
* The controller specific data for SPI slave devices * The controller specific data for SPI target devices
* (resides in spi_board_info.controller_data), * (resides in spi_board_info.controller_data),
* copied to spi_device.platform_data ... mostly for * copied to spi_device.platform_data ... mostly for
* DMA tuning. * DMA tuning.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment