Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp3898535ybh; Tue, 6 Aug 2019 03:12:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqwGENNUb3Y8lRY4iUZMUK/SDON7EB+/T4+PgQd3afY6nKkhej/qqIZvPqCeO46mRK6/zOic X-Received: by 2002:a63:2157:: with SMTP id s23mr2412938pgm.167.1565086371855; Tue, 06 Aug 2019 03:12:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565086371; cv=none; d=google.com; s=arc-20160816; b=DNQtypYNCutI152EE2I6aL6F9fW/LgP4X6E00s1JC3cq2zxNW83vvD9IRDYLqFOqZ1 X7W59noPuCRycS+YG4qBGfTCZuYgFJQALwNS5sUwrc5gNf1XFINXrL+0SIN3sKeO12a4 AC7lIUo9VHCJQ235CLiq30A8aarQ1XDoVpEc/drP723OVVErCPDwUMfhPHI1C/r4rkkv lL3GUf6MrRV8UExbIjsmCQlBmxZP7JC3llS55MFBNKskA1J+ZIPe0AJmJ96OW3cSjHOR Ovzka35+LGl1xhodcqBVB/ex+MMT+sUwXkIfTxjNF6uViqPHt1g8zUxzc4e+5w11O1fB Wnsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=lUpr9FUhH57QcCVU+vO9HZiupwMzhMDSaNOkei0kz5o=; b=fCafc/hq2N2FIpb9GhubIXOM8pKPSCx11JrZIl2eFZdO7qJ84jgcFFf2K+JMM34GEa iGJRROM6Z854D6m++iUpR8tAAVumqD1jCRJTmf14l+1opwRlgvytDaG9j9ashfgtFyv7 p9a8juw2T3mFUi/5NL6YBCn4eW6HJtAN8aJzUrT5VYgFvoaWhNznhCJQlOcwYl/5Tl1q NoE411ODI5A9ycEYSCQSe0mE8W3DViVIkqvrp0jw5NqD7PUy1hcLl7pwcN8hlZvRNHwc d01fzCbtl4qd4SpDv2rj7m77hofUYtlbJFbbW+GLe1vU7ClyAPrlliHYdbVoQWaFxask qxKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=KQzE8lzJ; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m5si40785189plt.167.2019.08.06.03.12.34; Tue, 06 Aug 2019 03:12:51 -0700 (PDT) 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=@broadcom.com header.s=google header.b=KQzE8lzJ; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732494AbfHFKLv (ORCPT + 99 others); Tue, 6 Aug 2019 06:11:51 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:46569 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726713AbfHFKLv (ORCPT ); Tue, 6 Aug 2019 06:11:51 -0400 Received: by mail-pf1-f194.google.com with SMTP id c3so18111613pfa.13 for ; Tue, 06 Aug 2019 03:11:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id; bh=lUpr9FUhH57QcCVU+vO9HZiupwMzhMDSaNOkei0kz5o=; b=KQzE8lzJdxbMLa7xWIi9QlXR8wrWagY9a9wVsb+QGRhBWY5aqhsfHHE2AyrjJIcVD/ 7LYxPKcutsYSEKgNxm7cHvsqHgv4eTeS4Y7FuW3hmQqrDvKCQhJfyRqr4VisGAV4v9J5 Yi6MXdOHOENOtg14J9z1y0qkaHfa34vKckpUQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=lUpr9FUhH57QcCVU+vO9HZiupwMzhMDSaNOkei0kz5o=; b=Ip7Nibc5b3VBFsXu+j0XQWlxgnWKx1KIoVJDFzQP4YFE2OIM9QUvsSIxc9xi3U5yBN Epc5Jz2SIdvYXaYvCncnz95wgyjALkdQSQ710sPZAX/b9CiU/7F4YoMfH67LiSGjrjh8 n0xlWujGJwR6/gbY1G4RdFJ7o0QbQPaPVY7sBJrHx7JznZOrESB0zap4QN27ZJlfvlM9 SNgV4ESa4iQA5IXoVU9WSiE1c5bZRs+856KYfW2QlU/fq/MuwbvKDrnoJn2h4YIST1Xx PBoQjVatzI/F1qxk9l8TOxy3Q0jR804vc4yABtMeGqUgngTZtksFvGPXnMBMA2drhsAa vUlA== X-Gm-Message-State: APjAAAVhxIhlvt1gJVjEb6RVlc+yD7FMC/i2R3aDCkn/5Htld9EcN4no caYsoPFEm6N1moesxdr+c2mPwg== X-Received: by 2002:a17:90a:9488:: with SMTP id s8mr2495733pjo.2.1565086310244; Tue, 06 Aug 2019 03:11:50 -0700 (PDT) Received: from rayagonda.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id f20sm101713186pgg.56.2019.08.06.03.11.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 06 Aug 2019 03:11:49 -0700 (PDT) From: Rayagonda Kokatanur To: Kamal Dasu , bcm-kernel-feedback-list@broadcom.com, Mark Brown , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Rayagonda Kokatanur Subject: [PATCH v1 1/1] spi: bcm-qspi: Fix BSPI QUAD and DUAL mode support when using flex mode Date: Tue, 6 Aug 2019 15:37:50 +0530 Message-Id: <1565086070-28451-1-git-send-email-rayagonda.kokatanur@broadcom.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix data transfer width settings based on DT field 'spi-rx-bus-width' to configure BSPI in single, dual or quad mode by using data width and not the command width. Fixes: 5f195ee7d830c ("spi: bcm-qspi: Implement the spi_mem interface") Signed-off-by: Rayagonda Kokatanur --- drivers/spi/spi-bcm-qspi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-bcm-qspi.c b/drivers/spi/spi-bcm-qspi.c index 902bdbf..0dbfd24 100644 --- a/drivers/spi/spi-bcm-qspi.c +++ b/drivers/spi/spi-bcm-qspi.c @@ -343,7 +343,7 @@ static int bcm_qspi_bspi_set_flex_mode(struct bcm_qspi *qspi, { int bpc = 0, bpp = 0; u8 command = op->cmd.opcode; - int width = op->cmd.buswidth ? op->cmd.buswidth : SPI_NBITS_SINGLE; + int width = op->data.buswidth ? op->data.buswidth : SPI_NBITS_SINGLE; int addrlen = op->addr.nbytes; int flex_mode = 1; @@ -981,7 +981,7 @@ static int bcm_qspi_exec_mem_op(struct spi_mem *mem, if (mspi_read) return bcm_qspi_mspi_exec_mem_op(spi, op); - ret = bcm_qspi_bspi_set_mode(qspi, op, -1); + ret = bcm_qspi_bspi_set_mode(qspi, op, 0); if (!ret) ret = bcm_qspi_bspi_exec_mem_op(spi, op); -- 1.9.1