Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp415382pxb; Wed, 11 Nov 2020 06:56:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJyVwZkibf0LHT1zwBZhzn93aejnQ0NXy3dVfy8989YRIkJmX3ChYrc6xIcMW/wwtPio3plo X-Received: by 2002:a17:907:420d:: with SMTP id oh21mr26120585ejb.429.1605106615170; Wed, 11 Nov 2020 06:56:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605106615; cv=none; d=google.com; s=arc-20160816; b=hk1ie+TFHA+Nt7P1imDzXAc9qc1KojJe98Fe7hfHe13AiSz+NT6EIKqk0nZpAppdk+ WUvHQLLhso2fAuh1jtvmBn1O2IEiZa7GDt/jC8c26u6GamrBiJxWs3l0qtv0gz8VQSg+ ThHx0GyWiM8GMMmjLRPnQnNEgXZA+7pGNjopk6vyqdkz0eWmDlg9nMQTNtbN8NVec4+G O9kMiYYOHJSrlNWdC1veAB5hyIfIef8dV07+u3Fw1VmSXyUfBUUTlFW9m/87Z1ISyHeO sv63dQOPEUpunpokjw7L1bToCdR+lU7YAkYmYXHwOfuqR1BfldROC/F3VR5tQ8b4vMzt VOIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=s26bSvuqGwtlpmnW3ixIL61JgOIY8AH9b81Xo/VdBLE=; b=n2elWMLx3tZbXOmrmchDcAIPVgZ4VnbVdPo9po7RPgVF+lMF16cskkXeFEV6jvI56/ /3bmRkZjaa0iu7Zych1LMZ0Asv/4Fm8D09RxBWLQLyaLzSFjanPLaDoE3oVA7Zcw+ABk +G4ON0gw7tbucUBM93IE3hLFpluApQZgPnJDBZZLA+1K4Eh8GBchnu4F3Fu3AWm+NrTq W4rTtoyPIFsKeRn7+qXF+5XkJffl8tALZEp21Ii0iEYugoDz6QzIXO99m1SEJbZdKn3v CmpqIuDTR8CMuPVgvpLa3M6TE35NIL3hGc6dCXI00Jl6tOzKzG6SHzILsYx2HZRCm6Qz qrFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=AIirCFf6; 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 p13si1653678edy.436.2020.11.11.06.56.32; Wed, 11 Nov 2020 06:56:55 -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=AIirCFf6; 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 S1727398AbgKKOyY (ORCPT + 99 others); Wed, 11 Nov 2020 09:54:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727422AbgKKOyU (ORCPT ); Wed, 11 Nov 2020 09:54:20 -0500 Received: from mail-ot1-x343.google.com (mail-ot1-x343.google.com [IPv6:2607:f8b0:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DCFFC0613D1; Wed, 11 Nov 2020 06:54:20 -0800 (PST) Received: by mail-ot1-x343.google.com with SMTP id 30so2354166otx.9; Wed, 11 Nov 2020 06:54:20 -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:content-transfer-encoding; bh=s26bSvuqGwtlpmnW3ixIL61JgOIY8AH9b81Xo/VdBLE=; b=AIirCFf6VcRbiUqAeiEp7cJjZZh0oS2CVANPvn31qwaSkpP3vMouje7Jjk00DAl7Gx BxRcFBPe8ZcuFwF80aQO51g6vxOViLbnSxqccBMJvGjyp01wv/zuMOqMUcWI0Bq7Imdo x/p+XIn+pQpIACVojazCi1xXCVN0NNXlyPSn0soWQMQquywtfRJSwinH6CD3S2rSTQPV 5vIcamJTn9/bESmrZqwoxl12eQPbig6ZL6PC+0QdrPg5aZdaJVnb90BFEMEC7FiVHsSl WPwYLgNSZi53YI7zJdMSYu0G7/pLDTXzaBlf8j1sb/0TuV8y7UgNGv5yp4SPDpY7b+g/ 9rzg== 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:content-transfer-encoding; bh=s26bSvuqGwtlpmnW3ixIL61JgOIY8AH9b81Xo/VdBLE=; b=IwytsLwJDXs0TQZixqjOgZ2AJw7H2TgvCpsLb1flExTKaLUSHYoJVQPWgJ6yPgpxeF Zsii9I0M3jzu35heBTmdUWIqBesCnNYoeM3LmEBNri747XmtkoQejedhe6/SaIFCRChq 87KKn8XN0uYzKXRK9hMk8oWi9Qf4yWIxoOdp9MY2si9U+MWNy/iIxwrn/vWYYigrXVer ajgLC9+wFzi0PfrU4dz2bDOD05VhDJTvVGDHd8pGFRbLznvor79AysrPB4WEfmNMQOF1 hfG7Icz+YkpJorjprkHDeJTVr9ctTblWWheCzDFMYAh0BAv3tKzy9ciloBZCe9EX2v7t dEsA== X-Gm-Message-State: AOAM531ZDv6ZEZa811K418j9HYiZ7qrNO67HatPFa2wZv2K7zEG0pnss F/zeIj3HyVEXh9/tq6CgvYenxultYCl3ejTEL7M= X-Received: by 2002:a9d:6f91:: with SMTP id h17mr2669643otq.224.1605106459501; Wed, 11 Nov 2020 06:54:19 -0800 (PST) MIME-Version: 1.0 References: <20201111141529.98147-1-alexandru.ardelean@analog.com> In-Reply-To: From: Alexandru Ardelean Date: Wed, 11 Nov 2020 16:54:08 +0200 Message-ID: Subject: Re: [PATCH] spi: Add SPI_NO_TX/RX support To: Andy Shevchenko Cc: Alexandru Ardelean , linux-spi , Linux Kernel Mailing List , Mark Brown , "Bogdan, Dragos" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 11, 2020 at 4:45 PM Andy Shevchenko wrote: > > 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 lin= e > > 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? oh, good catch > > ... > > > - /* check mode to prevent that DUAL and QUAD set at the same tim= e > > + /* 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? > */ =C2=AF\_(=E3=83=84)_/=C2=AF Not sure what SPI prefers as multi-line comment style, But ok. > > ... > > > #define SPI_TX_OCTAL 0x2000 /* transmit wit= h 8 wires */ > > #define SPI_RX_OCTAL 0x4000 /* receive with= 8 wires */ > > #define SPI_3WIRE_HIZ 0x8000 /* high impedan= ce turnaround */ > > +#define SPI_NO_TX 0x10000 /* no transmit = wire */ > > +#define SPI_NO_RX 0x20000 /* no receive w= ire */ > > Perhaps switch to use BIT() instead at some point (as a prerequisite > patch, for example) I'll leave this up to the maintainer preference. Maybe I'll do it as a second patch here, so that I can be dropped. > > -- > With Best Regards, > Andy Shevchenko