From patchwork Mon Feb 12 12:09:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 10212307 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9A3956055C for ; Mon, 12 Feb 2018 12:09:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8084E28AA8 for ; Mon, 12 Feb 2018 12:09:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7488F28BEF; Mon, 12 Feb 2018 12:09:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A49FB28AA8 for ; Mon, 12 Feb 2018 12:09:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933160AbeBLMJh (ORCPT ); Mon, 12 Feb 2018 07:09:37 -0500 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:34652 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933136AbeBLMJg (ORCPT ); Mon, 12 Feb 2018 07:09:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=EKvs5Q4xB9nlgq6zQ0GTwDMfP2dIKcUDQAkQcsHRvKo=; b=gF8zQtpQxxym w/syfDyxaiXZTy0OY/CuQm29Joqz8nomKNnX5WuO/Zl86nDPDI9Js3KSJnvri6NWxuq7Kn7MUiGxD W86fRBguSP3AYezh0yesdaLZ2EE4cjcsjCr67arEqPozu43BTld1VN4RMulxCgeSNxoqn6xXCi0Mo jy+lU=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1elCvL-0001vf-6X; Mon, 12 Feb 2018 12:09:31 +0000 Received: from broonie by debutante with local (Exim 4.90) (envelope-from ) id 1elCvK-0007ZM-OI; Mon, 12 Feb 2018 12:09:30 +0000 From: Mark Brown To: Jarkko Nikula Cc: Mark Brown , linux-spi@vger.kernel.org, Mark Brown , Daniel Mack , Haojian Zhuang , Robert Jarzmik , linux-spi@vger.kernel.org Subject: Applied "spi: pxa2xx: Convert to generalized SPI controller API" to the spi tree In-Reply-To: <20180201151730.27190-2-jarkko.nikula@linux.intel.com> Message-Id: Date: Mon, 12 Feb 2018 12:09:30 +0000 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The patch spi: pxa2xx: Convert to generalized SPI controller API has been applied to the spi tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark From 3cc7b0e35745ae4e153f174038df34a79a385b32 Mon Sep 17 00:00:00 2001 From: Jarkko Nikula Date: Thu, 1 Feb 2018 17:17:30 +0200 Subject: [PATCH] spi: pxa2xx: Convert to generalized SPI controller API Convert to generalized SPI controller API introduced by the commit 8caab75fd2c2 ("spi: Generalize SPI "master" to "controller""). Inside driver variable name "master" is still used to indicate the driver is master only. While at it, change "unsigned cs" to "unsigned int cs" in pxa2xx_spi_fw_translate_cs() to suppress checkpatch warning. Signed-off-by: Jarkko Nikula Signed-off-by: Mark Brown --- drivers/spi/spi-pxa2xx-dma.c | 4 ++-- drivers/spi/spi-pxa2xx.c | 40 ++++++++++++++++++++++------------------ drivers/spi/spi-pxa2xx.h | 2 +- 3 files changed, 25 insertions(+), 21 deletions(-) diff --git a/drivers/spi/spi-pxa2xx-dma.c b/drivers/spi/spi-pxa2xx-dma.c index 04f3eecf5cf3..3d7f66080c57 100644 --- a/drivers/spi/spi-pxa2xx-dma.c +++ b/drivers/spi/spi-pxa2xx-dma.c @@ -191,7 +191,7 @@ int pxa2xx_spi_dma_setup(struct driver_data *drv_data) { struct pxa2xx_spi_master *pdata = drv_data->master_info; struct device *dev = &drv_data->pdev->dev; - struct spi_master *master = drv_data->master; + struct spi_controller *master = drv_data->master; dma_cap_mask_t mask; dma_cap_zero(mask); @@ -215,7 +215,7 @@ int pxa2xx_spi_dma_setup(struct driver_data *drv_data) void pxa2xx_spi_dma_release(struct driver_data *drv_data) { - struct spi_master *master = drv_data->master; + struct spi_controller *master = drv_data->master; if (master->dma_rx) { dmaengine_terminate_sync(master->dma_rx); diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index 31117f9985ea..713506eff07d 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -962,7 +962,7 @@ static unsigned int pxa2xx_ssp_get_clk_div(struct driver_data *drv_data, return clk_div << 8; } -static bool pxa2xx_spi_can_dma(struct spi_master *master, +static bool pxa2xx_spi_can_dma(struct spi_controller *master, struct spi_device *spi, struct spi_transfer *xfer) { @@ -976,7 +976,7 @@ static bool pxa2xx_spi_can_dma(struct spi_master *master, static void pump_transfers(unsigned long data) { struct driver_data *drv_data = (struct driver_data *)data; - struct spi_master *master = drv_data->master; + struct spi_controller *master = drv_data->master; struct spi_message *message = master->cur_msg; struct chip_data *chip = spi_get_ctldata(message->spi); u32 dma_thresh = chip->dma_threshold; @@ -1182,10 +1182,10 @@ static void pump_transfers(unsigned long data) pxa2xx_spi_write(drv_data, SSCR1, cr1); } -static int pxa2xx_spi_transfer_one_message(struct spi_master *master, +static int pxa2xx_spi_transfer_one_message(struct spi_controller *master, struct spi_message *msg) { - struct driver_data *drv_data = spi_master_get_devdata(master); + struct driver_data *drv_data = spi_controller_get_devdata(master); /* Initial message state*/ msg->state = START_STATE; @@ -1198,9 +1198,9 @@ static int pxa2xx_spi_transfer_one_message(struct spi_master *master, return 0; } -static int pxa2xx_spi_unprepare_transfer(struct spi_master *master) +static int pxa2xx_spi_unprepare_transfer(struct spi_controller *master) { - struct driver_data *drv_data = spi_master_get_devdata(master); + struct driver_data *drv_data = spi_controller_get_devdata(master); /* Disable the SSP now */ pxa2xx_spi_write(drv_data, SSCR0, @@ -1212,7 +1212,8 @@ static int pxa2xx_spi_unprepare_transfer(struct spi_master *master) static int setup_cs(struct spi_device *spi, struct chip_data *chip, struct pxa2xx_spi_chip *chip_info) { - struct driver_data *drv_data = spi_master_get_devdata(spi->master); + struct driver_data *drv_data = + spi_controller_get_devdata(spi->controller); struct gpio_desc *gpiod; int err = 0; @@ -1270,7 +1271,8 @@ static int setup(struct spi_device *spi) struct pxa2xx_spi_chip *chip_info; struct chip_data *chip; const struct lpss_config *config; - struct driver_data *drv_data = spi_master_get_devdata(spi->master); + struct driver_data *drv_data = + spi_controller_get_devdata(spi->controller); uint tx_thres, tx_hi_thres, rx_thres; switch (drv_data->ssp_type) { @@ -1410,7 +1412,8 @@ static int setup(struct spi_device *spi) static void cleanup(struct spi_device *spi) { struct chip_data *chip = spi_get_ctldata(spi); - struct driver_data *drv_data = spi_master_get_devdata(spi->master); + struct driver_data *drv_data = + spi_controller_get_devdata(spi->controller); if (!chip) return; @@ -1575,9 +1578,10 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev) } #endif -static int pxa2xx_spi_fw_translate_cs(struct spi_master *master, unsigned cs) +static int pxa2xx_spi_fw_translate_cs(struct spi_controller *master, + unsigned int cs) { - struct driver_data *drv_data = spi_master_get_devdata(master); + struct driver_data *drv_data = spi_controller_get_devdata(master); if (has_acpi_companion(&drv_data->pdev->dev)) { switch (drv_data->ssp_type) { @@ -1602,7 +1606,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct pxa2xx_spi_master *platform_info; - struct spi_master *master; + struct spi_controller *master; struct driver_data *drv_data; struct ssp_device *ssp; const struct lpss_config *config; @@ -1633,7 +1637,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev) pxa_ssp_free(ssp); return -ENOMEM; } - drv_data = spi_master_get_devdata(master); + drv_data = spi_controller_get_devdata(master); drv_data->master = master; drv_data->master_info = platform_info; drv_data->pdev = pdev; @@ -1651,7 +1655,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev) master->unprepare_transfer_hardware = pxa2xx_spi_unprepare_transfer; master->fw_translate_cs = pxa2xx_spi_fw_translate_cs; master->auto_runtime_pm = true; - master->flags = SPI_MASTER_MUST_RX | SPI_MASTER_MUST_TX; + master->flags = SPI_CONTROLLER_MUST_RX | SPI_CONTROLLER_MUST_TX; drv_data->ssp_type = ssp->type; @@ -1793,7 +1797,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev) /* Register with the SPI framework */ platform_set_drvdata(pdev, drv_data); - status = devm_spi_register_master(&pdev->dev, master); + status = devm_spi_register_controller(&pdev->dev, master); if (status != 0) { dev_err(&pdev->dev, "problem registering spi master\n"); goto out_error_clock_enabled; @@ -1807,7 +1811,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev) free_irq(ssp->irq, drv_data); out_error_master_alloc: - spi_master_put(master); + spi_controller_put(master); pxa_ssp_free(ssp); return status; } @@ -1858,7 +1862,7 @@ static int pxa2xx_spi_suspend(struct device *dev) struct ssp_device *ssp = drv_data->ssp; int status; - status = spi_master_suspend(drv_data->master); + status = spi_controller_suspend(drv_data->master); if (status != 0) return status; pxa2xx_spi_write(drv_data, SSCR0, 0); @@ -1884,7 +1888,7 @@ static int pxa2xx_spi_resume(struct device *dev) lpss_ssp_setup(drv_data); /* Start the queue running */ - status = spi_master_resume(drv_data->master); + status = spi_controller_resume(drv_data->master); if (status != 0) { dev_err(dev, "problem starting queue (%d)\n", status); return status; diff --git a/drivers/spi/spi-pxa2xx.h b/drivers/spi/spi-pxa2xx.h index 94f7b0713281..513ec6c6e25b 100644 --- a/drivers/spi/spi-pxa2xx.h +++ b/drivers/spi/spi-pxa2xx.h @@ -31,7 +31,7 @@ struct driver_data { /* SPI framework hookup */ enum pxa_ssp_type ssp_type; - struct spi_master *master; + struct spi_controller *master; /* PXA hookup */ struct pxa2xx_spi_master *master_info;