From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.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 F17EC7E for ; Sun, 14 Jan 2024 10:54:52 +0000 (UTC) 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="q9uFuURK" Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-a28bd9ca247so916614466b.1 for ; Sun, 14 Jan 2024 02:54:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705229691; x=1705834491; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=ABYEygU8Dg4IMa/B7IDl91HACWO/InTGiKQVwoUPDok=; b=q9uFuURKmZMNQBtJ1DFX+ouLd8XX69wndPDSkVY4nBC6ryrrcQf3YBZnYObLYK/op2 wYPHaRsO0wCSR9jTNn9RbCDFWQiv74pjn8RZGr99NH1HBAJE44zdUy5N9G0mW+rBp8Du 5QN7abaGLQmZOsZToUswS99n1bli+u7vNoSGTMyOK5zIhFtW6/SQtpnDV68qp5TOGfli 7/U9E3RQKIwFPQkg0KoI+vkgdvojuykAl68ulaK1YTDEUtS+b1m9FjMrE+vPU3w2t43k 1TdukYev8cmPUSNyRtjyosV0Iimn+vSNDq3swXuQXQUiPHoDT4f5wSpvJcrd/+7wVlQg J+Hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705229691; x=1705834491; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ABYEygU8Dg4IMa/B7IDl91HACWO/InTGiKQVwoUPDok=; b=L+ngICU3sHuUwbV8en+MQlpLzYRx4ykV/uBmwg3fk5nG8YFBEKftkY+Zf1O1fLXs9Z MOHH9qNTwJUGY4XlJsKmI8OGcm/cuBifU3esXrVdqHrtQWmmLBjTbopdIDVLtGJZM8Gq KDKhrajc69OaouqLdxmKjIVZu/qYHzN4tZFYjto3H7j/+e7OXG8e5xll+2glwYarPAA2 msqHkZANGkA0EUCuIJ7Fs78q1u4BSXuhQAp1yeua4J1+o28MPJ+bUbZLANWaMVVsoezN sy2eEOTYAT5ZWyhL0PKwdPetE4wTUDxDyZhFeNS7fKPUOmyeQeNGfsSUvAjhvKmiwXuF MWdg== X-Gm-Message-State: AOJu0YzAcmyB1aKo89bvRQwdy2DqLTAA7XUrjSIH0JEXIhktkJo+LxBA CbwhR44dVY2TEVyHnX1nN1c8KVTIFbwFig== X-Google-Smtp-Source: AGHT+IG6Zsrz8d96netVaBlokaRiCz2HP+3I46WUes4gggWNArwt5IJJ2QlSOdI3SyNLqQv3ekkI8w== X-Received: by 2002:a17:906:fd55:b0:a2b:efa3:6b25 with SMTP id wi21-20020a170906fd5500b00a2befa36b25mr1442234ejb.5.1705229690985; Sun, 14 Jan 2024 02:54:50 -0800 (PST) Received: from [192.168.1.20] ([178.197.223.112]) by smtp.gmail.com with ESMTPSA id st7-20020a170907c08700b00a2cfa8edbcesm2206367ejc.199.2024.01.14.02.54.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 14 Jan 2024 02:54:50 -0800 (PST) Message-ID: <81c79939-56cc-4d78-9552-56568999df09@linaro.org> Date: Sun, 14 Jan 2024 11:54:48 +0100 Precedence: bulk X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 1/3] dt-bindings: w1: UART 1-Wire bus To: Christoph Winklhofer , Rob Herring Cc: Conor Dooley , Greg Kroah-Hartman , Jiri Slaby , Krzysztof Kozlowski , Jonathan Corbet , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, linux-doc@vger.kernel.org References: <20240106-w1-uart-v4-0-7fe1378a8b3e@gmail.com> <20240106-w1-uart-v4-1-7fe1378a8b3e@gmail.com> <20240113013917.GA3795949-robh@kernel.org> Content-Language: en-US From: Krzysztof Kozlowski Autocrypt: addr=krzysztof.kozlowski@linaro.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXfU12yfcRYVEMQrmplNZssmYhiTeVicuOOypWugZKVLGNm0IweVCaZ/DJDIH gNbpvVwjcKYrx85m9cBVEBUGaQP6AT7qlVCkrf50v8bofSIyVa2xmubbAwwFA1oxoOusjPIE J3iadrwpFvsZjF5uHAKS+7wHLoW9hVzOnLbX6ajk5Hf8Pb1m+VH/E8bPBNNYKkfTtypTDUCj NYcd27tjnXfG+SDs/EXNUAIRefCyvaRG7oRYF3Ec+2RgQDRnmmjCjoQNbFrJvJkFHlPeHaeS BosGY+XWKydnmsfY7SSnjAzLUGAFhLd/XDVpb1Een2XucPpKvt9ORF+48gy12FA5GduRLhQU vK4tU7ojoem/G23PcowM1CwPurC8sAVsQb9KmwTGh7rVz3ks3w/zfGBy3+WmLg++C2Wct6nM Pd8/6CBVjEWqD06/RjI2AnjIq5fSEH/BIfXXfC68nMp9BZoy3So4ZsbOlBmtAPvMYX6U8VwD TNeBxJu5Ex0Izf1NV9CzC3nNaFUYOY8KfN01X5SExAoVTr09ewARAQABzTRLcnp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BLo0OV+Ezo71pg3AYvq0a3/oGRG KQ06ztUMRrj8eVtpImjsWCd0bDWRaaR4vqhCHvAG9iWXZu4qh3ipie2Y0oSJygcZT7H3UZxq fyYKiqEmRuqsvv6dcbblD8ZLkz1EVZL6djImH5zc5x8qpVxlA0A0i23v5QvN00m6G9NFF0Le D2GYIS41Kv4Isx2dEFh+/Q== In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 13/01/2024 19:04, Christoph Winklhofer wrote: > On Fri, Jan 12, 2024 at 07:39:17PM -0600, Rob Herring wrote: >> On Sat, Jan 06, 2024 at 05:02:24PM +0100, Christoph Winklhofer wrote: >>> Add device tree binding for UART 1-Wire bus. >>> >>> Signed-off-by: Christoph Winklhofer >>> --- >>> Documentation/devicetree/bindings/w1/w1-uart.yaml | 62 +++++++++++++++++++++++ >>> 1 file changed, 62 insertions(+) >>> >>> diff --git a/Documentation/devicetree/bindings/w1/w1-uart.yaml b/Documentation/devicetree/bindings/w1/w1-uart.yaml >>> new file mode 100644 >>> index 000000000000..6b90693b2ca0 >>> --- /dev/null >>> +++ b/Documentation/devicetree/bindings/w1/w1-uart.yaml >>> @@ -0,0 +1,62 @@ >>> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause >>> +%YAML 1.2 >>> +--- >>> +$id: http://devicetree.org/schemas/w1/w1-uart.yaml# >>> +$schema: http://devicetree.org/meta-schemas/core.yaml# > ... >>> +properties: >>> + compatible: >>> + const: w1-uart >>> + >>> + reset-speed: >>> + $ref: /schemas/types.yaml#/definitions/uint32 >>> + default: 9600 >>> + description: | >> >> Don't need '|' if no formatting >> > > Ok. > >>> + The baud rate for the 1-Wire reset and presence detect. >>> + >>> + touch_0-speed: >> >> Don't use '_' in property names. >> >> I'm somewhat familar with 1-wire, but I don't get what 'touch' means >> here. I assume these are low and high times which are a function of the >> baudrate. >> > > I change the name to 'write-0-speed' and 'write-1-speed'. The function > in the w1-framework is named 'touch_bit' - therefore the previous > naming. > > It is the baud-rate used in the 1-Wire cycle to write a 0-Bit > (write-0-speed) and to perform a 1-Wire cycle that writes a 1-Bit and > reads a 0-Bit or 1-Bit (write-1-speed). Then probably -bps: https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/property-units.yaml > >>> + $ref: /schemas/types.yaml#/definitions/uint32 >>> + default: 115200 >>> + description: | >>> + The baud rate for the 1-Wire write-0 cycle (touch bit 0). >>> + >>> + touch_1-speed: >>> + $ref: /schemas/types.yaml#/definitions/uint32 >>> + default: 115200 >>> + description: | >>> + The baud rate for the 1-Wire write-1 and read cycle (touch bit 1). >>> + >>> +required: >>> + - compatible >>> + >>> +additionalProperties: false >> >> w1.txt says there can be a child node for the 1-wire device. You need >> 'type: object'. Or w1.txt needs to be converted to schema and referenced >> here (along with using unevaluatedProperties here instead). >> >> Rob > > Will change it to type object. However, I also tried to convert w1.txt > to w1.yaml - I am not quite sure, so I add an excerpt of my attempt. > The example in w1.txt builds fine. Is oneOf allowed as a top-level > property, the documentation only mentions allOf? > Only one child should be allowed, but I did not find a way to restrict > this. > > # w1-uart.yaml: > unevaluatedProperties: > $ref: w1.yaml > > # w1.yaml: > properties: > compatible: > enum: > - maxim,ds2760 w1 describes entire class of the devices, so it should not have compatibles. Look how other buses do it. > > oneOf: > - $ref: /schemas/power/supply/maxim,ds2760.yaml > > unevaluatedProperties: false Best regards, Krzysztof