All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yang Yingliang <yangyingliang@huawei.com>
To: <linux-spi@vger.kernel.org>
Cc: <broonie@kernel.org>, <geert@linux-m68k.org>, <lukas@wunner.de>,
	<yangyingliang@huawei.com>
Subject: [PATCH -next v3 07/23] spi: pxa2xx: switch to use modern name
Date: Fri, 18 Aug 2023 17:31:38 +0800	[thread overview]
Message-ID: <20230818093154.1183529-8-yangyingliang@huawei.com> (raw)
In-Reply-To: <20230818093154.1183529-1-yangyingliang@huawei.com>

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

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/spi/spi-pxa2xx.c       | 24 ++++++++++++------------
 include/linux/spi/pxa2xx_spi.h |  4 ++--
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c
index 21f156587669..f2a856f6a99e 100644
--- a/drivers/spi/spi-pxa2xx.c
+++ b/drivers/spi/spi-pxa2xx.c
@@ -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))
 			;
 		if (drv_data->gpiod_ready) {
@@ -1121,7 +1121,7 @@ static int pxa2xx_spi_transfer_one(struct spi_controller *controller,
 	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);
 
@@ -1199,7 +1199,7 @@ static int setup(struct spi_device *spi)
 		break;
 	default:
 		tx_hi_thres = 0;
-		if (spi_controller_is_slave(drv_data->controller)) {
+		if (spi_controller_is_target(drv_data->controller)) {
 			tx_thres = 1;
 			rx_thres = 2;
 		} else {
@@ -1248,7 +1248,7 @@ static int setup(struct spi_device *spi)
 	}
 
 	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_SCLKDIR;
 		chip->cr1 |= SSCR1_SFRMDIR;
@@ -1395,7 +1395,7 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev)
 	else
 		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->enable_dma = true;
 	pdata->dma_burst_size = 1;
@@ -1461,10 +1461,10 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
 		return -ENODEV;
 	}
 
-	if (platform_info->is_slave)
-		controller = devm_spi_alloc_slave(dev, sizeof(*drv_data));
+	if (platform_info->is_target)
+		controller = devm_spi_alloc_target(dev, sizeof(*drv_data));
 	else
-		controller = devm_spi_alloc_master(dev, sizeof(*drv_data));
+		controller = devm_spi_alloc_host(dev, sizeof(*drv_data));
 
 	if (!controller) {
 		dev_err(&pdev->dev, "cannot alloc spi_controller\n");
@@ -1487,7 +1487,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
 	controller->setup = setup;
 	controller->set_cs = pxa2xx_spi_set_cs;
 	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->unprepare_transfer_hardware = pxa2xx_spi_unprepare_transfer;
 	controller->fw_translate_cs = pxa2xx_spi_fw_translate_cs;
@@ -1579,7 +1579,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
 		break;
 	default:
 
-		if (spi_controller_is_slave(controller)) {
+		if (spi_controller_is_target(controller)) {
 			tmp = SSCR1_SCFR |
 			      SSCR1_SCLKDIR |
 			      SSCR1_SFRMDIR |
@@ -1592,7 +1592,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
 		}
 		pxa2xx_spi_write(drv_data, SSCR1, tmp);
 		tmp = SSCR0_Motorola | SSCR0_DataSize(8);
-		if (!spi_controller_is_slave(controller))
+		if (!spi_controller_is_target(controller))
 			tmp |= SSCR0_SCR(2);
 		pxa2xx_spi_write(drv_data, SSCR0, tmp);
 		break;
@@ -1620,7 +1620,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
 	controller->num_chipselect = platform_info->num_chipselect;
 	controller->use_gpio_descriptors = true;
 
-	if (platform_info->is_slave) {
+	if (platform_info->is_target) {
 		drv_data->gpiod_ready = devm_gpiod_get_optional(dev,
 						"ready", GPIOD_OUT_LOW);
 		if (IS_ERR(drv_data->gpiod_ready)) {
diff --git a/include/linux/spi/pxa2xx_spi.h b/include/linux/spi/pxa2xx_spi.h
index 4658e7801b42..0916cb9bcb0a 100644
--- a/include/linux/spi/pxa2xx_spi.h
+++ b/include/linux/spi/pxa2xx_spi.h
@@ -19,7 +19,7 @@ struct pxa2xx_spi_controller {
 	u16 num_chipselect;
 	u8 enable_dma;
 	u8 dma_burst_size;
-	bool is_slave;
+	bool is_target;
 
 	/* DMA engine specific config */
 	bool (*dma_filter)(struct dma_chan *chan, void *param);
@@ -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),
  * copied to spi_device.platform_data ... mostly for
  * DMA tuning.
-- 
2.25.1


  parent reply	other threads:[~2023-08-18  9:36 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-18  9:31 [PATCH -next v3 00/23] spi: switch to use modern name (part4) Yang Yingliang
2023-08-18  9:31 ` [PATCH -next v3 01/23] spi: orion: switch to use modern name Yang Yingliang
2023-08-18  9:31 ` [PATCH -next v3 02/23] spi: mchp-pci1xxxx: " Yang Yingliang
2023-08-18  9:31 ` [PATCH -next v3 03/23] spi: pic32-sqi: " Yang Yingliang
2023-08-18  9:31 ` [PATCH -next v3 04/23] spi: pic32: " Yang Yingliang
2023-08-18  9:31 ` [PATCH -next v3 05/23] spi: spl022: " Yang Yingliang
2023-08-18  9:31 ` [PATCH -next v3 06/23] spi: ppc4xx: " Yang Yingliang
2023-08-18  9:31 ` Yang Yingliang [this message]
2023-08-18  9:31 ` [PATCH -next v3 08/23] spi: spi-qcom-qspi: " Yang Yingliang
2023-08-18  9:31 ` [PATCH -next v3 09/23] spi: qup: " Yang Yingliang
2023-08-18  9:31 ` [PATCH -next v3 10/23] spi: rb4xx: " Yang Yingliang
2023-08-18  9:31 ` [PATCH -next v3 11/23] spi: realtek-rtl: switch to use devm_spi_alloc_host() Yang Yingliang
2023-08-18  9:31 ` [PATCH -next v3 12/23] spi: rockchip-sfc: switch to use modern name Yang Yingliang
2023-08-18  9:31 ` [PATCH -next v3 13/23] spi: rockchip: " Yang Yingliang
2023-08-19 13:16   ` Heiko Stübner
2023-08-18  9:31 ` [PATCH -next v3 14/23] spi: rspi: switch to use spi_alloc_host() Yang Yingliang
2023-08-18  9:31 ` [PATCH -next v3 15/23] spi: rzv2m-csi: switch to use devm_spi_alloc_host() Yang Yingliang
2023-08-18  9:31 ` [PATCH -next v3 16/23] spi: s3c64xx: switch to use modern name Yang Yingliang
2023-08-18  9:31 ` [PATCH -next v3 17/23] spi: sc18is602: " Yang Yingliang
2023-08-18  9:31 ` [PATCH -next v3 18/23] spi: sh-hspi: " Yang Yingliang
2023-08-18  9:31 ` [PATCH -next v3 19/23] spi: sh-msiof: " Yang Yingliang
2023-08-18 14:59   ` Geert Uytterhoeven
2023-08-18  9:31 ` [PATCH -next v3 20/23] spi: sh-sci: " Yang Yingliang
2023-08-18  9:31 ` [PATCH -next v3 21/23] spi: sh: " Yang Yingliang
2023-08-18  9:31 ` [PATCH -next v3 22/23] spi: sifive: " Yang Yingliang
2023-08-18  9:31 ` [PATCH -next v3 23/23] spi: spi-sn-f-ospi: " Yang Yingliang
2023-08-22 16:33 ` [PATCH -next v3 00/23] spi: switch to use modern name (part4) Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230818093154.1183529-8-yangyingliang@huawei.com \
    --to=yangyingliang@huawei.com \
    --cc=broonie@kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=lukas@wunner.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.