From patchwork Wed Jan 4 09:36:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hector Martin X-Patchwork-Id: 38831 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp5053526wrt; Wed, 4 Jan 2023 01:38:44 -0800 (PST) X-Google-Smtp-Source: AMrXdXtiAF8rVZvhkYCOA5VFd8Fhqx0t2CeYeShlqYZ4QLutp4xAbcowB71vDx1xn640c7oX9NOu X-Received: by 2002:a05:6a20:e68f:b0:b3:32fa:1d9d with SMTP id mz15-20020a056a20e68f00b000b332fa1d9dmr41017190pzb.33.1672825124434; Wed, 04 Jan 2023 01:38:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672825124; cv=none; d=google.com; s=arc-20160816; b=CQ+lJCWuxquwwoETVZ8F7+6s8b/P964EBa95akPn1jQILE0jAr4BBPv+PSjnOurF8P qN9l0MUehEXcM1sax7lCWSuy31Fg6zfyQfIg/P4I4ChLM81CNEJPdfRBulZDrgCAf8Qp cTPK0gBSmc2yWcYvTIaYrtUZjNbAi3Vl2h/zT3D+p3uM/FTS8I8bHqwN3R9hlSSaLdKL c0X1Nf0cTrDCAYPDZ/x70Q9/+F7qdWEAiwcEENcyC/hx+5OWz22MhcMp8mcmAbBKgitD DTaDY+KIGsvE7X3eD7ke6+ToFF+T3CwVN3/gcu0+fqzlld3V1uwYrwoM/CioOkqaiUZZ v0kQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=TDmSEFmLR6oUIEQgVTUGDcAFm7h/BUbSu1qkYlKUJao=; b=XqJPTEF4zi5s0hiJebWn81emXh0ORDgB2ssLN1ej9OmSTewjb/Q5eyk2IwJ3e5k2Jp 8O9VG1T6jFCMhUiyQI0Jqff+dOrwTu9f7oQoh/5kWQnNsj6RZV/l3K5pgqmLTy6b8b5u ha+YOqd2i/0oSFs1seUDWnel2eFnHb/scoPX1jF65WOcRy+t6+95FiDoDa5Z86UUXvKe 6pkKKEMk+Sj3zl6L7AupJQMs/FR3/LRzow0aetsg4z3oGKFP0lUKpibR4kN3rJE/w9qe w84VO2AaGjIEANwQgaI5h1WHoynkearSYhBT5ACXMIDh/5LNCnz7w3HPJjN2jHTtQDRh WXkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marcan.st header.s=default header.b=FoXDLqQ9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=marcan.st Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x5-20020a654145000000b004a2d9640cd1si8105256pgp.168.2023.01.04.01.38.30; Wed, 04 Jan 2023 01:38:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@marcan.st header.s=default header.b=FoXDLqQ9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=marcan.st Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234112AbjADJhy (ORCPT + 99 others); Wed, 4 Jan 2023 04:37:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233970AbjADJh2 (ORCPT ); Wed, 4 Jan 2023 04:37:28 -0500 Received: from mail.marcansoft.com (marcansoft.com [212.63.210.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 935D0DEB8; Wed, 4 Jan 2023 01:37:27 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sendonly@marcansoft.com) by mail.marcansoft.com (Postfix) with ESMTPSA id 28B5C42037; Wed, 4 Jan 2023 09:37:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=marcan.st; s=default; t=1672825046; bh=LVorCvTWQkz/Q2WObjMPReptUQz5qI2RIky6WbFd8ZQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=FoXDLqQ9RJ5PImr1LqyPYsRNBNO4bSKH61SINclpT988VTvJ1vEqCI5lCEC5J6ePQ FPsZvNqk3caFL9tYimvlB0lZ/cB+e5rEe66VCkomQMaQpA+RujCsHSNpnQegzh8jpR QRmAP46ut4paie3FM8Zo1Mw4Qh9wo2yWoqK/qcao4ikw7THfXnKBCtYz77kRCkvoYO dcGEjXjX28FKa4oS+vZVNkvG8D/ARjh7M/OK9ge18pgB8J4aoe5r2AV6Tkg1ALsg+l 5otvzwYClu7BMGuJT+UrKDsdqcy3UtMnMjnQaD9Zzm380LvqTPIujaza22/IwVoNXF 1qovWHKLEcibQ== From: Hector Martin To: Mark Brown , Rob Herring , Krzysztof Kozlowski Cc: Tudor Ambarus , linux-spi@vger.kernel.org, devicetree@vger.kernel.org, Janne Grunau , Alyssa Rosenzweig , asahi@lists.linux.dev, linux-kernel@vger.kernel.org, Hector Martin Subject: [PATCH 1/5] spi: dt-bindings: Rename spi-cs-setup-ns to spi-cs-setup-delay-ns Date: Wed, 4 Jan 2023 18:36:27 +0900 Message-Id: <20230104093631.15611-2-marcan@marcan.st> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230104093631.15611-1-marcan@marcan.st> References: <20230104093631.15611-1-marcan@marcan.st> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754084278026005750?= X-GMAIL-MSGID: =?utf-8?q?1754084278026005750?= Other delay values follow the delay-ns naming convention, so unify the newly introduced spi-cs-setup-ns property for consistency. Also fix a typo while we're here. Fixes: f6c911f3308c ("spi: dt-bindings: Introduce spi-cs-setup-ns property") Signed-off-by: Hector Martin --- .../devicetree/bindings/spi/spi-peripheral-props.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml b/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml index ead2cccf658f..9a60c0664bbe 100644 --- a/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml +++ b/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml @@ -44,9 +44,9 @@ properties: description: Maximum SPI clocking speed of the device in Hz. - spi-cs-setup-ns: + spi-cs-setup-delay-ns: description: - Delay in nanosecods to be introduced by the controller after CS is + Delay in nanoseconds to be introduced by the controller after CS is asserted. spi-rx-bus-width: From patchwork Wed Jan 4 09:36:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hector Martin X-Patchwork-Id: 38832 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp5053563wrt; Wed, 4 Jan 2023 01:38:50 -0800 (PST) X-Google-Smtp-Source: AMrXdXuxOSlBP2/dR7uKE1nm0BvbnF5ZitQm74CyClspi5UyX77QDwL4glWwgWTxgLp7eQOghnUp X-Received: by 2002:a62:6345:0:b0:580:cfbc:2902 with SMTP id x66-20020a626345000000b00580cfbc2902mr33829515pfb.1.1672825129894; Wed, 04 Jan 2023 01:38:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672825129; cv=none; d=google.com; s=arc-20160816; b=dnos1PYgVGWAIe05d6eHUdwz0Nk1cgEDGF1U+Ia/eWs7kggXiexAnX7O0i1Rk+i8EO PHxlVSCb92E4GE+1AesaZqIGtDR9SzfRIjQn+cUkr6LXuVAe2Omlhi89y7D/M4JT74/O VUjIec0mC3mofPO8fNJVc6yIP9gyNoGZXd3zJssDBzmHbGJyVvD349bqyij0+BfUe1A9 dljiwiaxe3828AeXX8ubYTHdEH4qVoXHvSHD/89+m5GenzD7yHo4FCKVcJtbczKqtSRE 8FmcRQ1NyV4/iNReNi3ONaXpvhzA/tyJSslWdggeIDDzi0hk+mO7DhRImZ14dgntvYc/ uF8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9lgye+CzU9r/GgRqRJGRjZ339sTE/nv2e8xRQA5P274=; b=Gt/h3E7PjLbZ6FyA/bb7Al1L7oHi4ZE6hP8alT7b0V+hmnCD18Cp+Zoeg0Yf9UP+jg /CBllOupRVrSDExUHYvuB6pzBuMqVf15J6af9lctlFFLjOCi9ECmaaOIDyGZLF9XzGah DAFvWf7FLmKLJ3Qe0Cwqxazugh0V16dIHEgHOerVg+utTZAr1xOxTZ58QzxODoVSw0RY S3b1WS9U3T/pA/pyldVfDLMlndcIzS5pPZzsulxbEvKPoODAPKCp3vqeybgGX2GWdnW0 LTxS9Fpde7D2k2ADHnty2MRlXvZ9deKZFFCebQ7yYw+J9yBK1VsmX08M3kb8obau1Lxb aaCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marcan.st header.s=default header.b=lZku2SsD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=marcan.st Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y16-20020a056a00191000b00581da213e4fsi17133636pfi.350.2023.01.04.01.38.37; Wed, 04 Jan 2023 01:38:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@marcan.st header.s=default header.b=lZku2SsD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=marcan.st Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234847AbjADJiD (ORCPT + 99 others); Wed, 4 Jan 2023 04:38:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234187AbjADJhb (ORCPT ); Wed, 4 Jan 2023 04:37:31 -0500 Received: from mail.marcansoft.com (marcansoft.com [212.63.210.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 261E9F013; Wed, 4 Jan 2023 01:37:31 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sendonly@marcansoft.com) by mail.marcansoft.com (Postfix) with ESMTPSA id B7D28420D8; Wed, 4 Jan 2023 09:37:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=marcan.st; s=default; t=1672825049; bh=G5TX+anFIWoHfncOvTyCwezW20GEHFXk9oFHLEBFckQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=lZku2SsDXtQgkl+j/JnSAI0Sc4jUBUce48BoVpuaugQ0McVzrb3comLL2fiS68SoB NS0Z/IAYGGoaClPSXDNap/gv5wj2RrvXopGO5H5lb5noedGMZI2uHKbUxfIJ1uhBIs arS+tsrzsRakh65bSU6I69socaF6XVSe6miN5ZiDkEiwYZ4R4aUH+k3desfmF3xogA 8yqK5gJtK6Mw/v5gQeXqBgclCXtpBGkLsWVwYOFIdDj+7GoDx06StYgOreEzHo0RTA mRYA3gV83KjvEMElxr4RJPCifKL0qdLacUCjf1ZaB1z0k+sf+X37T5oFG5Dle09fs/ Uwh+DgGrivTRw== From: Hector Martin To: Mark Brown , Rob Herring , Krzysztof Kozlowski Cc: Tudor Ambarus , linux-spi@vger.kernel.org, devicetree@vger.kernel.org, Janne Grunau , Alyssa Rosenzweig , asahi@lists.linux.dev, linux-kernel@vger.kernel.org, Hector Martin Subject: [PATCH 2/5] spi: Rename spi-cs-setup-ns property to spi-cs-setup-delay-ns Date: Wed, 4 Jan 2023 18:36:28 +0900 Message-Id: <20230104093631.15611-3-marcan@marcan.st> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230104093631.15611-1-marcan@marcan.st> References: <20230104093631.15611-1-marcan@marcan.st> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754084283347620685?= X-GMAIL-MSGID: =?utf-8?q?1754084283347620685?= As mentioned in the corresponding DT binding commit, the naming scheme for delay properties includes "delay" in the name, so let's keep that consistent. Fixes: 33a2fde5f77b ("spi: Introduce spi-cs-setup-ns property") Signed-off-by: Hector Martin --- drivers/spi/spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 3cc7bb4d03de..15f174f4e056 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -2310,7 +2310,7 @@ static int of_spi_parse_dt(struct spi_controller *ctlr, struct spi_device *spi, if (!of_property_read_u32(nc, "spi-max-frequency", &value)) spi->max_speed_hz = value; - if (!of_property_read_u16(nc, "spi-cs-setup-ns", &cs_setup)) { + if (!of_property_read_u16(nc, "spi-cs-setup-delay-ns", &cs_setup)) { spi->cs_setup.value = cs_setup; spi->cs_setup.unit = SPI_DELAY_UNIT_NSECS; } From patchwork Wed Jan 4 09:36:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hector Martin X-Patchwork-Id: 38835 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp5053736wrt; Wed, 4 Jan 2023 01:39:22 -0800 (PST) X-Google-Smtp-Source: AMrXdXssMlactNoakb7EWJXWMVRx7+ZPVq/ozSJFoJlIgVp4fPMoqd1eyewcE/N1H486q/nkEYUF X-Received: by 2002:a17:902:8481:b0:192:b5b3:b800 with SMTP id c1-20020a170902848100b00192b5b3b800mr16418470plo.39.1672825161778; Wed, 04 Jan 2023 01:39:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672825161; cv=none; d=google.com; s=arc-20160816; b=R0qEEGxMzRup7lkmSNYN3WnQruw5+ui3FxDucOIjW9MJXPVcpJO3RX2wnQhITXwRDO u8y/0L+Pr++DQ4W/SgTAxRykrotxT2f6qCNc5hkmf2AuKqywO7IxDSQJPn1GZd38bOZZ gRsRVrQcaEpx2UQR1BSRZqfZ4nL5Q44rBh8/c8NhnL6CIL7P9mgOlrs7mnZX48/A4jYa MHyarh80oGngBPSWJ5Hy093p4JzgteOKUlHHVL/cGn9rjWEDdXdmrtdooHoygj5+VVpe Uv/g16USkSMdunr+3cQ0uHHvKwDZaO1bj1cO44pmvlshVReUINxyC9BeTjfgGU85HOtT s3NA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Rz1QvljqFjJ2T7kuTnxd9NI2h2fePxX/YKNHSGdmyqg=; b=nedzc6yRjb2xN24kKLdesiU119sP9yev5it5jX24QCqqsKSGHDyUzFB2usjxhJnVkn 8HRu/N89E0LEzdsSsDB+zmIbzIfgM6ajqBenOOEvmCwmlIpk8cpD4ShXEfIeLSnITyQF AKx5JDS553dBpqu0QRlFWkwN9FT5hU4axwrGWUTXv2+OmvYHpocA3JTbG+J52frspj7W xRO8mnosEiBSYv/Vnk1RgWfNc+Rl/eP6g+WmBSBviizeX1XdkLxoZrOn8UUKem7FLafF UiqaZHxSvEyox+WhLSi5U0z5ifsJ8amoDNGdBWYuy3dyv0sbFsZghjno8mA8/koIjjvE XsIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marcan.st header.s=default header.b=pUVvWOp1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=marcan.st Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bi2-20020a170902bf0200b001895e356f00si32887399plb.152.2023.01.04.01.39.10; Wed, 04 Jan 2023 01:39:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@marcan.st header.s=default header.b=pUVvWOp1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=marcan.st Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239176AbjADJiH (ORCPT + 99 others); Wed, 4 Jan 2023 04:38:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234567AbjADJhg (ORCPT ); Wed, 4 Jan 2023 04:37:36 -0500 Received: from mail.marcansoft.com (marcansoft.com [212.63.210.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5CF5F015; Wed, 4 Jan 2023 01:37:34 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sendonly@marcansoft.com) by mail.marcansoft.com (Postfix) with ESMTPSA id 51F6742137; Wed, 4 Jan 2023 09:37:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=marcan.st; s=default; t=1672825053; bh=yxqAc1bBEfZDS+8bRfcAcj3SjysPRG0Y/YATmIkz/cs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=pUVvWOp1RYpDwgh5qbEt7nGu6aC/XdWaW3yV1D8l0utAhMB6LWzMX35bp1Kv3xjP6 oKjaOntsGEpiqjOpd8AhWgWTKNAH+mavHz0wdzLmfyYBODGdt1xkGw0Ru/rklw+HFp WfB7+WF7VfKmHpI9U05k3JV3a+ux0pWuzsM5+dW2jwvyBSY2pUGy8wSK0teca73RvS do3YMpMCo9gskQ1Q1396CKy3dNjcQ5sBB/QGX9ViFT1GjOaVWaUCkANJQC3p5pKeyu 1N97/zUobhhRuLtX+GfehEyV8+/PXKfAUL/REdSX4QcAPGzgtAjEB6oQxn/TG/ZUol 5+9IFWSbtMbcA== From: Hector Martin To: Mark Brown , Rob Herring , Krzysztof Kozlowski Cc: Tudor Ambarus , linux-spi@vger.kernel.org, devicetree@vger.kernel.org, Janne Grunau , Alyssa Rosenzweig , asahi@lists.linux.dev, linux-kernel@vger.kernel.org, Hector Martin Subject: [PATCH 3/5] spi: Use a 32-bit DT property for spi-cs-setup-delay-ns Date: Wed, 4 Jan 2023 18:36:29 +0900 Message-Id: <20230104093631.15611-4-marcan@marcan.st> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230104093631.15611-1-marcan@marcan.st> References: <20230104093631.15611-1-marcan@marcan.st> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754084316841074023?= X-GMAIL-MSGID: =?utf-8?q?1754084316841074023?= From: Janne Grunau 65us is not a reasonable maximum for this property, as some devices might need a much longer setup time (e.g. those driven by firmware on the other end). Plus, device tree property values are in 32-bit cells and smaller widths should not be used without good reason. Also move the logic to a helper function, since this will later be used to parse other CS delay properties too. Fixes: 33a2fde5f77b ("spi: Introduce spi-cs-setup-ns property") Signed-off-by: Janne Grunau Signed-off-by: Hector Martin --- drivers/spi/spi.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 15f174f4e056..370e4c85dc54 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -2220,6 +2220,22 @@ void spi_flush_queue(struct spi_controller *ctlr) /*-------------------------------------------------------------------------*/ #if defined(CONFIG_OF) +static void of_spi_parse_dt_cs_delay(struct device_node *nc, + struct spi_delay *delay, const char *prop) +{ + u32 value; + + if (!of_property_read_u32(nc, prop, &value)) { + if (value > U16_MAX) { + delay->value = DIV_ROUND_UP(value, 1000); + delay->unit = SPI_DELAY_UNIT_USECS; + } else { + delay->value = value; + delay->unit = SPI_DELAY_UNIT_NSECS; + } + } +} + static int of_spi_parse_dt(struct spi_controller *ctlr, struct spi_device *spi, struct device_node *nc) { @@ -2310,10 +2326,8 @@ static int of_spi_parse_dt(struct spi_controller *ctlr, struct spi_device *spi, if (!of_property_read_u32(nc, "spi-max-frequency", &value)) spi->max_speed_hz = value; - if (!of_property_read_u16(nc, "spi-cs-setup-delay-ns", &cs_setup)) { - spi->cs_setup.value = cs_setup; - spi->cs_setup.unit = SPI_DELAY_UNIT_NSECS; - } + /* Device CS delays */ + of_spi_parse_dt_cs_delay(nc, &spi->cs_setup, "spi-cs-setup-delay-ns"); return 0; } From patchwork Wed Jan 4 09:36:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hector Martin X-Patchwork-Id: 38834 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp5053635wrt; Wed, 4 Jan 2023 01:39:04 -0800 (PST) X-Google-Smtp-Source: AMrXdXtVFWkMZaQAuEBJWZTmGttkF8Pex8nyJe3O2R1jUN5cA0Gc0ivhiVyTiIe5MD19sqNDbwXr X-Received: by 2002:a05:6a20:4655:b0:aa:23f9:7314 with SMTP id eb21-20020a056a20465500b000aa23f97314mr48556310pzb.46.1672825143907; Wed, 04 Jan 2023 01:39:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672825143; cv=none; d=google.com; s=arc-20160816; b=dr7byxprDNYCU49e2Tpd4SjOMk+JrlZjLtmuW5TP8f6FDOF2PnwikMPXAhZ8I8Ivpj 0jiRu2bX0SZDTDxS+02dqdcpYX3yq/JW7nGzL6SbvKnwVC5j/JE4fuYS/1YwypnGvwR7 9BpOif7bUEhvCMLzW4QBA20ed2Ghs+YcPsDKgumb/5GgCuo6GyZ/KMxqLDzrANor00P/ oxCQLPKIPasxumXHJYS1kHZsWn8DQ1RJ6ef+AxHX21LYzvfbmjSGq0HqO7ZjNUiofER+ z29V1LZD/zajiUX/e0Pou0Zb0HNW7hJSZWe63JblXvvahOz3bf9eaq3rwE8ONBT8XDx2 t+XA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=jr3uMUAzKewQFBCCj7g3IoVxrK0o5mooVmBomlp0574=; b=Yoh7DPx8ZGcaN0S+lC173yjFt6qn8PPnbc1gcrxAKR/197TIcmh9iMX5Ojl/4kK6qh yMxQtkQte044dU5ArNhp/xMIp1wMfN/r+rx5zGwMniPOdXibZYdPmcoBCggteEnNZldp /8fvLzsAE5ieZexfUhC4Zcp3LgR+s8NSdr/7NuvI2SL4aeUPCkQUsjxyce2H0hkzaf2m TZ9bBKMdOIRnI+nBaxOJZy0pE6GPc9y6HdXPgPDKzsjH0a5sY6ZkHp7eiUDgG9bqQiM8 H40KM3r3FD0jhWVH460tgU7aVeqS/BUpG3T4k5hXY+XXq/2QVHYwp4Zu7AvXf5+6E1dZ V0qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marcan.st header.s=default header.b="HhZ+eD/Z"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=marcan.st Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v24-20020a63f218000000b0049e18ff25d4si17563439pgh.809.2023.01.04.01.38.50; Wed, 04 Jan 2023 01:39:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@marcan.st header.s=default header.b="HhZ+eD/Z"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=marcan.st Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239205AbjADJiK (ORCPT + 99 others); Wed, 4 Jan 2023 04:38:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234422AbjADJhl (ORCPT ); Wed, 4 Jan 2023 04:37:41 -0500 Received: from mail.marcansoft.com (marcansoft.com [212.63.210.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 526AC1839F; Wed, 4 Jan 2023 01:37:38 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sendonly@marcansoft.com) by mail.marcansoft.com (Postfix) with ESMTPSA id E287242037; Wed, 4 Jan 2023 09:37:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=marcan.st; s=default; t=1672825057; bh=NUEh0FNVbl8pM5v3KLVsYoeV+coXZrlb1+D5P/bGSSM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=HhZ+eD/ZncivrtyFKQI4dRTREx8Czu7pZTMHYTB1CDFE6pEVnkM2RTQR+TCBcFk42 9VYuPyml0THd37OvUssFznHXZcoaczR2eIypomMKN7NAGpk2n9fXUb4Qo+B2e3Jlkx IzLM+xQfYqjM+gCa4N56ygvujCbVSpgHE0ICkekH3I89YeSBoSAuNRVY9jyH8Mp7On WXGXzzBwsAGNUgiTqNL2+a6QCdj3sOo7MeXgqpJLxK9AJaWkrBh3bSY20SLZQWBk1N eJqotZcGoJrcQYYhrYB2p0gSudj9N2X+1WhnGDMe9ZxBn4sQQJpvdB9YgGGH6ySPRg 9s3FyXTGuI/XQ== From: Hector Martin To: Mark Brown , Rob Herring , Krzysztof Kozlowski Cc: Tudor Ambarus , linux-spi@vger.kernel.org, devicetree@vger.kernel.org, Janne Grunau , Alyssa Rosenzweig , asahi@lists.linux.dev, linux-kernel@vger.kernel.org, Hector Martin Subject: [PATCH 4/5] spi: dt-bindings: Add hold/inactive CS delay peripheral properties Date: Wed, 4 Jan 2023 18:36:30 +0900 Message-Id: <20230104093631.15611-5-marcan@marcan.st> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230104093631.15611-1-marcan@marcan.st> References: <20230104093631.15611-1-marcan@marcan.st> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754084298373383370?= X-GMAIL-MSGID: =?utf-8?q?1754084298373383370?= From: Janne Grunau These two properties complete the bindings for the Linux spi_device cs model, which includes cs_setup, cs_hold and cs_inactive delay values. Signed-off-by: Janne Grunau Signed-off-by: Hector Martin Reviewed-by: Rob Herring --- .../devicetree/bindings/spi/spi-peripheral-props.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml b/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml index 9a60c0664bbe..782a014b63a7 100644 --- a/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml +++ b/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml @@ -49,6 +49,16 @@ properties: Delay in nanoseconds to be introduced by the controller after CS is asserted. + spi-cs-hold-delay-ns: + description: + Delay in nanoseconds to be introduced by the controller before CS is + de-asserted. + + spi-cs-inactive-delay-ns: + description: + Delay in nanoseconds to be introduced by the controller after CS is + de-asserted. + spi-rx-bus-width: description: Bus width to the SPI bus used for read transfers. From patchwork Wed Jan 4 09:36:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hector Martin X-Patchwork-Id: 38833 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp5053628wrt; Wed, 4 Jan 2023 01:39:03 -0800 (PST) X-Google-Smtp-Source: AMrXdXsZhMkAzQBbmddLjgigkVth8jLRdTQLImWxM3PjPP0EEjak5Lg6h46E64ueFegpGv32BXOL X-Received: by 2002:a05:6a20:cc45:b0:ad:2ae:bb6e with SMTP id hq5-20020a056a20cc4500b000ad02aebb6emr52286838pzb.55.1672825143007; Wed, 04 Jan 2023 01:39:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672825142; cv=none; d=google.com; s=arc-20160816; b=EX3Jeiav7MvRUzqcTHkWWhtSs46k0/nswpSLc+brp9wGe0UTsgqcfvEVQgvJAUmj0G hcnK91zvKLDBSpIh4QmOqOGraVNVRXNF8FNVFd4odqdG+nkznkI6DtjK/TtDR7cbBtqf pZIbcVuU5dX5mhlVyNh9HjYhhlt8hs/vJV9gXYikL+wTn066WH7V+Hq2QL82wXbM+tjS 0luFhZEqcZr/ySDyS9KXYxG1n5l/oGolv+HJmfHu5v6OFB3Jm1sMuXuJwG1ept95cKIs cMw+XayaxYwZa8lzg7X/svYAjHoxniFnlNOefFLwunzzOfMeOe4E6O3IieWGm72LTWiE UAxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=aL/c6aBjE6DFRo4WuToQ/EIygYknf0N5NTyX4gpD5Gc=; b=c0aQncs0bTdxfaWUh9SIN8YoFAi2PA639TYarXbeJxVqtAPvoRwvf987kJvVYPFgF/ WchpEtoVtRZH9raTGzLlVn89fl/iptvD5db1XOJSbICLRXG16MzYF8NA1TcVUog629e2 OzEmdKWiCsNASGGaVi0PMjUZsb9rjGr9DtmbJ73hdftrbQVyqATxsg9Imat61vkxuWVQ QsDQCRUIr5cSKZCsj+5QTRIRfaMPTBq0EXcPP/6mLqjmH2XRTV6yiTFjwAFKw97COwGG YjcdKNLpTRaa3QCbylct0a+bTuqnzb2dJvkcshs2wBqrm4/rAX7dVErGO/NWQfbVbXfc 2sRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marcan.st header.s=default header.b=cB9pcZPr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=marcan.st Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bc22-20020a656d96000000b004928a5abf68si31516986pgb.876.2023.01.04.01.38.50; Wed, 04 Jan 2023 01:39:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@marcan.st header.s=default header.b=cB9pcZPr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=marcan.st Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239222AbjADJiP (ORCPT + 99 others); Wed, 4 Jan 2023 04:38:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239084AbjADJhp (ORCPT ); Wed, 4 Jan 2023 04:37:45 -0500 Received: from mail.marcansoft.com (marcansoft.com [212.63.210.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E18C117E2B; Wed, 4 Jan 2023 01:37:41 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sendonly@marcansoft.com) by mail.marcansoft.com (Postfix) with ESMTPSA id 7E0C0420D8; Wed, 4 Jan 2023 09:37:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=marcan.st; s=default; t=1672825060; bh=rdmw0AAv8JUVqSABjH94DjQUi17V4aIuJjoXwrcyMYw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=cB9pcZPr25EvIeGxKjVqZHlQdUkDe0DMt87brdQs51n36VswtMKLT06WVoYsrWJUU PA9zQke30TKjaDmuT/lHa4ZiPqOy/KTMNnNyjpUbfdM1ecv1JdxdhIjDG6A3Z/PN4o pctFhC6SGPlOUh6rsit/sol6qmJv0oP97jEr9UTp6cb35o+2ymFBoO6Ron0qoiyP2/ p7t+rfdH675btv20WPEU+iUxUvujYi5oha6sc6x3zdgfUnt90SfWDeWbt/yqlmBqaL OE6v1LNYR2730Lrhdu/XlqKfIqdsxq7svw3pIXf5KMKUXGd3tKo/nuQVWop/XKSHyA 5BtWOzosrkMyw== From: Hector Martin To: Mark Brown , Rob Herring , Krzysztof Kozlowski Cc: Tudor Ambarus , linux-spi@vger.kernel.org, devicetree@vger.kernel.org, Janne Grunau , Alyssa Rosenzweig , asahi@lists.linux.dev, linux-kernel@vger.kernel.org, Hector Martin Subject: [PATCH 5/5] spi: Parse hold/inactive CS delay values from the DT Date: Wed, 4 Jan 2023 18:36:31 +0900 Message-Id: <20230104093631.15611-6-marcan@marcan.st> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230104093631.15611-1-marcan@marcan.st> References: <20230104093631.15611-1-marcan@marcan.st> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754084297366841424?= X-GMAIL-MSGID: =?utf-8?q?1754084297366841424?= From: Janne Grunau Now that we support parsing the setup time from the Device Tree, we can also easily support the remaining hold and inactive time delay values. Signed-off-by: Janne Grunau Signed-off-by: Hector Martin --- drivers/spi/spi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 370e4c85dc54..0d84f90ab218 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -2328,6 +2328,8 @@ static int of_spi_parse_dt(struct spi_controller *ctlr, struct spi_device *spi, /* Device CS delays */ of_spi_parse_dt_cs_delay(nc, &spi->cs_setup, "spi-cs-setup-delay-ns"); + of_spi_parse_dt_cs_delay(nc, &spi->cs_hold, "spi-cs-hold-delay-ns"); + of_spi_parse_dt_cs_delay(nc, &spi->cs_inactive, "spi-cs-inactive-delay-ns"); return 0; }