Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp721509pxu; Thu, 3 Dec 2020 10:55:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJy2MddMOrjP+JmxNiTQZdmFAEqUcRypreZ+jkWUidPeKSulznEDlCtdIcAQwnWJ/8cgLspb X-Received: by 2002:a17:906:145b:: with SMTP id q27mr3902769ejc.86.1607021726208; Thu, 03 Dec 2020 10:55:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607021726; cv=none; d=google.com; s=arc-20160816; b=1AVJlxYSIis9JW9Tb9QrzZsPnRiuwosPL57RgpMFv00sPVLL3Ht3M6J6/025cPQYPQ XGaIiMCRXAJRahnOena1GQAilXHFcmtDeUWSzlNOK/xdq8iRpsr9b2ioZWftkG8+LwCh DWHHzDDsxDw79ulC3VmZ9T5vSl6e2BnUZDHW3FfMANtUZ+Tqn8HDCquvWaGCrhgEYw2Q /ZaoPs0GpQXAET21s29DAthvn9Ecyl+C99ElgQNghxcfhNzxFX3rx3d+eyk5FX4E/PA2 W0rBlB/Hr+PLELTgIappKVjzPI4Yf1XmrXwWGCAIS0GRCZWt5gsrYgkYpKrEdPNjcW/h TuJA== 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=5ctpCj7P2N5pzu+fYpWrqNY9UojjAbaSvtU9KocPQxw=; b=ZnFwdoA5N7wjKQ/IPEoPx6z0EkH2XlMiuyDSRm34HMXv+wkWdeMNmK94Zqbmc1rNsp lmIh2SCpQ6f6h3c3k7aVTfM3P0N2SijgJlW40rkDMELS6no55zhNOTJVebqJK7Rm3w3h 5HpqcLsZZCbCa752161ndTAgC3wft/NhpMjH0MP+2RCOMsrbl4PUXtkIAHP6BTwqeh9l qvZYfdYSKnep4j4FQj51msB6n4hG/3vNaGHxfkIykwdU8asDJUQG5RbMUFtuk11nce36 h25RFlRJC5NeDdsOGylzX07PMH4dQ6A9fjfBPshg96PTciIVnr7PITjrvZvLOyJUIbqw wGgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lzbZQHAe; 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 hs9si1641907ejc.187.2020.12.03.10.55.03; Thu, 03 Dec 2020 10:55:26 -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=lzbZQHAe; 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 S1731683AbgLCSu5 (ORCPT + 99 others); Thu, 3 Dec 2020 13:50:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725973AbgLCSu5 (ORCPT ); Thu, 3 Dec 2020 13:50:57 -0500 Received: from mail-pj1-x1042.google.com (mail-pj1-x1042.google.com [IPv6:2607:f8b0:4864:20::1042]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16D20C061A4E; Thu, 3 Dec 2020 10:50:17 -0800 (PST) Received: by mail-pj1-x1042.google.com with SMTP id b12so1651080pjl.0; Thu, 03 Dec 2020 10:50:17 -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=5ctpCj7P2N5pzu+fYpWrqNY9UojjAbaSvtU9KocPQxw=; b=lzbZQHAeImJ0w49ZMV6seVpjt0BMMh7VykbsywQGdlNL4xOPD0rWhhxg33853scsN3 o+CO7ucqRf7dMXrqIPqEtcbuvIP9zYScC0YxQk7XoWPzdoCCYJhjzxh8H/kapeY8YOH4 xbbofxUq/v5RTED/GHzjiQia2Lz7ht7HZPb0gkTB0zRv4jI5Vd38NW/49lptNTgG4Qp8 Zy9c/WE7b726xJXDo3Kwc1nbXRHljljjmVICo+XsG/AGLxutP2potFcqnBhUxHVmu6JM uuUjzu8fp158WDYDAT0WArfrgHcukgRqLBVGFy3fVy2vQilpZfFnU5G3cig2xX8modIb zHIg== 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=5ctpCj7P2N5pzu+fYpWrqNY9UojjAbaSvtU9KocPQxw=; b=knY77jgna14HFLUsG4whXVaMLeh8Lj1JXhHhw2ywDqbE0O6LuJnnMBnYdrCk79/rq7 8ZK97Fy63EeUZdU+HWk+3i+E0UkQYB0vdQyL+UIhwZ/u7QGSLZ5KFzkM1CoarhJqY8EY eYXZPSCb+vQmeD7+W7LUW9bPx7ajKANsjfGM89TFhEJSK9+EdGe/GwgiAIJ8Lf3sO4g+ O2zq7rFGGeFb8QIdKERASv9pYKS//JWEEI5dzv4wyesf4JhDA14kp2jZMbGaCjXAvGXm n3BtYIydVHeMWXFcopJJhghsWHe1m71gWFL0Z/2ei+9YIXyvRVEu2wcmJ4wlEIOL39bq NrmA== X-Gm-Message-State: AOAM5329+9/ytPPu1Cmh17Q0tCN7kD/rfWQVBHGn1gF+pCVDwx0dK1Qr K08D0QyNYdoiCnbwCu8ZSyhC1qAIdriPRZxNYfk= X-Received: by 2002:a17:902:ab83:b029:d8:d979:f083 with SMTP id f3-20020a170902ab83b02900d8d979f083mr340719plr.84.1607021415167; Thu, 03 Dec 2020 10:50:15 -0800 (PST) MIME-Version: 1.0 References: <20201203175024.hzivclydoxp6txir@skbuf> In-Reply-To: <20201203175024.hzivclydoxp6txir@skbuf> From: Maksim Kiselev Date: Thu, 3 Dec 2020 21:50:04 +0300 Message-ID: Subject: Re: [PATCH] spi: spi-fsl-dspi: Add GPIO chip select support To: Vladimir Oltean Cc: Mark Brown , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, Maxim Kochetkov Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Vladimir, thanks for the answer! I must have missed these. In any case, I would like to add functionality for using GPIO as CS. Because I have a board which actually uses this. I'II check your solution and modify my patch. =D1=87=D1=82, 3 =D0=B4=D0=B5=D0=BA. 2020 =D0=B3. =D0=B2 20:50, Vladimir Olt= ean : > > Hi Maxim, > > On Thu, Dec 03, 2020 at 08:12:19PM +0300, =D0=9C=D0=B0=D0=BA=D1=81=D0=B8= =D0=BC =D0=9A=D0=B8=D1=81=D0=B5=D0=BB=D1=91=D0=B2 wrote: > > From: Maxim Kiselev > > Date: Thu, 3 Dec 2020 18:56:12 +0300 > > Subject: [PATCH] spi: spi-fsl-dspi: Add GPIO chip select support > > > > This patch allows use of GPIO for the chip select. > > Because dSPI controller can't send transactions without hardware chip > > selects, so first unused native CS will be set in SPI_PUSHR_CMD_PCS > > Are you sure? > > From the reference manual: > > SPIx_PUSHR bits 10=E2=80=9315 PCS: > Select which PCS signals are to be asserted for the transfer. Refer to > the chip-specific SPI information for the number of PCS signals used in > this chip. > 0 Negate the PCS[x] signal. > 1 Assert the PCS[x] signal. > > And the definition is: > > #define SPI_PUSHR_CMD_PCS(x) (BIT(x) & GENMASK(5, 0)) > > Notice the BIT(x). > > I expect that you can set the PCS to 0 and no hard chip select will > assert.