Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp410572pxb; Wed, 11 Nov 2020 06:49:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJwRLACOOwFRkgNrLztdtKbjnh7FNxSxP2mKhfrvLDbesnWnS8t1UAb9IR78tr3XeE1uNQGY X-Received: by 2002:a05:6402:b35:: with SMTP id bo21mr5611333edb.52.1605106179363; Wed, 11 Nov 2020 06:49:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605106179; cv=none; d=google.com; s=arc-20160816; b=ebS7aDC6yz75oByG0GuMzd5H3o7Mu1dKKhivNuzMIwdDl8PA/7pSw++g7KMtjOKcnw oCjLtUiPJz5j6oulT0ETvNZLoznEkFeQkbV4P+RnqTc03/rvTMkPt1mzwGGNn/g3if3p mdDY1lyJ4DRHrkLdEVaTdMjTskV/N0X81SPCHrWi023MOLv6bMzqtViTFSEniOLGEsf8 mE2Ijk7C8FY1ggqtyDPSIQ1ct8eVHFd1y3OZ4mMI1KzhFzHvnC279eQ7vNEpiQHFqEs2 mzh2+vgRhJC0B9VvJHaclm1/jjzusqz/lV5ek+wp6tJE3u3QrD47Hx0LPpVXgcIMDlj6 HpGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=QuhezNq2xmeafvchQlzIbY9JsjQJ+3pWNXa3pdsQlqM=; b=ZcpF9Mvb6KxvX37DDaLcRlFy2g9vwv2mB3MzWDKFk6esislVkGtIzxuZOgdKLwlwtD CsUrbXgJjhosJb07iJb2XHG+TW+zGVo204x0Qgx061sIdij29kM5yeAMDWwy1pz/j0TL R72BUXDup92BR/riMe90X2p2ZT/UpgyVYvExNuIA10EDgbrZh3HefTVZ+4AX2YNA3Tw6 CPmcewhY0E2U6b4en0RiH1G+iCDau7VukefOK6q9J1hQwzSRd7VyI0PjOAnAhzJLEpK+ pBbVHTGVWtjh3dbqKR6oK4Qt7l8fhafRlaIAkr6dCxGmNKmskoti0PgK5+EMQAm6kwcS bnTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=n9A+JbAZ; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b1si1669443edy.451.2020.11.11.06.49.14; Wed, 11 Nov 2020 06:49:39 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=n9A+JbAZ; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725939AbgKKOpt (ORCPT + 99 others); Wed, 11 Nov 2020 09:45:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725909AbgKKOpj (ORCPT ); Wed, 11 Nov 2020 09:45:39 -0500 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9308C0613D1; Wed, 11 Nov 2020 06:45:38 -0800 (PST) Received: by mail-pg1-x542.google.com with SMTP id i7so1576268pgh.6; Wed, 11 Nov 2020 06:45:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=QuhezNq2xmeafvchQlzIbY9JsjQJ+3pWNXa3pdsQlqM=; b=n9A+JbAZEp3NuDeNnot2mOxvTR+YMefqh/LkPfVIG96h2znG40AYdzJoppK12VwM9C dEZKlBFP9+OfNTsfH492yUBO3CtBdvH3Dq+FxW9wW4ta5A04judTu+phr4LKJA5pwmQm MwU9K/STQoo3SNT6aScow4A26pZ75n8VsHARak/u6xfM5K+Wlapaa2pmE8JGTmCIwCUq kZjU/bcTaFTT1R+aIOURcGSK1pbZOpBj6euvV6MgbMKRlw38aF8xwYNUPR0msnooajYo GarSJ07O9eUQ0mWSCj1n+ZcOeoZw0ueTCrsxkGFhpO4LG265hmcJ3U7lq0Hp/Cit5lSH RBWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QuhezNq2xmeafvchQlzIbY9JsjQJ+3pWNXa3pdsQlqM=; b=l7waHv/L+RN/duo7oe9Fr5sORu8ovvKNwoXwOqFNLfE++w6M41BtkwTeLpSK8g9KVz Wtkm5JsUY/HTlpBhXfc1lYcoso+vycYWGPvwnziKzCqaG1mOC1ZERuXEJfoDyTzdI0Yv C1/awZyfXtSfXjaCvqetPonn+NBFXnKLS+M0FNAjb6wFWWuSImdjkAFK0Bpa/0EUGQBw OQt4kL0Gq1r7FyHwAeWLO4BkudGUIdh96gsrnuhtFRfH+4xa+lCYiQENHSGVsxtLkgqy XAAhmvGGqMtVSESqBfoiX6mcYKwozPckIWauethJjYcFL82idkN4To2ewY/9NuqwyMVv Q23A== X-Gm-Message-State: AOAM530EarNNWF6wjxD0+kEUhnhhi7HGZAXyaEjvnyR+DnAlNMezAPVs p7L7+ykOIpZQ8awLcASwJ83Hj4AGICFZbGEGuwOcL/iqYco= X-Received: by 2002:a63:3e05:: with SMTP id l5mr21572969pga.74.1605105938509; Wed, 11 Nov 2020 06:45:38 -0800 (PST) MIME-Version: 1.0 References: <20201111141529.98147-1-alexandru.ardelean@analog.com> In-Reply-To: <20201111141529.98147-1-alexandru.ardelean@analog.com> From: Andy Shevchenko Date: Wed, 11 Nov 2020 16:46:27 +0200 Message-ID: Subject: Re: [PATCH] spi: Add SPI_NO_TX/RX support To: Alexandru Ardelean Cc: linux-spi , Linux Kernel Mailing List , Mark Brown , "Bogdan, Dragos" , Alexandru Ardelean Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 11, 2020 at 4:13 PM Alexandru Ardelean wrote: > > From: Dragos Bogdan > > Transmit/receive only is a valid SPI mode. For example, the MOSI/TX line > might be missing from an ADC while for a DAC the MISO/RX line may be > optional. This patch adds these two new modes: SPI_NO_TX and > SPI_NO_RX. This way, the drivers will be able to identify if any of > these two lines is missing and to adjust the transfers accordingly. Shouldn't this update a binding documentation? ... > - /* check mode to prevent that DUAL and QUAD set at the same time > + /* check mode to prevent that any two of DUAL, QUAD and NO_MOSI/MISO > + * are set at the same time > */ /* * Perhaps switch to proper multi-line comment style * at the same time? */ ... > #define SPI_TX_OCTAL 0x2000 /* transmit with 8 wires */ > #define SPI_RX_OCTAL 0x4000 /* receive with 8 wires */ > #define SPI_3WIRE_HIZ 0x8000 /* high impedance turnaround */ > +#define SPI_NO_TX 0x10000 /* no transmit wire */ > +#define SPI_NO_RX 0x20000 /* no receive wire */ Perhaps switch to use BIT() instead at some point (as a prerequisite patch, for example) -- With Best Regards, Andy Shevchenko