From patchwork Tue Jan 11 10:13:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12709674 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B541BC433F5 for ; Tue, 11 Jan 2022 10:15:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=X37fslc8WByB2DMQurC4gW/mWYbLyPKwO60DXg6A3WA=; b=rjEUQ0rOi25/eh SHkQt0PL7S2dwxq7sCYjScMWtugBCwbW4/BDPXoYu9CMiZTtc1GSXklASsEqSBBxwx8Tr3zEcYc22 37jMuqsZrku5unlgFJ5wHt80YqtWazeY2TCbrA1uRWNo29rypU8+Fp/Fl6vBRoKcZ4PYR2qeBjdW4 wYcoqeSRYqfyAU22zlf790fIosvzCqs/tEH9BgIekv1t7BpoTnxrw6SX6ry4hICwiVVhGMUEe3Lx2 doDAmShimRggcW2obcQ9o/tIHcx61vMpO9pfQ7eAKiFWZEc65W7tUvL+XaL+sIqjsIjcywgO/UosU vdulF6tUOILz4SStisEQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n7EAH-00Fiwv-DV; Tue, 11 Jan 2022 10:14:05 +0000 Received: from smtp-relay-internal-1.canonical.com ([185.125.188.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n7EA4-00FisK-6l for linux-arm-kernel@lists.infradead.org; Tue, 11 Jan 2022 10:13:53 +0000 Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id AB8E140045 for ; Tue, 11 Jan 2022 10:13:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1641896023; bh=QVrXucYojgYJ3MvsfMwPKw5wo2fuH+ML9mi4xwVkLOQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Gq3lptDrM/UFNL9K/3/ZPoRFEhBHvgw1ITCAoyZg4SnJETIO2T1/FyDwqprOXD/Fx 6zzIyZsk/Cgn2u4PV/YlwPm29ifz3M2F9PJEO4148SQU9Taz5x1Rfi312DkzHOVrrm 5wExd6u9BCtdwMVRJ3X/iPAdbfQ9JvCaH2xVR4+L2Xbt/Y87OG1oKc7Q77l221q2yZ Ums6GX+gyFc05V2sYbqIYNcbvzqJUMfR+D3Y69Tvf2LiOWstlsifpfS5LSJM3IOJkS 78PSXHOr5UllMBjS9w/xpcl84wPnZp1z/yq77L4vovd04hbfEG39y9x3fyi+xX+Cey UUJc/IVigvU/Q== Received: by mail-ed1-f72.google.com with SMTP id t1-20020a056402524100b003f8500f6e35so12915658edd.8 for ; Tue, 11 Jan 2022 02:13:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QVrXucYojgYJ3MvsfMwPKw5wo2fuH+ML9mi4xwVkLOQ=; b=vxGo6/vabiIyx58l+KgEkHue6A/SP53xnjx+Q4W+1jzZrAPxi46tafmD7MZ9lUxCnK N2SE57dp7mEWX76JWFO5ZME0tuscDJVQ3xkomQTwBQFUVsShkTQMnd6Bhnox3x195i60 OlOxuGaf0Bz88fDAzQJdmaLBt474sveVeALHdHKUQt+c3Pp3HpsomeY9e9ud9v7ERm/2 ROZi5mse30Du4MNeJ5pzVJbMUJShexwC4uaV1zIHbATuEkBQO3JHLBpUpHzcsYR6SCE8 evAVZg4cYuGH9lCytum/CpoPNanSHFgKKZsJ/z71fGDjqTFxfWSBcOgJII/jjKADO656 xlEA== X-Gm-Message-State: AOAM532ug+ApRnvNzBKWYtzGF4MVFTejuz2cblLuL1IEqnt+PcLTDskr Xn+o83vs0i/itBa1BpUSHjWQAL4m0kAnoon7+5esXXvG/vmN2iQ7mh6XNeqq6LgBzERTGPQVtTE 1/hxY6XFKyCk0MAJhlgRlt03pP+t+J7duGdSRF4FHsPlVUiJyhPDK X-Received: by 2002:aa7:df8f:: with SMTP id b15mr3664558edy.315.1641896022751; Tue, 11 Jan 2022 02:13:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJzpyMwCXUtd7Y6AQyuZuNoCVyccezBv3KC5C5r5rIpS2xwUTuoqjT0UFg4qT8tvTh/Gn938UA== X-Received: by 2002:aa7:df8f:: with SMTP id b15mr3664549edy.315.1641896022625; Tue, 11 Jan 2022 02:13:42 -0800 (PST) Received: from localhost.localdomain (xdsl-188-155-168-84.adslplus.ch. [188.155.168.84]) by smtp.gmail.com with ESMTPSA id 26sm3431268ejk.138.2022.01.11.02.13.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jan 2022 02:13:42 -0800 (PST) From: Krzysztof Kozlowski To: Krzysztof Kozlowski , Andi Shyti , Mark Brown , Rob Herring , Pratyush Yadav , linux-spi@vger.kernel.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Sam Protsenko Subject: [PATCH v2 1/4] ARM: dts: exynos: split dmas into array of phandles in Exynos5250 Date: Tue, 11 Jan 2022 11:13:35 +0100 Message-Id: <20220111101338.58630-2-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220111101338.58630-1-krzysztof.kozlowski@canonical.com> References: <20220111101338.58630-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220111_021352_410524_56BB2B5F X-CRM114-Status: GOOD ( 13.29 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org "dmas" property should be rather an array of phandles, as dtschema points. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Andi Shyti --- arch/arm/boot/dts/exynos5250.dtsi | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi index 139778928b93..102bb57bf704 100644 --- a/arch/arm/boot/dts/exynos5250.dtsi +++ b/arch/arm/boot/dts/exynos5250.dtsi @@ -496,8 +496,7 @@ spi_0: spi@12d20000 { status = "disabled"; reg = <0x12d20000 0x100>; interrupts = ; - dmas = <&pdma0 5 - &pdma0 4>; + dmas = <&pdma0 5>, <&pdma0 4>; dma-names = "tx", "rx"; #address-cells = <1>; #size-cells = <0>; @@ -512,8 +511,7 @@ spi_1: spi@12d30000 { status = "disabled"; reg = <0x12d30000 0x100>; interrupts = ; - dmas = <&pdma1 5 - &pdma1 4>; + dmas = <&pdma1 5>, <&pdma1 4>; dma-names = "tx", "rx"; #address-cells = <1>; #size-cells = <0>; @@ -528,8 +526,7 @@ spi_2: spi@12d40000 { status = "disabled"; reg = <0x12d40000 0x100>; interrupts = ; - dmas = <&pdma0 7 - &pdma0 6>; + dmas = <&pdma0 7>, <&pdma0 6>; dma-names = "tx", "rx"; #address-cells = <1>; #size-cells = <0>; From patchwork Tue Jan 11 10:13:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12709678 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2ED5AC433F5 for ; Tue, 11 Jan 2022 10:15:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=cuCxm9XIA3AUzCoLgzLAwlhTdrCG0GVMvQ/jNIuS2l4=; b=Xia8hxoUmalRcS vo+n77FLjCnCSKIcrhQ0B+rdsrfeKYrfXaOYYmeyseNvsHB1Au1+rPMJLfs3R7OTG5Vt6syZkFTya vFo57bdB0pMCBF04TxGnWgQ3K0sqcrQU9bc6gZdqkXsa3RSkR2VCPE/ExsZQYK5x78cNVk2Z0HFNY 54yd37o/en/nk83HCteeu7bPPEojx66hxgzDFIyTpukBVl8mXCGFZB70Rmp3zhvAOeVBO2aKH44kY NTdbZJzwz7pRWErEkbU4xDPKOEbttbl/U9Kzg4K/ifRptRM2U0tatKsXEJKznJV/WecCDofOd2f8J u20m5TKvEK5tCYnRLwgg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n7EAm-00Fj6D-MA; Tue, 11 Jan 2022 10:14:36 +0000 Received: from smtp-relay-internal-0.canonical.com ([185.125.188.122]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n7EA4-00FisM-7U for linux-arm-kernel@lists.infradead.org; Tue, 11 Jan 2022 10:13:56 +0000 Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 7E6984076E for ; Tue, 11 Jan 2022 10:13:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1641896024; bh=ThvMajJuayiGnhwMDmba8JeXZG0rsrmwNZIGtzPQ/RY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=nFZliJWV3adC2RRlQpUInbI4gfND/IOQ/Ym5r64vUCZKDOrJBBGmuG8Wj2tmbj20R IqgfT+M3NgArUtfbfxoPrxO+FsCNR3XSfZ1TEG0teTYq9PjfsAMf37JGEP6g6CfXLW bTAhWnuacG3c592hODVP69TrgAQ3/wR24XG4YCPeMv7npSJD1Szow4y4nDRteCWAey Sfn26+cA7yBX+wbdMftLPQ999WBTJdQGmVXZzo1ukW1f/AfPLdM7RyBcAFYT9MP8cL 6Zf/tJxARADYRhtQjz6IWwEvN0pDx329apoQoTN7DvhpqqYX4SE2iUMZgMrVepi0qU TeXMyO8yo6yJQ== Received: by mail-ed1-f69.google.com with SMTP id g11-20020a056402090b00b003f8fd1ac475so12875397edz.1 for ; Tue, 11 Jan 2022 02:13:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ThvMajJuayiGnhwMDmba8JeXZG0rsrmwNZIGtzPQ/RY=; b=ne1T03TtfLl0dirPwo6SYskFQeumla5YtpE9eQ6+oUY0paevBMheHYfJ3gDVHKaJhn HvzPzh9pdsFI/td+4zRSd8XD/WSRrbUcF2KRYL+ci5gozJ6OZyOlcZFfkTfqp5Ny8F+j JmpfbbYJpz3B6RmM4d/SxB4R8x7SG4F/kbAd47ZLx5ZblvuR71ZmdyKEbgGXvDiMXa/p kKAfbdzih1PZrHa4RUx/8xEDcNl/gsx5rmIibIQsZMn+7lipW1U0REGYWzxOj3tou6RS +/oJMi4+3v5MpQ5dIwNkXOZx4R2myDFjKt/ETBhlijMWdrt24Ung6N8ifZSasqVKGxCe +BVg== X-Gm-Message-State: AOAM530yXSSPx08eZvbDln/tcYsCgQDw4MHpHmo8SZLRufbi1zDHJnD5 QJlP9SO6iBNYG/XiFDJQsGt9WdK/OnAIMQJKj+Kb4uNULmGoMbvR71GPqD0OBkrLkNvIJ8nbkBe OGynnnFjAoVuhOS10mt7o9f8f/LrallU6xs5dXj4kOwe1dn6Jb/m3 X-Received: by 2002:aa7:d59a:: with SMTP id r26mr3550691edq.199.1641896024005; Tue, 11 Jan 2022 02:13:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJwA97RIXrJ/+ksAAAvr4fwIMKw+83j3EKBrhTEksTeGn0/IAf4kA2jFrVToGwub5YSosbiaFA== X-Received: by 2002:aa7:d59a:: with SMTP id r26mr3550668edq.199.1641896023644; Tue, 11 Jan 2022 02:13:43 -0800 (PST) Received: from localhost.localdomain (xdsl-188-155-168-84.adslplus.ch. [188.155.168.84]) by smtp.gmail.com with ESMTPSA id 26sm3431268ejk.138.2022.01.11.02.13.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jan 2022 02:13:43 -0800 (PST) From: Krzysztof Kozlowski To: Krzysztof Kozlowski , Andi Shyti , Mark Brown , Rob Herring , Pratyush Yadav , linux-spi@vger.kernel.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Sam Protsenko Subject: [PATCH v2 2/4] spi: dt-bindings: samsung: convert to dtschema Date: Tue, 11 Jan 2022 11:13:36 +0100 Message-Id: <20220111101338.58630-3-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220111101338.58630-1-krzysztof.kozlowski@canonical.com> References: <20220111101338.58630-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220111_021352_578737_2CCA00E1 X-CRM114-Status: GOOD ( 32.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Convert the Samsung SoC (S3C24xx, S3C64xx, S5Pv210, Exynos) SPI controller bindings to DT schema format Signed-off-by: Krzysztof Kozlowski Reviewed-by: Sam Protsenko --- .../spi/samsung,spi-peripheral-props.yaml | 35 ++++ .../devicetree/bindings/spi/samsung,spi.yaml | 198 ++++++++++++++++++ .../bindings/spi/spi-peripheral-props.yaml | 1 + .../devicetree/bindings/spi/spi-samsung.txt | 122 ----------- MAINTAINERS | 2 +- 5 files changed, 235 insertions(+), 123 deletions(-) create mode 100644 Documentation/devicetree/bindings/spi/samsung,spi-peripheral-props.yaml create mode 100644 Documentation/devicetree/bindings/spi/samsung,spi.yaml delete mode 100644 Documentation/devicetree/bindings/spi/spi-samsung.txt diff --git a/Documentation/devicetree/bindings/spi/samsung,spi-peripheral-props.yaml b/Documentation/devicetree/bindings/spi/samsung,spi-peripheral-props.yaml new file mode 100644 index 000000000000..aa5a1f48494b --- /dev/null +++ b/Documentation/devicetree/bindings/spi/samsung,spi-peripheral-props.yaml @@ -0,0 +1,35 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/spi/samsung,spi-peripheral-props.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Peripheral-specific properties for Samsung S3C/S5P/Exynos SoC SPI controller + +maintainers: + - Krzysztof Kozlowski + +description: + See spi-peripheral-props.yaml for more info. + +properties: + controller-data: + type: object + additionalProperties: false + + properties: + samsung,spi-feedback-delay: + description: | + The sampling phase shift to be applied on the miso line (to account + for any lag in the miso line). Valid values: + - 0: No phase shift. + - 1: 90 degree phase shift sampling. + - 2: 180 degree phase shift sampling. + - 3: 270 degree phase shift sampling. + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [0, 1, 2, 3] + + required: + - samsung,spi-feedback-delay + +additionalProperties: true diff --git a/Documentation/devicetree/bindings/spi/samsung,spi.yaml b/Documentation/devicetree/bindings/spi/samsung,spi.yaml new file mode 100644 index 000000000000..da4533feb946 --- /dev/null +++ b/Documentation/devicetree/bindings/spi/samsung,spi.yaml @@ -0,0 +1,198 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/spi/samsung,spi.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Samsung S3C/S5P/Exynos SoC SPI controller + +maintainers: + - Krzysztof Kozlowski + +description: + All the SPI controller nodes should be represented in the aliases node using + the following format 'spi{n}' where n is a unique number for the alias. + +properties: + compatible: + oneOf: + - enum: + - samsung,s3c2443-spi # for S3C2443, S3C2416 and S3C2450 + - samsung,s3c6410-spi + - samsung,s5pv210-spi # for S5PV210 and S5PC110 + - samsung,exynos5433-spi + - const: samsung,exynos7-spi + deprecated: true + + clocks: + minItems: 2 + maxItems: 3 + + clock-names: + minItems: 2 + maxItems: 3 + + cs-gpios: true + + dmas: + minItems: 2 + maxItems: 2 + + dma-names: + items: + - const: tx + - const: rx + + interrupts: + maxItems: 1 + + no-cs-readback: + description: + The CS line is disconnected, therefore the device should not operate + based on CS signalling. + type: boolean + + num-cs: + minimum: 1 + maximum: 4 + default: 1 + + samsung,spi-src-clk: + description: + If the spi controller includes a internal clock mux to select the clock + source for the spi bus clock, this property can be used to indicate the + clock to be used for driving the spi bus clock. If not specified, the + clock number 0 is used as default. + $ref: /schemas/types.yaml#/definitions/uint32 + default: 0 + + reg: + maxItems: 1 + +patternProperties: + "^.*@[0-9a-f]+$": + type: object + allOf: + - $ref: spi-peripheral-props.yaml + + required: + - controller-data + + unevaluatedProperties: false + +required: + - compatible + - clocks + - clock-names + - dmas + - dma-names + - interrupts + - reg + +allOf: + - $ref: spi-controller.yaml# + - if: + properties: + compatible: + contains: + const: samsung,exynos5433-spi + then: + properties: + clocks: + minItems: 3 + maxItems: 3 + clock-names: + items: + - const: spi + - enum: + - spi_busclk0 + - spi_busclk1 + - spi_busclk2 + - spi_busclk3 + - const: spi_ioclk + else: + properties: + clocks: + minItems: 2 + maxItems: 2 + clock-names: + items: + - const: spi + - enum: + - spi_busclk0 + - spi_busclk1 + - spi_busclk2 + - spi_busclk3 + +unevaluatedProperties: false + +examples: + - | + #include + #include + #include + #include + + spi@14d30000 { + compatible = "samsung,exynos5433-spi"; + reg = <0x14d30000 0x100>; + interrupts = ; + dmas = <&pdma0 11>, <&pdma0 10>; + dma-names = "tx", "rx"; + #address-cells = <1>; + #size-cells = <0>; + clocks = <&cmu_peric CLK_PCLK_SPI1>, + <&cmu_peric CLK_SCLK_SPI1>, + <&cmu_peric CLK_SCLK_IOCLK_SPI1>; + clock-names = "spi", + "spi_busclk0", + "spi_ioclk"; + samsung,spi-src-clk = <0>; + pinctrl-names = "default"; + pinctrl-0 = <&spi1_bus>; + num-cs = <1>; + + cs-gpios = <&gpd6 3 GPIO_ACTIVE_HIGH>; + + audio-codec@0 { + compatible = "wlf,wm5110"; + reg = <0x0>; + spi-max-frequency = <20000000>; + interrupt-parent = <&gpa0>; + interrupts = <4 IRQ_TYPE_NONE>; + clocks = <&pmu_system_controller 0>, + <&s2mps13_osc S2MPS11_CLK_BT>; + clock-names = "mclk1", "mclk2"; + + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + + wlf,micd-detect-debounce = <300>; + wlf,micd-bias-start-time = <0x1>; + wlf,micd-rate = <0x7>; + wlf,micd-dbtime = <0x2>; + wlf,micd-force-micbias; + wlf,micd-configs = <0x0 1 0>; + wlf,hpdet-channel = <1>; + wlf,gpsw = <0x1>; + wlf,inmode = <2 0 2 0>; + + wlf,reset = <&gpc0 7 GPIO_ACTIVE_HIGH>; + wlf,ldoena = <&gpf0 0 GPIO_ACTIVE_HIGH>; + + /* core supplies */ + AVDD-supply = <&ldo18_reg>; + DBVDD1-supply = <&ldo18_reg>; + CPVDD-supply = <&ldo18_reg>; + DBVDD2-supply = <&ldo18_reg>; + DBVDD3-supply = <&ldo18_reg>; + SPKVDDL-supply = <&ldo18_reg>; + SPKVDDR-supply = <&ldo18_reg>; + + controller-data { + samsung,spi-feedback-delay = <0>; + }; + }; + }; diff --git a/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml b/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml index 5dd209206e88..df885eeb144f 100644 --- a/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml +++ b/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml @@ -85,5 +85,6 @@ properties: # The controller specific properties go here. allOf: - $ref: cdns,qspi-nor-peripheral-props.yaml# + - $ref: samsung,spi-peripheral-props.yaml# additionalProperties: true diff --git a/Documentation/devicetree/bindings/spi/spi-samsung.txt b/Documentation/devicetree/bindings/spi/spi-samsung.txt deleted file mode 100644 index 49028a4f5df1..000000000000 --- a/Documentation/devicetree/bindings/spi/spi-samsung.txt +++ /dev/null @@ -1,122 +0,0 @@ -* Samsung SPI Controller - -The Samsung SPI controller is used to interface with various devices such as flash -and display controllers using the SPI communication interface. - -Required SoC Specific Properties: - -- compatible: should be one of the following. - - samsung,s3c2443-spi: for s3c2443, s3c2416 and s3c2450 platforms - - samsung,s3c6410-spi: for s3c6410 platforms - - samsung,s5pv210-spi: for s5pv210 and s5pc110 platforms - - samsung,exynos5433-spi: for exynos5433 compatible controllers - - samsung,exynos7-spi: for exynos7 platforms - -- reg: physical base address of the controller and length of memory mapped - region. - -- interrupts: The interrupt number to the cpu. The interrupt specifier format - depends on the interrupt controller. - -- dmas : Two or more DMA channel specifiers following the convention outlined - in bindings/dma/dma.txt - -- dma-names: Names for the dma channels. There must be at least one channel - named "tx" for transmit and named "rx" for receive. - -- clocks: specifies the clock IDs provided to the SPI controller; they are - required for interacting with the controller itself, for synchronizing the bus - and as I/O clock (the latter is required by exynos5433 and exynos7). - -- clock-names: string names of the clocks in the 'clocks' property; for all the - the devices the names must be "spi", "spi_busclkN" (where N is determined by - "samsung,spi-src-clk"), while Exynos5433 should specify a third clock - "spi_ioclk" for the I/O clock. - -Required Board Specific Properties: - -- #address-cells: should be 1. -- #size-cells: should be 0. - -Optional Board Specific Properties: - -- samsung,spi-src-clk: If the spi controller includes a internal clock mux to - select the clock source for the spi bus clock, this property can be used to - indicate the clock to be used for driving the spi bus clock. If not specified, - the clock number 0 is used as default. - -- num-cs: Specifies the number of chip select lines supported. If - not specified, the default number of chip select lines is set to 1. - -- cs-gpios: should specify GPIOs used for chipselects (see spi-bus.txt) - -- no-cs-readback: the CS line is disconnected, therefore the device should not - operate based on CS signalling. - -SPI Controller specific data in SPI slave nodes: - -- The spi slave nodes should provide the following information which is required - by the spi controller. - - - samsung,spi-feedback-delay: The sampling phase shift to be applied on the - miso line (to account for any lag in the miso line). The following are the - valid values. - - - 0: No phase shift. - - 1: 90 degree phase shift sampling. - - 2: 180 degree phase shift sampling. - - 3: 270 degree phase shift sampling. - -Aliases: - -- All the SPI controller nodes should be represented in the aliases node using - the following format 'spi{n}' where n is a unique number for the alias. - - -Example: - -- SoC Specific Portion: - - spi_0: spi@12d20000 { - compatible = "samsung,exynos4210-spi"; - reg = <0x12d20000 0x100>; - interrupts = <0 66 0>; - dmas = <&pdma0 5 - &pdma0 4>; - dma-names = "tx", "rx"; - #address-cells = <1>; - #size-cells = <0>; - }; - -- Board Specific Portion: - - spi_0: spi@12d20000 { - #address-cells = <1>; - #size-cells = <0>; - pinctrl-names = "default"; - pinctrl-0 = <&spi0_bus>; - cs-gpios = <&gpa2 5 0>; - - w25q80bw@0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "w25x80"; - reg = <0>; - spi-max-frequency = <10000>; - - controller-data { - samsung,spi-feedback-delay = <0>; - }; - - partition@0 { - label = "U-Boot"; - reg = <0x0 0x40000>; - read-only; - }; - - partition@40000 { - label = "Kernel"; - reg = <0x40000 0xc0000>; - }; - }; - }; diff --git a/MAINTAINERS b/MAINTAINERS index 5ea5655a29c3..1f951bc877f0 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -17054,7 +17054,7 @@ M: Andi Shyti L: linux-spi@vger.kernel.org L: linux-samsung-soc@vger.kernel.org S: Maintained -F: Documentation/devicetree/bindings/spi/spi-samsung.txt +F: Documentation/devicetree/bindings/spi/samsung,spi*.yaml F: drivers/spi/spi-s3c* F: include/linux/platform_data/spi-s3c64xx.h F: include/linux/spi/s3c24xx-fiq.h From patchwork Tue Jan 11 10:13:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12709676 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 35AC6C433EF for ; Tue, 11 Jan 2022 10:15:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=IUkVlZncZtF+VxYUHjfwfrzNAKfNB835kQdLlzRBGyc=; b=jyCWivGNEK8r3X kKyM3PSj8i3gwpvx88T5V6Jpawl/VcmhC0v8jCQ7tyIckXCjBVCkfFJhSCFpt9HUzG4Lia+zQ1psV QzHjPLftYP8cakqgFb48ME6xyP8N3V7Eui6DrDEFkWrkevlJFY9J33udhzT0159CrCZ/OgD3r4siw y++Y+VUq70rtl3MKE3+keiYfdOwVdew6o2bPb6jLJ2MRUUrfpynAfqkzBZr46107eCmmXFWwyqJgE OfE/uuVhTH9Zn08ztQAuRvqvzjV5+S7mXjTSHdAHOp83dx1xhGKfRZbR/UGbvZlWj2dJVic/bykXl 6QfW1a9NUcBNVRK/RsIA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n7EAS-00Fiz7-3f; Tue, 11 Jan 2022 10:14:16 +0000 Received: from smtp-relay-internal-1.canonical.com ([185.125.188.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n7EA4-00FisN-7n for linux-arm-kernel@lists.infradead.org; Tue, 11 Jan 2022 10:13:55 +0000 Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 8859240029 for ; Tue, 11 Jan 2022 10:13:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1641896026; bh=BJcC+0E6Y2y3qsaMlSAjaaYN+3MxC8IRY4wxOhHEIbc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Jk6obyhns8VIX74aukat8xkwB0vl3cFxu5HHhQkHEv4HrgG9sEdpt07MW4rV0fCfT B8upXaCXqGsBnDfk3iNOgdW1LnxbEQhQWAC5HQH342ANG3rwNP/pM9TJnnANsN3aFu JiPsUb3J/unQ+7vn5ehpYMgc0nlh3nRbDdzQYDYxzw+r/akuX/LLsa5N2DwAd61GaX rpYW4Ofx8+QfZopE+LWyEl5k458J2QycmlMUKGKnUWsd95p/Mvcm/D7Sop1oACNW1a LbCoLf5SzlOyh1GuImYvxp97M6DS0x0VInrjEzAFcA3TtOfT3Sv1baAUcE6CLa+i4c 5pQ03gKaLXsuA== Received: by mail-ed1-f70.google.com with SMTP id z9-20020a05640240c900b003fea688a17eso1927410edb.10 for ; Tue, 11 Jan 2022 02:13:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BJcC+0E6Y2y3qsaMlSAjaaYN+3MxC8IRY4wxOhHEIbc=; b=m7o91Hkl9JY7o7jV2F6CjhEe2R5XhU7gsAON/vLsON3CK4ik4flz376AosffJUUyNm zZYVj8VJWMcfdTINUti5zf9MjD098nnftqqbKUyW176i0CC7bRpdaLmeEdD1SqPnKsU2 v6HtkDkUISwoxkz8MQ73SFqgXN0W7zrsAV6OMrYxI4GcgFcM4E2YbVnt4ZR1Pg7FypnO jtzn7ANNXlzisj/LCFU+Lfc7A9EFIaOyuyjLN/SUlY3osnYP+6Jjpe2+Jkmw3kVLcXri xhHZRQbKe0jbb1Rp6G2OsSLi0yLt3o98rS+3Atm6TgCHufoffm7GTYBDh9HeelgOhh+M jvqQ== X-Gm-Message-State: AOAM530iZydLU02dYZVxeAlKRQUAbq5HlALxz8YcHnLWKwy9GSs8+F7G EyDIaNBYcaoa83lFE7mb8+M2yuTkPYwBXpGLsRVThM664iomdX2Ffn4cJJQiLrzT/MH4eN08555 XUw0CMfal5+M5PXv+JvP5HQWLH4Pn/Jvtxer6jEBezDu7TkFc5R9R X-Received: by 2002:a17:907:728c:: with SMTP id dt12mr3244361ejc.188.1641896025435; Tue, 11 Jan 2022 02:13:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJzRZEoQ5u1bGZQZJNook5L4lY9BkzKhKOYtLcERafkQAKIt2Tq7bk74PNAyjv+BJ4TXFGswLg== X-Received: by 2002:a17:907:728c:: with SMTP id dt12mr3244340ejc.188.1641896025195; Tue, 11 Jan 2022 02:13:45 -0800 (PST) Received: from localhost.localdomain (xdsl-188-155-168-84.adslplus.ch. [188.155.168.84]) by smtp.gmail.com with ESMTPSA id 26sm3431268ejk.138.2022.01.11.02.13.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jan 2022 02:13:44 -0800 (PST) From: Krzysztof Kozlowski To: Krzysztof Kozlowski , Andi Shyti , Mark Brown , Rob Herring , Pratyush Yadav , linux-spi@vger.kernel.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Sam Protsenko , Rob Herring Subject: [PATCH v2 3/4] spi: dt-bindings: samsung: allow controller-data to be optional Date: Tue, 11 Jan 2022 11:13:37 +0100 Message-Id: <20220111101338.58630-4-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220111101338.58630-1-krzysztof.kozlowski@canonical.com> References: <20220111101338.58630-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220111_021352_436479_6F79D14D X-CRM114-Status: GOOD ( 13.33 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The Samsung SoC SPI bindings requires to provide controller-data node for each of SPI peripheral device nodes. Make this controller-data node optional, so DTS could be simpler. Suggested-by: Rob Herring Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Reviewed-by: Sam Protsenko --- .../devicetree/bindings/spi/samsung,spi-peripheral-props.yaml | 1 + Documentation/devicetree/bindings/spi/samsung,spi.yaml | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/spi/samsung,spi-peripheral-props.yaml b/Documentation/devicetree/bindings/spi/samsung,spi-peripheral-props.yaml index aa5a1f48494b..cadc8a5f061f 100644 --- a/Documentation/devicetree/bindings/spi/samsung,spi-peripheral-props.yaml +++ b/Documentation/devicetree/bindings/spi/samsung,spi-peripheral-props.yaml @@ -28,6 +28,7 @@ properties: - 3: 270 degree phase shift sampling. $ref: /schemas/types.yaml#/definitions/uint32 enum: [0, 1, 2, 3] + default: 0 required: - samsung,spi-feedback-delay diff --git a/Documentation/devicetree/bindings/spi/samsung,spi.yaml b/Documentation/devicetree/bindings/spi/samsung,spi.yaml index da4533feb946..322558818a43 100644 --- a/Documentation/devicetree/bindings/spi/samsung,spi.yaml +++ b/Documentation/devicetree/bindings/spi/samsung,spi.yaml @@ -75,9 +75,6 @@ patternProperties: allOf: - $ref: spi-peripheral-props.yaml - required: - - controller-data - unevaluatedProperties: false required: From patchwork Tue Jan 11 10:13:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12709677 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DA073C433F5 for ; Tue, 11 Jan 2022 10:15:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=XRJsyp8OhYco2BLG/fpa28HHa5uCB/VDgSkYUGOUf8Q=; b=G4AksQt5WqOaN/ zrCSaA4TMCIUuHy468HChufW3iENzK7FQqi68AcG442u9tCw8uw+NA98Sb3H+0IV2CAmxGB7VNjZo 2nzbidzYpvZw5WuNhWddN/mceETiXOvVVfo+TxHJsL8SgIqjg78+m5sdqKX1RjjL/Myc3FvG6ebvU ikMIx3wgXvW/nFJv8L489oiP4I3VZQAbBUNKQIFy4yfrEK/ylHjIkGsKwX9xClYqTx/BZPTbTIVki GWr+DP02PLr78KLL249+yVLF6ZxnJM6UF1U8RDVhowIBnxFymDNgplrSvb5CaHU3nwCxYh00KLNiH ClF8+JoJpVe70BPFrv8Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n7EAc-00Fj2v-5t; Tue, 11 Jan 2022 10:14:26 +0000 Received: from smtp-relay-internal-1.canonical.com ([185.125.188.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n7EA4-00FisJ-7o for linux-arm-kernel@lists.infradead.org; Tue, 11 Jan 2022 10:13:55 +0000 Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 094C64004C for ; Tue, 11 Jan 2022 10:13:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1641896027; bh=vkZ3shAsrts82aZQTD9Odzm7oGr7rqF0WKQDjTKTwd8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=AsSy6TnxbEX9P9XkYo75tUEdzUi/QNUnxZtzQQaEXG6LEu4gKkiGy4eVjmoLUcapY 6WhAAT6NaSssf2deKGqTP5U5jZYXk7hhw+U/cJS+iv0P+ORut60tC8iyd9b5uapSPx kVWatiiAuxpf2eDOocJu1vVSgr6/QMbI4b9BkHbdOTPdWLB9QdvQR4T2ljnq+hHq9T y5UOgs9lYQmmXx/3HWNlKNS6WOSjr84AFsVabhwUoHQS1AkBkX1MDXWF83j6I+e+fW ocYfMXcQcrWTUjQb/Dn1WtERIg3u2lBlYQTU/ZmKWTLIy90/yagUddaoF1XJH3iLbE Lt5i00s/sOUXQ== Received: by mail-ed1-f72.google.com with SMTP id b8-20020a056402350800b003f8f42a883dso12849042edd.16 for ; Tue, 11 Jan 2022 02:13:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vkZ3shAsrts82aZQTD9Odzm7oGr7rqF0WKQDjTKTwd8=; b=7KGPm4P3AlHfsC5YHsiHDNqzGScaxPQjXtmg+4lr4cT7WZA3jYj2aUlxrN2CUogYhO wCgtDxxbQnxnksJNjkkkYKUPmpuu++AuLQVktI/gRlLSG10CaFdtLfr+Kc2sZEBI19I8 cOv9pi1NqvQWAkJ5VoiHgL5OqQkedIy+IOCehQ0obmPkl2dF9qS781EGf06tYsL+3NkC Di+Hwvr1XZN2cDsy6YtiOfUk5tRzcXufIZTKHgORQ/GA7Mq1+/CR5wOUMWZRDrBQpdKY ECBbYhWm9W7N2/SzTbDsAAuPmB2AYK7T2Y3oK8XY+Sz7P3vDtV76cd21gMX+xSc/x417 Z+Ng== X-Gm-Message-State: AOAM5339b4WjforRjFlp+VFiB6ERdoXZ34ezOrnV8q8mi9rJeypX1j8H P87pfu+dszS2U8os+FX30xvVbcs+mpyqWTDNr70RRvRAJGtAPFBoS8Qc2r9s/AaWTMdGDC/sH2g 9QZhmz35d8XpPfbbGeBu9dlsZ6SEM0RbtxjmHr4fj0IpU47cQlmyn X-Received: by 2002:a50:da48:: with SMTP id a8mr3517610edk.155.1641896026737; Tue, 11 Jan 2022 02:13:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJyrMWwC4F5CYCPwNtrsTc93H/KSEUuKQ3dZ2KWyqGsikQRFJIiGNhQmyHnezI5HUpc6kJMojw== X-Received: by 2002:a50:da48:: with SMTP id a8mr3517597edk.155.1641896026571; Tue, 11 Jan 2022 02:13:46 -0800 (PST) Received: from localhost.localdomain (xdsl-188-155-168-84.adslplus.ch. [188.155.168.84]) by smtp.gmail.com with ESMTPSA id 26sm3431268ejk.138.2022.01.11.02.13.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jan 2022 02:13:46 -0800 (PST) From: Krzysztof Kozlowski To: Krzysztof Kozlowski , Andi Shyti , Mark Brown , Rob Herring , Pratyush Yadav , linux-spi@vger.kernel.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Sam Protsenko , Rob Herring Subject: [PATCH v2 4/4] spi: s3c64xx: allow controller-data to be optional Date: Tue, 11 Jan 2022 11:13:38 +0100 Message-Id: <20220111101338.58630-5-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220111101338.58630-1-krzysztof.kozlowski@canonical.com> References: <20220111101338.58630-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220111_021352_442793_39CA3FC3 X-CRM114-Status: GOOD ( 14.28 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The Samsung SoC SPI driver requires to provide controller-data node for each of SPI peripheral device nodes. Make this controller-data node optional, so DTS could be simpler. Suggested-by: Rob Herring Signed-off-by: Krzysztof Kozlowski --- drivers/spi/spi-s3c64xx.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 8755cd85e83c..769d958a2f86 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -796,16 +796,14 @@ static struct s3c64xx_spi_csinfo *s3c64xx_get_slave_ctrldata( return ERR_PTR(-EINVAL); } - data_np = of_get_child_by_name(slave_np, "controller-data"); - if (!data_np) { - dev_err(&spi->dev, "child node 'controller-data' not found\n"); - return ERR_PTR(-EINVAL); - } - cs = kzalloc(sizeof(*cs), GFP_KERNEL); - if (!cs) { - of_node_put(data_np); + if (!cs) return ERR_PTR(-ENOMEM); + + data_np = of_get_child_by_name(slave_np, "controller-data"); + if (!data_np) { + dev_info(&spi->dev, "child node 'controller-data' not found, using defaults\n"); + return cs; } of_property_read_u32(data_np, "samsung,spi-feedback-delay", &fb_delay);