Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1485405ybz; Thu, 16 Apr 2020 10:00:10 -0700 (PDT) X-Google-Smtp-Source: APiQypIoVNIFYY2zKu29J0GtlDY1rZjzh3nmzzLIjP561527zCu8OLuUsBNeIEH1ZdJmy/SCFArX X-Received: by 2002:aa7:d894:: with SMTP id u20mr17520028edq.205.1587056410263; Thu, 16 Apr 2020 10:00:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587056410; cv=none; d=google.com; s=arc-20160816; b=F86B9oSXkfF/sGd82MWvPLRBQHa31y6InUesyZJhP8IjT1/g3PrK9QmWwY8nvccp2c o6o3bzuycljHl6LJeR7pxBSh0x50ylYeDPvWRioOccYfoD3GLDGQA2DieI90NaQqyQxN pqMDu+iDcmfiqHxvYZ46c0H5C35PLMRlZLUX4bSxT46kbTXM4iuVYgLHsuWSc6etc3nJ G9lhloIB92SMqJFnOIzWjZ7Q4BwlxBQG+UuG+LqI9Dd9q5MgGYb3d2eb+ULKwmZiVT/X VTeQsZhT0Rj210lDICWjoX7Ncc2ufAKmnnRXk7iKSS/XhR1CmDuKVqXqCWomYVTYc8mK 0kfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=BTeyNExfyxQjnOaSPJGAKwarwW1+gJT+EEBl7fj1eRk=; b=cvZDSMAeGwD1wonCNC6MHTQBIn5YmM+cuIvZ5lK1iD6Qqa7qNnLhCD5Z0rNsRLtuWs C1D/0dai/jIBI0STv0rk4tulukJFMcjvAezJFZxBMoFly4zs8WiAWHdhLLP9LxIjLFEW xrQzRaqSeAvAh4ktm6cDwV0O9iwDfSLkeekpWK84JajYLV6pMsgepdqXTGvOeUUjAt64 Uxxt5+3K5RAWRaV9J8j6dPVv64kJmfk+WPYzZ+gPXvXbFwCianKgvqCsKPmk+rt4qRfa 3C1LfbKdp+x+66PJ3YjdPoLo0GCfpNjHGM9qje203vFD1AfwI7MQVO2Zz1XcfGqajWxa Z1ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kalray.eu header.s=32AE1B44-9502-11E5-BA35-3734643DEF29 header.b=Aqfdl3Bo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=kalray.eu Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s11si12630653ejq.364.2020.04.16.09.59.46; Thu, 16 Apr 2020 10:00:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kalray.eu header.s=32AE1B44-9502-11E5-BA35-3734643DEF29 header.b=Aqfdl3Bo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=kalray.eu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2506276AbgDPLbI (ORCPT + 99 others); Thu, 16 Apr 2020 07:31:08 -0400 Received: from zimbra2.kalray.eu ([92.103.151.219]:45020 "EHLO zimbra2.kalray.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2505842AbgDPLJa (ORCPT ); Thu, 16 Apr 2020 07:09:30 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra2.kalray.eu (Postfix) with ESMTP id E483227E0BEB; Thu, 16 Apr 2020 13:09:27 +0200 (CEST) Received: from zimbra2.kalray.eu ([127.0.0.1]) by localhost (zimbra2.kalray.eu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id Kl8XApNDOTIE; Thu, 16 Apr 2020 13:09:27 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zimbra2.kalray.eu (Postfix) with ESMTP id 8437127E0B48; Thu, 16 Apr 2020 13:09:27 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.10.3 zimbra2.kalray.eu 8437127E0B48 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kalray.eu; s=32AE1B44-9502-11E5-BA35-3734643DEF29; t=1587035367; bh=BTeyNExfyxQjnOaSPJGAKwarwW1+gJT+EEBl7fj1eRk=; h=From:To:Date:Message-Id; b=Aqfdl3Bof+6vnT8DAxK7JRGpaIYA7auThwnIeG0tN+r09Xs4mk8wQZVhbwb0dMcOf Zg0DGIG7nE6LR+LEp46uiwdIzZCoji/+yZ7dtyOC+l6Fxg3v8w79TrNdFWnse5AGp9 lNouqjIaCfFt/fvsgCnhylfkPHJ3TIpPmd30NTOg= X-Virus-Scanned: amavisd-new at zimbra2.kalray.eu Received: from zimbra2.kalray.eu ([127.0.0.1]) by localhost (zimbra2.kalray.eu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id qYJlB-6xkymO; Thu, 16 Apr 2020 13:09:27 +0200 (CEST) Received: from triton.lin.mbt.kalray.eu (unknown [192.168.37.25]) by zimbra2.kalray.eu (Postfix) with ESMTPSA id 7166827E02FA; Thu, 16 Apr 2020 13:09:27 +0200 (CEST) From: Clement Leger To: Mark Brown Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, Clement Leger Subject: [PATCH 2/2] spi: dw: remove cs_control and poll_mode members from chip_data Date: Thu, 16 Apr 2020 13:09:16 +0200 Message-Id: <20200416110916.22633-2-cleger@kalray.eu> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200416110916.22633-1-cleger@kalray.eu> References: <20200416110823.22565-1-cleger@kalray.eu> <20200416110916.22633-1-cleger@kalray.eu> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since these members were initialized only with previous dw_spi_chip struct members and that there is no user anymore, remove them. Along this removal, remove code path which were using these members. Signed-off-by: Clement Leger --- drivers/spi/spi-dw.c | 41 +---------------------------------------- 1 file changed, 1 insertion(+), 40 deletions(-) diff --git a/drivers/spi/spi-dw.c b/drivers/spi/spi-dw.c index fda8d433a769..2b79c5a983c0 100644 --- a/drivers/spi/spi-dw.c +++ b/drivers/spi/spi-dw.c @@ -24,11 +24,8 @@ struct chip_data { u8 tmode; /* TR/TO/RO/EEPROM */ u8 type; /* SPI/SSP/MicroWire */ - u8 poll_mode; /* 1 means use poll mode */ - u16 clk_div; /* baud rate divider */ u32 speed_hz; /* baud rate */ - void (*cs_control)(u32 command); }; #ifdef CONFIG_DEBUG_FS @@ -127,11 +124,6 @@ static inline void dw_spi_debugfs_remove(struct dw_spi *dws) void dw_spi_set_cs(struct spi_device *spi, bool enable) { struct dw_spi *dws = spi_controller_get_devdata(spi->controller); - struct chip_data *chip = spi_get_ctldata(spi); - - /* Chip select logic is inverted from spi_set_cs() */ - if (chip && chip->cs_control) - chip->cs_control(!enable); if (!enable) dw_writel(dws, DW_SPI_SER, BIT(spi->chip_select)); @@ -265,18 +257,6 @@ static irqreturn_t dw_spi_irq(int irq, void *dev_id) return dws->transfer_handler(dws); } -/* Must be called inside pump_transfers() */ -static int poll_transfer(struct dw_spi *dws) -{ - do { - dw_writer(dws); - dw_reader(dws); - cpu_relax(); - } while (dws->rx_end > dws->rx); - - return 0; -} - static int dw_spi_transfer_one(struct spi_controller *master, struct spi_device *spi, struct spi_transfer *transfer) { @@ -324,22 +304,6 @@ static int dw_spi_transfer_one(struct spi_controller *master, (((spi->mode & SPI_LOOP) ? 1 : 0) << SPI_SRL_OFFSET)) | (chip->tmode << SPI_TMOD_OFFSET); - /* - * Adjust transfer mode if necessary. Requires platform dependent - * chipselect mechanism. - */ - if (chip->cs_control) { - if (dws->rx && dws->tx) - chip->tmode = SPI_TMOD_TR; - else if (dws->rx) - chip->tmode = SPI_TMOD_RO; - else - chip->tmode = SPI_TMOD_TO; - - cr0 &= ~SPI_TMOD_MASK; - cr0 |= (chip->tmode << SPI_TMOD_OFFSET); - } - dw_writel(dws, DW_SPI_CTRL0, cr0); /* Check if current transfer is a DMA transaction */ @@ -359,7 +323,7 @@ static int dw_spi_transfer_one(struct spi_controller *master, spi_enable_chip(dws, 1); return ret; } - } else if (!chip->poll_mode) { + } else { txlevel = min_t(u16, dws->fifo_len / 2, dws->len / dws->n_bytes); dw_writel(dws, DW_SPI_TXFLTR, txlevel); @@ -379,9 +343,6 @@ static int dw_spi_transfer_one(struct spi_controller *master, return ret; } - if (chip->poll_mode) - return poll_transfer(dws); - return 1; } -- 2.17.1