From patchwork Fri Jan 13 10:23:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hector Martin X-Patchwork-Id: 43135 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp192534wrt; Fri, 13 Jan 2023 02:30:10 -0800 (PST) X-Google-Smtp-Source: AMrXdXtrBvzPEghUtIb5KGFHrEpNIM14ROTG3+ca/7T0Hdw/NA6eVjpn6Lc6lqAsQBhHKqKt3ypv X-Received: by 2002:aa7:87d0:0:b0:57e:c106:d50c with SMTP id i16-20020aa787d0000000b0057ec106d50cmr10294325pfo.17.1673605809943; Fri, 13 Jan 2023 02:30:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673605809; cv=none; d=google.com; s=arc-20160816; b=vPG8cJqW4LW+VesiCNCD6uD0OiAH6/kWGe8fDfKg0tMIOAKJ+reQ8VpR3mE+X97ZkY YrPOEgdx3eEpZfWS64U1fj5fzP15ly+ZGPFj5BOrgqRWbdeqbX81AC3k+YzV2mHFXBf4 4+URzSnTz2+SREzTrCXEoGSIY1MveRnyu2Xi70/JK/h/eqVY8WuHyYbCTkd8Nd9PwXv+ //qRVZgAPdLf0WtwmwvM99Ma1yjvfIbtqNo3swhLEmzmZ+51kJltuMkgaYtIuzVkjwfs dWufRH25XARpG9fD6bdYaMXYpdJ52qRbTvL2F6ZBMjLv2qTVoNXs6k5D/w/C56EP/1Xl sI+A== 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=/ODg8EyI7EFcETO2kZk6FCcdtnRoSX0iPv1XfqGNNRo=; b=zjTCZkzTp8CFKEJdnydiJfgSRIEzW4iooUyQfykGR9nYSd5vUO0lTprLGxeV3E4ijA MPu9JWK7llcTfBoMvWUV4HOq2vLiBc/+e1UxJwamSgPRDrwYzFdP9L9lpwNJN7EmIirr 6cw4p80iyaPto5K5DNmllbRhlH4BSDSDySEaHIT6j1hO0ALRz75FQ4OYYB/wM4s0z1Qh rqYWUdqHkc374uUKMumn/b3NiRpZ1YoIlY7impvYNpmNBxAinnej2mFbNDc/O5CyN8G3 NINRivSHIFQ6qVKYEdoZqHjmAMnr5Nb3REabumWdXIgUege4GFu/STJmWbha+gK3pjJJ 6bLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marcan.st header.s=default header.b=n7zJ2YyR; 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 h3-20020a056a00170300b0056d789ba707si21760039pfc.294.2023.01.13.02.29.57; Fri, 13 Jan 2023 02:30:09 -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=n7zJ2YyR; 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 S240935AbjAMKYG (ORCPT + 99 others); Fri, 13 Jan 2023 05:24:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241125AbjAMKXe (ORCPT ); Fri, 13 Jan 2023 05:23:34 -0500 Received: from mail.marcansoft.com (marcansoft.com [212.63.210.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07C095F5E; Fri, 13 Jan 2023 02:23: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 8E63B4206F; Fri, 13 Jan 2023 10:23:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=marcan.st; s=default; t=1673605412; bh=c4zDn0WsX9vKD9/T+0pbZ4hUgI1frFckuoNzd/1iP5Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=n7zJ2YyRvs+dpSlx1IN05ugU0M7nsDpfdKXXY6aPy8xi9FPg0iViM+Z/TxZxhqJBW liFzKSpAht3GuYcmh2FcrvaP5c7uOUvxw46GTnWjxSWDShILeTEQEy9s6mvLx0mfgX vQINtu0OhMja720uWNW3wfnXIbl0H4JIgGs9TNF6Yo31Cb6HipQQlLNMpC5XEBfml3 JTDypjBgDOgLWhUqzSI/ETk920CpYmOdthRQajOz4HN6Ux5eynaOmIOc8Fp7EG1+Gz NBYQ2BKLsIWwsFVQkZfHmDK9H9Rd6BmduEWi1ot1zE08fcGXMlaLXD5wHGiMEWZzdZ +mTEBCUyOcnlg== From: Hector Martin To: Mark Brown Cc: Rob Herring , Krzysztof Kozlowski , 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 v2 1/3] spi: Use a 32-bit DT property for spi-cs-setup-delay-ns Date: Fri, 13 Jan 2023 19:23:08 +0900 Message-Id: <20230113102309.18308-2-marcan@marcan.st> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230113102309.18308-1-marcan@marcan.st> References: <20230113102309.18308-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?1754902885963537791?= X-GMAIL-MSGID: =?utf-8?q?1754902885963537791?= 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 | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 15f174f4e056..3f33934f5429 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -2220,11 +2220,26 @@ 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) { u32 value; - u16 cs_setup; int rc; /* Mode (clock phase/polarity/etc.) */ @@ -2310,10 +2325,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 Fri Jan 13 10:23:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hector Martin X-Patchwork-Id: 43136 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp193051wrt; Fri, 13 Jan 2023 02:31:43 -0800 (PST) X-Google-Smtp-Source: AMrXdXvWh6C8YzcIUiW/HlReZZSPOjtTLqr/kxyzIJ2POo5C0RC/k/vZBq45bm0akyfWbT5KZGGZ X-Received: by 2002:a17:907:a702:b0:84d:3403:f4f2 with SMTP id vw2-20020a170907a70200b0084d3403f4f2mr24403332ejc.62.1673605903013; Fri, 13 Jan 2023 02:31:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673605902; cv=none; d=google.com; s=arc-20160816; b=kyJ71YHAjjTKrlrcK5lCg0ABpl8z4ZuMeQWD0Z0A7BElHCWF28WOtMW4iS9W44KuVM l2LJUX67fm9gAXhILeBgswv5/xYAr8CDHb0f1jnuTi1oTPtr3RwJ4uhQVLzorro8rNDK YnTLtl4NoZS3wMV1bRBXFuzMqXjkybeSVZV+rKgTwj6tpyPAVvUSawJaIfd0mItt/Xtp Dzz7M6BLwCMFrvSerzSvJ6IzU21S34eA3jMusXGm7C6kCAg8f9Egu5ACX5sjF1a0kIHs y7RyJmN1LSwQGAO5JOv4xh7ikLeUYeia0EZoA4vPEnungroPtP2kP9gbzH9gZQXhtfDm EIXw== 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=ZgCe5wRBqRLQtt5STOF/L8qWMC/SbVlq29FpodkIVw4=; b=RQ29rdo2FYQfe5CVmWX5BXZbFQ+cGoB7PwriwfoHXUb727tnRmHOo29SpmG1aXtjE3 VPM/ZcuMdgaJlT8KUCI6SgHSMs2wxJJKy53GttoSlQ/tFzN4FnOinRPT6VqjgJSIXw9c xMoycmnka2GQluUYDIHNZmFgot6YXdEJseb7RPO7W8xvyDY0+1YzvIlsfXvcOfkkhhml RhC6t2fiZsHx2sUAjG7VT0D5Q2ymR5eypzqZw/a/uowYYj8+HYaE6BhJI7eP9ZXCzhls UTNpZVGsx/T7YolR+6SB/ng3s+GZdv+ccX9sLxYoEjCS3rnlETq5nKcTvd511UhQ/eUX KeHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marcan.st header.s=default header.b=xoflWglI; 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 hd9-20020a170907968900b0086a76383bcdsi1940617ejc.130.2023.01.13.02.31.16; Fri, 13 Jan 2023 02:31:42 -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=xoflWglI; 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 S241175AbjAMKYS (ORCPT + 99 others); Fri, 13 Jan 2023 05:24:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241172AbjAMKXi (ORCPT ); Fri, 13 Jan 2023 05:23:38 -0500 Received: from mail.marcansoft.com (marcansoft.com [212.63.210.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0EE2BC0F; Fri, 13 Jan 2023 02:23:37 -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 2D09D4258A; Fri, 13 Jan 2023 10:23:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=marcan.st; s=default; t=1673605416; bh=M3tZrYZnQ0FBU0rxzLvbqjtCSW4bNvZXYV5NUHuboTk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=xoflWglINJt2Kww6POJDVwvtrmzEH4a7tuJzKq+dTzqd5irvgP1Exj3UZ9TOAPLHj Jo9GbMSlw4pmdP335FEAWSGBaYmN81gsITgcorIbKPwW32uXmLbs8x8lc2YJTqWp1q 1yXxZkgs+AHxN67mmI7xs1zqw5NxTpAaTKrqtDKo9tsJCuEMAtskUmJ8DhAGqwaUTB MoeuvEbtYnro6hp4nuqzlwVvP2gRKLpu5GIp07cgrhlfB+K46FCNHYpus3uqgrh2Vl fW2BzoBy0+8hGZPP8SIAmC6cbHWEvdIKTOwKDMfjumS1r+Tj15QC7SltWowsx/PO62 FgK6uSuqSK4Hg== From: Hector Martin To: Mark Brown Cc: Rob Herring , Krzysztof Kozlowski , Tudor Ambarus , linux-spi@vger.kernel.org, devicetree@vger.kernel.org, Janne Grunau , Alyssa Rosenzweig , asahi@lists.linux.dev, linux-kernel@vger.kernel.org, Rob Herring , Hector Martin Subject: [PATCH v2 2/3] spi: dt-bindings: Add hold/inactive CS delay peripheral properties Date: Fri, 13 Jan 2023 19:23:09 +0900 Message-Id: <20230113102309.18308-3-marcan@marcan.st> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230113102309.18308-1-marcan@marcan.st> References: <20230113102309.18308-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?1754902983316191041?= X-GMAIL-MSGID: =?utf-8?q?1754902983316191041?= 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 Reviewed-by: Rob Herring Signed-off-by: Hector Martin --- .../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 Fri Jan 13 10:23:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hector Martin X-Patchwork-Id: 43137 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp193886wrt; Fri, 13 Jan 2023 02:34:19 -0800 (PST) X-Google-Smtp-Source: AMrXdXtYZWnDxoiyBb2jcJ+A2i3jxqXuGEVt4wK3b8STEwdeZYa3AfmBfZAC18QstaUXxIySVFx0 X-Received: by 2002:a17:906:850c:b0:7c0:f4f8:582a with SMTP id i12-20020a170906850c00b007c0f4f8582amr73329304ejx.52.1673606059440; Fri, 13 Jan 2023 02:34:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673606059; cv=none; d=google.com; s=arc-20160816; b=BCWju+ErkXZLhPGGbnDLfMmSbj9ICy/XgWoqHdiE6NoykrUAOB0ZWRdXNrlmOrP36t 6w48HX7pZrHHhlxvd/TxFmq4EKe4kgYB/q8XBeNizoBpWNUYdBYq6zj8zucs/6tPdXTL Cya+RHUfMeo2obQF6UHnOvBnQmRpa0KUHlcL3Jx1Ait0/fJQ1ni8fSKx/DLBjjASiOR1 cFhtzdOSntN92ybFmHp36Yy0bX2YY4KsHT0pAskUXEu+6AZlrKo5CBFp2VkucnlPqM0v /ND0R+p33NFefWKV+J+j9yeW22F7LhXFs691yrEsW9HXUtnMp2nT0asIoPZrc9Dlkivf 6xWg== 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=LRfG0MU82xMg886XJF1KQ7xCIYd0rOmitNg4bSUw954=; b=pV7U1U3zhzJkLw1eihMArlW02WP8IML+TfpQ3LkwdZiuB3tLE1OBX8B744V2JIC9at N38srhiMN81EwjB5INs1xmiQXRJa7CDuSCRNB59dl+IDdVTMDMPoQCd5anYOhRc+FJu9 CRcpmM22C/9fIT4mofuLvu7cTeN4PQMSmwmqD5HBZCOLHscwrOW7Xo7u+Z5jKL9pMqX6 C1fAcZlsiZ4XWOLAxU1WVac6mBDwyMOyI2Lp2Q/HWKHx320oRMFIdMi7Yygb0zr+BNSn WgO5UhwBwpPEJqk3iXYsiFS5JO1y3KIgWij3zvX9oNr65EygKXfragaykfn+lBX/uNra q1Iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marcan.st header.s=default header.b=YZrgvujq; 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 g13-20020a1709065d0d00b008674de1b5c6si4507652ejt.924.2023.01.13.02.33.55; Fri, 13 Jan 2023 02:34:19 -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=YZrgvujq; 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 S241258AbjAMKYV (ORCPT + 99 others); Fri, 13 Jan 2023 05:24:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241198AbjAMKXm (ORCPT ); Fri, 13 Jan 2023 05:23:42 -0500 Received: from mail.marcansoft.com (marcansoft.com [212.63.210.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78CF2DEA9; Fri, 13 Jan 2023 02:23: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 0606E42597; Fri, 13 Jan 2023 10:23:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=marcan.st; s=default; t=1673605420; bh=fxnUPxMQfOKf9QNHPBDaDANUADvv1JFN7DwbvKgCdNs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=YZrgvujqp8be2tc3lP2yhiK7xnACtPrFKRW8NFtP3GuVfQ+IPnZsmzqk0sqY7arBi 4xLm1P09TugAtLEe27leiv7gMugA+o0x7omi1CYVz4k6khlFEwheC+iVn1oms1/V1f 69Z0RgW5z+VG40bjNBsNKl9ocrLzjjByhPlDGqipwGs6QqZP8Gqfir29ikEy2wcOFB 8WtWpqmf8hWe4GiKOWrlEnjUKB0PSoZmQKXzSeqTfplqg7li1LooPURQVoaOSvu+kO TAXpDL9qllak0WN5i2rdy96JCdXTEB2ZDt7zYJDBWIgegCVubpqhv98Br4ew/7Sluu 9sXSwo+3WWSGA== From: Hector Martin To: Mark Brown Cc: Rob Herring , Krzysztof Kozlowski , 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 v2 3/3] spi: Parse hold/inactive CS delay values from the DT Date: Fri, 13 Jan 2023 19:23:10 +0900 Message-Id: <20230113102309.18308-4-marcan@marcan.st> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230113102309.18308-1-marcan@marcan.st> References: <20230113102309.18308-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?1754903147131453131?= X-GMAIL-MSGID: =?utf-8?q?1754903147131453131?= 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 3f33934f5429..fc4f6308efd8 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -2327,6 +2327,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; }