Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4182625imm; Mon, 8 Oct 2018 16:46:50 -0700 (PDT) X-Google-Smtp-Source: ACcGV63BYQWMie5SnEeGmSugqFttNFVWKZCpWhXlEs/NnsLDX/lluBMPmRar/jo9Ehgbi1FairGk X-Received: by 2002:a62:23cd:: with SMTP id q74-v6mr27271899pfj.151.1539042410305; Mon, 08 Oct 2018 16:46:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539042410; cv=none; d=google.com; s=arc-20160816; b=iNzs7WInU5gYurRbKhnOnsS0GZ39Y9r/j/GdfTPhbtJyYj6S7x3U2Tq0xttxa9mKGk RdmWl0c2jt3tqh7ZTbi1ajA/4N36TKf/qHewTzCh6ohgh0IOGqP2gnY6L3yYENdiDb25 3eSTbAtzNeFG07F8qNqaiyhE+QD+RvRAuFWw8u62p+yzFyET0hmpcVpIPjYU7PUfQPVF CncqljaoUNaGdU+1zl2ywlEV7PHuPtwbKthnOakWDSForUTpUbJMla9R41WGEVtP4hVr 5/NZJbSLkLlSw1SvHeirbr6EINIsXoqO/g3gfkLeoBXBn9gPeaCQBlnSbzbjMD0GhCYv ZO4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:subject:user-agent:message-id :references:cc:in-reply-to:from:to:content-transfer-encoding :mime-version:dkim-signature; bh=hJSvbOD9sUTxL2hxEdVBDL7la7p+E79kN7K2RP/hyDk=; b=GbrHHGKkycpcY3F0+38wz2RFMvIuM7phdUXO3dP1QDIkMr+amtztFwbeHT8J7NbagS lNPj+BaTMqo42reX3c8CADwuiwuepNz6gQozWSRkqOxjgWTwkGZaS9EtjncQc0s0c2A0 /brD9ToPo7JzpRcLveHxFoyOHSwqVu2C2RdCth7GOcvr/Rr7ZhF5O/W2Zm1kd0Ms4o8e Bi0ygVhDU20TksfuysNN6l2d7OGvrxy9nSXUGJCLGyTwJ5SkXZWdQ7zKEAquZEQNg91T fKwvxd/Wnm6Bf0XIxZlJgtCrGxaChqkxFnuZizjvONxHHATSPUozEwS3u1jg21Efw1Ln XggA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ZaNu6uwY; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p188-v6si21012124pfg.197.2018.10.08.16.46.35; Mon, 08 Oct 2018 16:46:50 -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=@chromium.org header.s=google header.b=ZaNu6uwY; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726451AbeJIHAX (ORCPT + 99 others); Tue, 9 Oct 2018 03:00:23 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:40435 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725823AbeJIHAW (ORCPT ); Tue, 9 Oct 2018 03:00:22 -0400 Received: by mail-pg1-f193.google.com with SMTP id n31-v6so8516929pgm.7 for ; Mon, 08 Oct 2018 16:46:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:content-transfer-encoding:to:from:in-reply-to:cc :references:message-id:user-agent:subject:date; bh=hJSvbOD9sUTxL2hxEdVBDL7la7p+E79kN7K2RP/hyDk=; b=ZaNu6uwYd4/9NPhY6z8gSixOE5DxCoMZtFpYL5CuYhtAV1PmsaLc/isypk06GxVhj6 qAYH4ncfQhJ+WAiJZ3204HoDaWtKhDdFy1+7PNZHaBtLJ9+gDl3frfhxYnOPb0kb/i9n gORwPbnIGXEkWmlzyRxAC+IXhEFaToxft+HFU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:content-transfer-encoding:to:from :in-reply-to:cc:references:message-id:user-agent:subject:date; bh=hJSvbOD9sUTxL2hxEdVBDL7la7p+E79kN7K2RP/hyDk=; b=BYR5hiY5dYqw3ZepiKwRO3BsVnViZM9uAuB9ndh1YHj8qgbnY80QBygmEAJ2b1Ze5w /zNRetxql1k8h4TyCaolCwdn76mkML7B6c+fKF2YKxFg5u6vV1IlYz4jdavENr7fbfMy sfNrzC75OKhK6+jK0H5zouXGkWPyluu+fZu24nQgmU2pvnivm5Ahl/MPk9UpFtsGft/K eIycxoTaYwIoA9h+sUJEr4Ff0AE1Xiuq66a3hptJTE4ENXRJbwBfXv5maRS+JXnedcsG CpRTBuEJ1vPCmrdglQHDqpn81y1WV/Bj4eH9smyXcPl1DU4wGuAsoGk5EHiAUhqrlQjs 6u6g== X-Gm-Message-State: ABuFfohnO5YTX4aQcwzSWzMA75g2L3N/4/YHoP10Y4QJEGC76dJZ8bJm ZJ6qZt5Qd8PBmA2w/aQsUloPxA== X-Received: by 2002:a63:ae4d:: with SMTP id e13-v6mr23253062pgp.315.1539042373138; Mon, 08 Oct 2018 16:46:13 -0700 (PDT) Received: from localhost ([2620:15c:202:1:fed3:9637:a13a:6c15]) by smtp.gmail.com with ESMTPSA id q7-v6sm25451574pfd.164.2018.10.08.16.46.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 Oct 2018 16:46:12 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: Mark Brown , Ryan Case From: Stephen Boyd In-Reply-To: <20181002214709.162330-2-ryandcase@chromium.org> Cc: Randy Dunlap , linux-arm-msm@vger.kernel.org, Doug Anderson , Trent Piepho , Boris Brezillon , Girish Mahadevan , Ryan Case , linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org References: <20181002214709.162330-1-ryandcase@chromium.org> <20181002214709.162330-2-ryandcase@chromium.org> Message-ID: <153904237198.119890.2367876217526144231@swboyd.mtv.corp.google.com> User-Agent: alot/0.7 Subject: Re: [PATCH v6 2/2] spi: Introduce new driver for Qualcomm QuadSPI controller Date: Mon, 08 Oct 2018 16:46:11 -0700 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Ryan Case (2018-10-02 14:47:08) > From: Girish Mahadevan > = > New driver for Qualcomm QuadSPI(QSPI) controller that is used to > communicate with slaves such as flash memory devices. The QSPI controller > can operate in 2 or 4 wire mode but only supports SPI Mode 0. The > controller can also operate in Single or Dual data rate modes. > = > Signed-off-by: Girish Mahadevan > Signed-off-by: Ryan Case > --- Reviewed-by: Stephen Boyd One nitpick below. Looks better now, thanks! > diff --git a/drivers/spi/spi-qcom-qspi.c b/drivers/spi/spi-qcom-qspi.c > new file mode 100644 > index 000000000000..b8163b40bb92 > --- /dev/null > +++ b/drivers/spi/spi-qcom-qspi.c > @@ -0,0 +1,581 @@ > +// SPDX-License-Identifier: GPL-2.0 > +// Copyright (c) 2017-2018, The Linux foundation. All rights reserved. > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include [...] > + > +struct qspi_xfer { > + union { > + const void *tx_buf; > + void *rx_buf; > + }; > + unsigned int rem_bytes; > + unsigned int buswidth; > + enum qspi_dir dir; > + bool is_last; > +}; > + > +enum qspi_clocks { > + QSPI_CLK_CORE, > + QSPI_CLK_IFACE, > + QSPI_NUM_CLKS > +}; > + > +struct qcom_qspi { > + void __iomem *base; > + struct device *dev; > + struct clk_bulk_data clks[QSPI_NUM_CLKS]; > + struct qspi_xfer xfer; > + /* Lock to protect data accessed by IRQs */ Nitpick: What data? Registers? The SPI core can't do it? > + spinlock_t lock; > +};