Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp1389007ima; Fri, 1 Feb 2019 23:14:57 -0800 (PST) X-Google-Smtp-Source: ALg8bN4WCAAnpQg95D9JwGWVPB7NBIE3vv5RKGgAjcOeQOlBJxs2wH7Fdwq6Wf08gARzk88ztgmQ X-Received: by 2002:a17:902:9f93:: with SMTP id g19mr42271908plq.195.1549091697773; Fri, 01 Feb 2019 23:14:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549091697; cv=none; d=google.com; s=arc-20160816; b=eeDAXSgoJXXCcQe3hYRh17ucQQLfGvDQthOcWFcT+AuAZS6I7DwM9oW37WcaYVhKa1 pLF6ouseKa/WIiVuHxujVeKI0eH4ghpsynjX3XkPoR/kDzK3iJvCqbfmD5x9zww8g8sX YB/wt+apf14oi4TER1TxuhkPEUbxcmpInfXw0+/vzvSdIJz5a9rrnjgBTG+J4kVbZnYV j0v4oauPqJaFm3KMmMAT1q+M6ku0PGdvshlvqSTQz/l80TBWvodAGEPbW167nkXE35Tb uryIfarf53xrj8wI7Cff6GTB24nE5vlM223k+z8ycXFQwANsBUNvMxgaxPxPt53xeLJ6 K62Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=6CS0oRx3QCP2e1GY+IuEwVD42kbB05snNiVj6AYlB1s=; b=SEg6Nui0/nWDNJ+YPJGUbQMtTBCG5l8w24WU3swUbRWDdhZpkXgWicJS8BUw6Y7NC1 3ifRmrV9RLbfMoQVBW0CNuTxm7pd0o0/d69FDkZ9ljuScpujW5sQ2iGMfdVtV08kk3or kWk3Cw4x1J+A9uqvptV6ryrkbPJHOoNw/SLuyP8rZOZfNZb0Bk/1x47pOmkd2aWuYtYe SJkZlM0e/wReZJQeMbgjSnY0cCuOsMX6OkrZ2LzXBZcpM5ycND9g0dnw2wXERQrhA7MR XiVYkmsw6+oNrkwNtJv3KiEYlXwzBdsWUi8smu0YWNENoToKsmlJPu8nYR24uvIVL9us 3WFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MuzRsxeE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g26si9117196pfi.184.2019.02.01.23.14.42; Fri, 01 Feb 2019 23:14:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MuzRsxeE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727743AbfBBHNw (ORCPT + 99 others); Sat, 2 Feb 2019 02:13:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:34126 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726659AbfBBHNw (ORCPT ); Sat, 2 Feb 2019 02:13:52 -0500 Received: from bbrezillon (91-160-177-164.subs.proxad.net [91.160.177.164]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C22D720863; Sat, 2 Feb 2019 07:13:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549091631; bh=d5lF9CVaOgTQMmq5P4+NuVQmBMfctFDudkgRa1bohRU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=MuzRsxeEyBOGiRnh+++cbohi26d/RarfvYnYCqk4gFP89Kqf6AKOkJmFzmblDTV+r ANlFAO3m4Px0pf83OdIc9GQcza/mIM3Z1/pPS5urxSq6OhZS5hH1wy3R017qe5JpPb DeYLn5ueptsdb8d0bygXYWUY2vNcgO74Ro6FJZ/Y= Date: Sat, 2 Feb 2019 08:13:38 +0100 From: Boris Brezillon To: Cc: , , , , , , , , , , , , Subject: Re: [PATCH v3 08/13] spi: atmel-quadspi: drop unused and NOP transfer macros Message-ID: <20190202081338.01056dce@bbrezillon> In-Reply-To: <20190202040653.1217-9-tudor.ambarus@microchip.com> References: <20190202040653.1217-1-tudor.ambarus@microchip.com> <20190202040653.1217-9-tudor.ambarus@microchip.com> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 2 Feb 2019 04:07:33 +0000 wrote: > From: Tudor Ambarus > > Remove NOP when setting read transfer type. Remove useless > setting of write transfer type when > op->data.dir == SPI_MEM_DATA_IN && !op->data.nbytes. > > QSPI_IFR_TFRTYP_TRSFR_WRITE is specific just to sama5d2 qspi, > rename it to QSPI_IFR_SAMA5D2_WRITE_TRSFR. > > Signed-off-by: Tudor Ambarus > --- > v3: new patch > > drivers/spi/atmel-quadspi.c | 12 +++--------- > 1 file changed, 3 insertions(+), 9 deletions(-) > > diff --git a/drivers/spi/atmel-quadspi.c b/drivers/spi/atmel-quadspi.c > index d26d4cd0e36b..bfa5f5e92d96 100644 > --- a/drivers/spi/atmel-quadspi.c > +++ b/drivers/spi/atmel-quadspi.c > @@ -113,11 +113,7 @@ > #define QSPI_IFR_OPTL_4BIT (2 << 8) > #define QSPI_IFR_OPTL_8BIT (3 << 8) > #define QSPI_IFR_ADDRL BIT(10) > -#define QSPI_IFR_TFRTYP_MASK GENMASK(13, 12) > -#define QSPI_IFR_TFRTYP_TRSFR_READ (0 << 12) > -#define QSPI_IFR_TFRTYP_TRSFR_READ_MEM (1 << 12) > -#define QSPI_IFR_TFRTYP_TRSFR_WRITE (2 << 12) > -#define QSPI_IFR_TFRTYP_TRSFR_WRITE_MEM (3 << 13) > +#define QSPI_IFR_SAMA5D2_WRITE_TRSFR BIT(13) Can you define QSPI_IFR_TFRTYP_MEM (bit 12) even if it's not used yet? > #define QSPI_IFR_CRM BIT(14) > #define QSPI_IFR_NBDUM_MASK GENMASK(20, 16) > #define QSPI_IFR_NBDUM(n) (((n) << 16) & QSPI_IFR_NBDUM_MASK) > @@ -273,10 +269,8 @@ static int atmel_qspi_exec_op(struct spi_mem *mem, const struct spi_mem_op *op) > if (op->data.nbytes) > ifr |= QSPI_IFR_DATAEN; > > - if (op->data.dir == SPI_MEM_DATA_IN && op->data.nbytes) > - ifr |= QSPI_IFR_TFRTYP_TRSFR_READ; > - else > - ifr |= QSPI_IFR_TFRTYP_TRSFR_WRITE; > + if (op->data.dir == SPI_MEM_DATA_OUT) > + ifr |= QSPI_IFR_SAMA5D2_WRITE_TRSFR; > > /* Clear pending interrupts */ > (void)readl_relaxed(base + QSPI_SR);