From patchwork Sun Aug 11 18:17:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 818681 Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D17BC15854B for ; Sun, 11 Aug 2024 18:17:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723400245; cv=none; b=YGluHn2YBe+G1wy+UHVAN08RTCNMfRWRpjlHyGJj5XypkL5UQNBsNDfu0IcBiBqmJ/9cQj/ekjQgKNCDs6cEOmJSD086Z6PbvNQ5KlblKkZAcoK7plUdMjg8wp19R50Ayuqeu3IPcz3R3KEatLvTdj7C1BkKpuZ201nHR841SHk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723400245; c=relaxed/simple; bh=fCBvR5l2kfQnmClu3hY5hsw9S1f2r9uHvUNX7tLyV3A=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=S3JawdViCM4z36uaFTMu7/N3T23GOHHB5z6+TaarrrhW1BinfWP2lXB24RLyy5z3tn19t9M+tmZyhwrikAivPQcZdRJY+dV7VxseJ0gjJghPpBrlV3Jr8kI5eJhg76/fUu3D9hrL42Oif5cIULk6iUcF1QrW874X2xzGrN94U7Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=x/IQgbUK; arc=none smtp.client-ip=209.85.208.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="x/IQgbUK" Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-5b8c2a61386so4331070a12.2 for ; Sun, 11 Aug 2024 11:17:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723400242; x=1724005042; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=w+nOiSZVTAGXNGH6eneUy74cyMDNkjNt6P9eyPr5+K8=; b=x/IQgbUKazj7fLz2dhV4HTTqjtTr9ufLyIaNSwec+cBkubwBvRR4WAJ011aC0ClEkh wwf5ybFPYS5E9NnHIp/wmcAIuv0AQwJIsl9fM1ixIPPv257APkKM1h24JlH+5baV8qtW Wbna4HrmLuY1mK1fBDl6mkh9G+acihwZBgb440Wz1n6yVzt1zz/VZt4j7QrRXDuOGcIx If2GPuetaRBF8b5X2GIkTkhq1dYHYW+pzJr8BiYPQjrdwj3qexba65+Ax1SaW+3XELN3 ApNO7YuvDr/PxRK19Stmo9e/OaD5YxDZRwQ81O4E1KRhEvgiLR5MwcCkD0qiFB4JHiBJ t9zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723400242; x=1724005042; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=w+nOiSZVTAGXNGH6eneUy74cyMDNkjNt6P9eyPr5+K8=; b=JhfBSWkO921Z86AqEoSrjd/B3KuvmqAQNuiUFZrt4DkHqeBNYnk/4Q2hbYTPVcComx FF77koGyKqCdf55Jp6i+DzaMf4UJFZiExHRsNQB3NTh/xzunQxPR4X+ji/72115xE9xv CUd0TLuMQfQhJL3x1gZMnZAu2ZhtV6T+VTCDEMj/tItHRNJm5/6FA/uuHgYYFe6SzyK9 dyfRG01GcBOUJ47iDh0W9VuaZ+sSKt5oDCR0C7tg0ms6tMGnc1kw7oaNlJF6ol/TGQce Aii3lPBKiy46w/BPJYOCG1zEggIl00h3ZaiaOycDhvfABEMg4iz/cRF2YHioFQbBW/xh t9/A== X-Forwarded-Encrypted: i=1; AJvYcCXOlN2r51bu92/JxLgjWzu8pQ6SJv3MOjwHSm/O0EopSOTkZhNicyedUI+X+apQEXOgxKrGrY12QmcILTDx1yAERRCTeeYUzERu2E26AXI+ X-Gm-Message-State: AOJu0Yxi95i1aTniD3XFWVKwlObYpa2WUhnRqdcjAy8n1beUVLY5fAW+ 7E9tZKptevdM+eIKxLe/K+8i0MCIc3dBBJo2B+5/wDjMGdmQDxEvGLP6Ml/EwJ0= X-Google-Smtp-Source: AGHT+IE4wd/lzE9MdP0YQr2O7QtAWAX9rdSp6E7hYtxz3L9YKcOJCmCuv9Yp3oMvUw/jaUEBy1XhwQ== X-Received: by 2002:a05:6402:40d4:b0:5a3:8c9:3c1d with SMTP id 4fb4d7f45d1cf-5bd0a598365mr4773119a12.14.1723400241969; Sun, 11 Aug 2024 11:17:21 -0700 (PDT) Received: from [127.0.1.1] ([178.197.219.137]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5bd1a6032c1sm1610593a12.92.2024.08.11.11.17.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Aug 2024 11:17:21 -0700 (PDT) From: Krzysztof Kozlowski Date: Sun, 11 Aug 2024 20:17:05 +0200 Subject: [PATCH 2/6] dt-bindings: serial: add common properties schema for UART children Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240811-dt-bindings-serial-peripheral-props-v1-2-1dba258b7492@linaro.org> References: <20240811-dt-bindings-serial-peripheral-props-v1-0-1dba258b7492@linaro.org> In-Reply-To: <20240811-dt-bindings-serial-peripheral-props-v1-0-1dba258b7492@linaro.org> To: Rob Herring , Greg Kroah-Hartman , Jiri Slaby , Krzysztof Kozlowski , Conor Dooley , Marcel Holtmann , Luiz Augusto von Dentz , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Linus Walleij , Johan Hovold , Liam Girdwood , Mark Brown , Daniel Kaehn Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-sound@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=4392; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=fCBvR5l2kfQnmClu3hY5hsw9S1f2r9uHvUNX7tLyV3A=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBmuQAoN9Yt8uNW6oM1DQmDpVszXdEiFyOz3K0sA EqCIJvkLqKJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZrkAKAAKCRDBN2bmhouD 1yCPD/9U+1jRz1m9m7eSRZa9w5LcjzvIpO5u0gAUYN2i7+4oSzeapPYO1x3GLVZXs+CNtSqnGsa CVg8HZ3UA5a2m/BeSUdEYBEIBVAF2hiQMop7GNFrAh/i4ci0knu/KnN8OhbFoEAgQFDh4r9ssvT 9b7riBq5tjmjBJlKOOEGFSjdxyutpeR0nS/h56HFwHEPJ0p0QagC9u9PGUtQ7r4bHHl5Lod1Ifp 4Q4n6xQlYvEp2/B8I+elkuoJX6xcPMK7OA7JuhtiLmyxD6yrlx3KGt5LuFOxZuFNW44Vulk0f13 030ZkZqEnSMeYzOIxNLO6gKBYScLItTPL6bVll9dCm6p0aHOF6NSqZ2I2JZ2pDh36j3S93As6/J j2xkLjLf4UtuQsJLE7ff4XvgN4WOf7jGvh9em4o+X5tMOm3kXQY1r9tXg1L7ChySOd3Rm6Eb1s3 /1MNOq9SdUoQkxEEEO7aYSceeyYVrydUothpc1cai6L38N8ebsNym42PeKhzLUVv9Gwjuw374ez RJNHdgRRD2obRNRIlm5dksIrJYR0zBl5BwQ0Pq0JrUS0SYBC8Hq6CVgbgaB4NOaAT6L0n+/hBl1 PztglQZlN6QhDSheKlYJ+kl5JR/mAxi2Q1TlFIzySPqSQsE48lMkRheqw9IZiutKMXQK81xF16r 1VCwrDNITQCU+jQ== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B Properties should be defined in only one place, thus add new serial-peripheral-props.yaml schema with definition of common properties for UART-connected devices (children of UART controller): current-speed and max-speed. The schema can be referenced by individual devices using these properties. Signed-off-by: Krzysztof Kozlowski --- This patch should probably go via Rob's Devicetree tree. This is the dependency for all further patches. --- .../bindings/serial/serial-peripheral-props.yaml | 41 ++++++++++++++++++++++ .../devicetree/bindings/serial/serial.yaml | 23 +----------- 2 files changed, 42 insertions(+), 22 deletions(-) diff --git a/Documentation/devicetree/bindings/serial/serial-peripheral-props.yaml b/Documentation/devicetree/bindings/serial/serial-peripheral-props.yaml new file mode 100644 index 000000000000..b4a73214d20d --- /dev/null +++ b/Documentation/devicetree/bindings/serial/serial-peripheral-props.yaml @@ -0,0 +1,41 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/serial/serial-peripheral-props.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Common Properties for Serial-attached Devices + +maintainers: + - Rob Herring + - Greg Kroah-Hartman + +description: + Devices connected over serial/UART, expressed as children of a serial + controller, might need similar properties, e.g. for configuring the baud + rate. + +properties: + max-speed: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + The maximum baud rate the device operates at. + This should only be present if the maximum is less than the slave + device can support. For example, a particular board has some + signal quality issue or the host processor can't support higher + baud rates. + + current-speed: + $ref: /schemas/types.yaml#/definitions/uint32 + description: | + The current baud rate the device operates at. + This should only be present in case a driver has no chance to know + the baud rate of the slave device. + Examples: + * device supports auto-baud + * the rate is setup by a bootloader and there is no way to reset + the device + * device baud rate is configured by its firmware but there is no + way to request the actual settings + +additionalProperties: true diff --git a/Documentation/devicetree/bindings/serial/serial.yaml b/Documentation/devicetree/bindings/serial/serial.yaml index 40e05dd37826..30c85768d980 100644 --- a/Documentation/devicetree/bindings/serial/serial.yaml +++ b/Documentation/devicetree/bindings/serial/serial.yaml @@ -93,6 +93,7 @@ patternProperties: type: object then: additionalProperties: true + $ref: serial-peripheral-props.yaml# description: Serial attached devices shall be a child node of the host UART device the slave device is attached to. It is expected that the attached @@ -104,28 +105,6 @@ patternProperties: description: Compatible of the device connected to the serial port. - max-speed: - $ref: /schemas/types.yaml#/definitions/uint32 - description: - The maximum baud rate the device operates at. - This should only be present if the maximum is less than the slave - device can support. For example, a particular board has some - signal quality issue or the host processor can't support higher - baud rates. - - current-speed: - $ref: /schemas/types.yaml#/definitions/uint32 - description: | - The current baud rate the device operates at. - This should only be present in case a driver has no chance to know - the baud rate of the slave device. - Examples: - * device supports auto-baud - * the rate is setup by a bootloader and there is no way to reset - the device - * device baud rate is configured by its firmware but there is no - way to request the actual settings - required: - compatible