From nobody Sun Dec 14 12:17:33 2025 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (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 2AF781BE876 for ; Tue, 2 Jul 2024 17:34:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719941651; cv=none; b=V0tlHr18HHU6/ITv7V2ItxmA5mJPXRnqkQH0YAfkMjGNJQ1uaRAHcjvvvSSdQkkmr0gP8ka9JABvQuluXkj1v/15C8h99O2IqVEZE49NCdifAQw7DbOUzVkzH3/T0UXnoYkBcupPsqs65WYSrypDZPi4APsOu8IM63dWZTcLNP4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719941651; c=relaxed/simple; bh=u/r2uW73OwBD2xLuXA811RokrBDEf+axTdQOVDLJPIM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=lbi52qUMCKSkvRcDF7ccpKUmmW+YwrSXdfQENfWhdoM7HzImv9sVQLqyhtGVzKsCLazTqUMNjpufJXX8W+AMzP3iKEDr7Gophcx+KmW104ITEPmjMPdN7kAuNlXDsfDf+WApazlh1nUvhOA8b1hgniopWwK8cnjTdxNHPkKo0rM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=bskrnKu8; arc=none smtp.client-ip=209.85.128.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="bskrnKu8" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-42573d3f7e4so29463055e9.0 for ; Tue, 02 Jul 2024 10:34:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1719941647; x=1720546447; 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=XoOP6xDFVO+piNQMxKh2JgMUAWvA+ZCbwk4Ckp0ym3U=; b=bskrnKu86JUiCpGnSMMH0jp0oIo7CNOU5GucJkH1i8FNuWfuWtgReLxPKvsgakZwwe zeCBNMxG4Ev5grxV0bx9i2Dj/w9ZHSLvHRN4Sx6nKXjNT1vKIHb0cSCBedtTb7KneORE F6VzDlGwGBBYugqJT1xtmsuSbUR5ujVM8dIlADMkhlqoJY+77P59vry8d5kiW/SNtMID Ejgdd2Gt2ocgc9+W/bypD9KGWg10oIlrxxuS4PB30iEIi2fUsm8tiwnhnBm8RToMKs7r ZBKEyyxjJLJgzsbDytQli+8g7Uxdk029u1WEmmfi18xEZD8PQ7xXGgf4umta217DkiV0 WL1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719941647; x=1720546447; 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=XoOP6xDFVO+piNQMxKh2JgMUAWvA+ZCbwk4Ckp0ym3U=; b=Cju3zJXwLmwpK9QKJkCWnKtyJQDeoHBP/OjJTJ0UdJfJjKFH6c6u78kuE+NQUH18Uj QjsYsIFyhM6ZEwkaFaS3Z0sZfcnCu2uZZxnQ0dGcsWiZQgNT9WMdVbFbgXhIQG9YFe/b eGKdnoJCm1upKg4fwIey8BpC/dFjkZG8dJGgp12wV7nJPCHgESCbm3JZl52orJlKg1tG LDI0GjsE5SkuyJm6H3dhBtbccC1JeHZ2zwqHZYOoIDE+nsnnrBhtnYGVLqNOZpouSEr+ saFW9zD99q7845rWqaTaeEZYWqtRvHP9ggSLxFCb3NWWziAWfmZzNeORe5l6cdp5EII9 9rnA== X-Forwarded-Encrypted: i=1; AJvYcCWYwWIlaZIr4RVQiVGxw4vtX7azA8OXvP8qJb5maabVt8PNhgcRavDuRi49+5C2g0W1UJAr18jSeM38qBMXkmrXMWAWXG9JOBThIsWN X-Gm-Message-State: AOJu0YxmQwQy1l6IxVEVknlZDhlyrn9jSIgJd25INAC3qFzMco3p7vle q/oJ8faCemLRghqkTqIh7eioM4P8pUM4lCJcSgLtm1R53k2FLTOgdVoQv0fmI6A= X-Google-Smtp-Source: AGHT+IGNbBFaMXt00tk7jgstqKf4YHnk4QO27CDWCR548WxyUqMoX0zzovPsmWQ3+2snfKSDrSFNhA== X-Received: by 2002:a05:600c:c88:b0:425:6498:3b6c with SMTP id 5b1f17b1804b1-4257a06427bmr72751655e9.26.1719941647149; Tue, 02 Jul 2024 10:34:07 -0700 (PDT) Received: from [127.0.1.1] (frhb82016ds.ikexpress.com. [185.246.87.17]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4256af59732sm207594485e9.11.2024.07.02.10.34.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 10:34:06 -0700 (PDT) From: Guillaume Stols Date: Tue, 02 Jul 2024 17:34:05 +0000 Subject: [PATCH v3 1/8] dt-bindings: iio: adc: adi,ad7606: normalize textwidth Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240702-cleanup-ad7606-v3-1-57fd02a4e2aa@baylibre.com> References: <20240702-cleanup-ad7606-v3-0-57fd02a4e2aa@baylibre.com> In-Reply-To: <20240702-cleanup-ad7606-v3-0-57fd02a4e2aa@baylibre.com> To: Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Hennerich , linux-fbdev@vger.kernel.org, devicetree@vger.kernel.org, Jonathan Cameron , Guillaume Stols , jstephan@baylibre.com, dlechner@baylibre.com X-Mailer: b4 0.14.0 Normalize textwidth to 80 columns on the descriptions. Acked-by: Rob Herring (Arm) Signed-off-by: Guillaume Stols --- .../devicetree/bindings/iio/adc/adi,ad7606.yaml | 50 +++++++++++-------= ---- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml b/Do= cumentation/devicetree/bindings/iio/adc/adi,ad7606.yaml index 00fdaed11cbd..32caa9fc00e4 100644 --- a/Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml @@ -40,60 +40,58 @@ properties: =20 adi,conversion-start-gpios: description: - Must be the device tree identifier of the CONVST pin. - This logic input is used to initiate conversions on the analog - input channels. As the line is active high, it should be marked - GPIO_ACTIVE_HIGH. + Must be the device tree identifier of the CONVST pin. This logic inp= ut is + used to initiate conversions on the analog input channels. As the li= ne is + active high, it should be marked GPIO_ACTIVE_HIGH. maxItems: 1 =20 reset-gpios: description: - Must be the device tree identifier of the RESET pin. If specified, - it will be asserted during driver probe. As the line is active high, - it should be marked GPIO_ACTIVE_HIGH. + Must be the device tree identifier of the RESET pin. If specified, i= t will + be asserted during driver probe. As the line is active high, it shou= ld be + marked GPIO_ACTIVE_HIGH. maxItems: 1 =20 standby-gpios: description: - Must be the device tree identifier of the STBY pin. This pin is used - to place the AD7606 into one of two power-down modes, Standby mode or + Must be the device tree identifier of the STBY pin. This pin is used= to + place the AD7606 into one of two power-down modes, Standby mode or Shutdown mode. As the line is active low, it should be marked GPIO_ACTIVE_LOW. maxItems: 1 =20 adi,first-data-gpios: description: - Must be the device tree identifier of the FRSTDATA pin. - The FRSTDATA output indicates when the first channel, V1, is - being read back on either the parallel, byte or serial interface. - As the line is active high, it should be marked GPIO_ACTIVE_HIGH. + Must be the device tree identifier of the FRSTDATA pin. The FRSTDATA + output indicates when the first channel, V1, is being read back on e= ither + the parallel, byte or serial interface. As the line is active high,= it + should be marked GPIO_ACTIVE_HIGH. maxItems: 1 =20 adi,range-gpios: description: - Must be the device tree identifier of the RANGE pin. The polarity on - this pin determines the input range of the analog input channels. If - this pin is tied to a logic high, the analog input range is =C2=B110= V for - all channels. If this pin is tied to a logic low, the analog input r= ange - is =C2=B15V for all channels. As the line is active high, it should = be marked + Must be the device tree identifier of the RANGE pin. The polarity on= this + pin determines the input range of the analog input channels. If this= pin + is tied to a logic high, the analog input range is =C2=B110V for all= channels. + If this pin is tied to a logic low, the analog input range is =C2=B1= 5V for all + channels. As the line is active high, it should be marked GPIO_ACTIVE_HIGH. maxItems: 1 =20 adi,oversampling-ratio-gpios: description: - Must be the device tree identifier of the over-sampling - mode pins. As the line is active high, it should be marked - GPIO_ACTIVE_HIGH. + Must be the device tree identifier of the over-sampling mode pins. A= s the + line is active high, it should be marked GPIO_ACTIVE_HIGH. maxItems: 3 =20 adi,sw-mode: description: Software mode of operation, so far available only for ad7616 and ad7= 606b. - It is enabled when all three oversampling mode pins are connected to - high level. The device is configured by the corresponding registers.= If the - adi,oversampling-ratio-gpios property is defined, then the driver wi= ll set the - oversampling gpios to high. Otherwise, it is assumed that the pins a= re hardwired - to VDD. + It is enabled when all three oversampling mode pins are connected to= high + level. The device is configured by the corresponding registers. If t= he + adi,oversampling-ratio-gpios property is defined, then the driver wi= ll set + the oversampling gpios to high. Otherwise, it is assumed that the pi= ns are + hardwired to VDD. type: boolean =20 required: --=20 2.34.1 From nobody Sun Dec 14 12:17:33 2025 Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) (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 9CA5E1BF325 for ; Tue, 2 Jul 2024 17:34:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719941652; cv=none; b=bB4HY8Dq9XteX1hz9jasfspwadz5/VbHU6/xClFKpEd1RhIvdAmo5Uhc4fQ1dfZEwJBPmvnXwt4NjmqvmIRRgBFoa47tXh0ZsXMtx1NS3kgg4M142BKKZ2jVB6LFcIUg+ZMM+kS5kCiAGFnMDh29H0qv8J77RhgFCYb/q7/U6d8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719941652; c=relaxed/simple; bh=0vxKQkSBULjAJQGXdaLmNcvckFt2gVdVQfpVa/gC9hk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=kuB2Zsrepl4WUlHy9MYxPbbWOcLr6/tFm3sINU3CXrcU+SmAbQHKmf1W6GzNupdX7XGCiaG0TjHNr7bFQQbNHohxJvkn55XZ1gkT9FzipD6PogMG8LXPZPo9Kuhc74onC+XvI793SOqB9XionXj4gvNQg1eUpoIiPuZKaHI2Ffs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=JVOkIvJ+; arc=none smtp.client-ip=209.85.208.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="JVOkIvJ+" Received: by mail-lj1-f181.google.com with SMTP id 38308e7fff4ca-2ee7885aa5fso9587311fa.1 for ; Tue, 02 Jul 2024 10:34:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1719941648; x=1720546448; 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=HiVIhZEAyuYnJTbH9Xr5ihUjZSz2ff/4WqtLGIZJN0k=; b=JVOkIvJ+wPM4x7f1DiLk5FgH7P2fdCOFd5yG0hQ1yWyFJA0zhdVyeV6NbX92z8gSWv KVb7rxfScYJQTBbv5mE2ykov//i1aNLabqEJzgkCF7mR9a/mRs7p1wZg+9l8mWvvwbAr Ssg68/Yjzo0ra30+fc/Hpko9ZhURiLXswyNcHMWWErQLN4G68FQYmsBFvt3y+YTNl7hd 0ToQ6lMQjcB1fgdtCHqemj5uJuZhsaco8ZFZd8TNCEwLKUhYdMW596nBuc/koIG1bOeB x78KtxccdXiqugLGGpP5G9JgHnI2/9lDsOOBjSA4jDiCT4BYD5JlD+JiMvDYW9Gtbn77 jzEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719941648; x=1720546448; 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=HiVIhZEAyuYnJTbH9Xr5ihUjZSz2ff/4WqtLGIZJN0k=; b=jJ89wSE+OESXQX1sryUatQhSVNOW7zqeDA1YK2m/T9NDqzN25x3QL0UUfi6wiQko8V lGNuc4MtBK3P1G/S/mYX+KCHj7NZpKQqdCC3VTuck3HE/7cUwrY4SF6qwk1CFfYa2033 pM+Vr+voqPceWb0jnmNCWgL4//wV/XBGhH87bxpiyAE6UAxDNO9Y1GVR6tHq1UZKT9be cvVuUNDUy8YzlN7EiMYUbaugu/5H+ODwoRZWFEsgZNwfOvNNBpQN+T+EhXRMNTvfCN58 WCCFyeG7jfSteQI4sIoqszd5eX2/ByHjDpn0WroE+aRJXni5tWig85+AJub6/OhrT07z iPzw== X-Forwarded-Encrypted: i=1; AJvYcCVdzSBYdNdI4QXvdPEGGdo0Gz+nrZJZFaT2oy7S5DdSYQa329RpyxkpDkoLndVslM5g6XUJPjiKpIT3rxyrqnBJTdEeNpPEIZRsLlU1 X-Gm-Message-State: AOJu0YwJ7yND8zk7r8hIu0xibGc3Vk9Aw/TaTQxRDS6edPXtNgbRsF// rJVdCB7F3fX0Lx3LgAbN6DYWd43sero4X40gBfE9g+uxriV7zwYbqlYewZTMmzM= X-Google-Smtp-Source: AGHT+IHtC0neIxU3WljyCNjM68D7M5011X90gk+rYESEDsyeS00GTUY8+3AvYg4aHZmpnHdwMPGjWA== X-Received: by 2002:ac2:4c4d:0:b0:52c:896f:930d with SMTP id 2adb3069b0e04-52e8274ffa8mr6224260e87.57.1719941647670; Tue, 02 Jul 2024 10:34:07 -0700 (PDT) Received: from [127.0.1.1] (frhb82016ds.ikexpress.com. [185.246.87.17]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4256af59732sm207594485e9.11.2024.07.02.10.34.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 10:34:07 -0700 (PDT) From: Guillaume Stols Date: Tue, 02 Jul 2024 17:34:06 +0000 Subject: [PATCH v3 2/8] dt-bindings: iio: adc: adi,ad7606: improve descriptions Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240702-cleanup-ad7606-v3-2-57fd02a4e2aa@baylibre.com> References: <20240702-cleanup-ad7606-v3-0-57fd02a4e2aa@baylibre.com> In-Reply-To: <20240702-cleanup-ad7606-v3-0-57fd02a4e2aa@baylibre.com> To: Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Hennerich , linux-fbdev@vger.kernel.org, devicetree@vger.kernel.org, Jonathan Cameron , Guillaume Stols , jstephan@baylibre.com, dlechner@baylibre.com X-Mailer: b4 0.14.0 Reword a few descriptions, and normalize the text width to 80 characters. Reviewed-by: Rob Herring (Arm) Signed-off-by: Guillaume Stols --- .../devicetree/bindings/iio/adc/adi,ad7606.yaml | 33 +++++++++++++-----= ---- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml b/Do= cumentation/devicetree/bindings/iio/adc/adi,ad7606.yaml index 32caa9fc00e4..76fd6df5f9ca 100644 --- a/Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml @@ -36,6 +36,9 @@ properties: avcc-supply: true =20 interrupts: + description: + The BUSY pin falling edge indicates that the conversion is over, and= thus + new data is available. maxItems: 1 =20 adi,conversion-start-gpios: @@ -48,8 +51,9 @@ properties: reset-gpios: description: Must be the device tree identifier of the RESET pin. If specified, i= t will - be asserted during driver probe. As the line is active high, it shou= ld be - marked GPIO_ACTIVE_HIGH. + be asserted during driver probe. On the AD7606x, as the line is acti= ve + high, it should be marked GPIO_ACTIVE_HIGH. On the AD7616, as the li= ne is + active low, it should be marked GPIO_ACTIVE_LOW. maxItems: 1 =20 standby-gpios: @@ -62,36 +66,39 @@ properties: =20 adi,first-data-gpios: description: - Must be the device tree identifier of the FRSTDATA pin. The FRSTDATA + Must be the device tree identifier of the FRSTDATA pin. The FRSTDATA output indicates when the first channel, V1, is being read back on e= ither - the parallel, byte or serial interface. As the line is active high,= it + the parallel, byte or serial interface. As the line is active high, = it should be marked GPIO_ACTIVE_HIGH. maxItems: 1 =20 adi,range-gpios: description: - Must be the device tree identifier of the RANGE pin. The polarity on= this + Must be the device tree identifier of the RANGE pin. The state on th= is pin determines the input range of the analog input channels. If this= pin is tied to a logic high, the analog input range is =C2=B110V for all= channels. - If this pin is tied to a logic low, the analog input range is =C2=B1= 5V for all - channels. As the line is active high, it should be marked + On the AD760X, if this pin is tied to a logic low, the analog input = range + is =C2=B15V for all channels. As the line is active high, it should = be marked GPIO_ACTIVE_HIGH. maxItems: 1 =20 adi,oversampling-ratio-gpios: description: Must be the device tree identifier of the over-sampling mode pins. A= s the - line is active high, it should be marked GPIO_ACTIVE_HIGH. + line is active high, it should be marked GPIO_ACTIVE_HIGH. On the AD= 7606X + parts that support it, if all 3 pins are tied to a logic high, softw= are + mode is enabled. maxItems: 3 =20 adi,sw-mode: description: - Software mode of operation, so far available only for ad7616 and ad7= 606b. + Software mode of operation, so far available only for AD7616 and AD7= 606B. It is enabled when all three oversampling mode pins are connected to= high - level. The device is configured by the corresponding registers. If t= he - adi,oversampling-ratio-gpios property is defined, then the driver wi= ll set - the oversampling gpios to high. Otherwise, it is assumed that the pi= ns are - hardwired to VDD. + level for the AD7606B, or both the range selection are connected to = high + level for the AD7616. The device is configured by the corresponding + registers. If the adi,oversampling-ratio-gpios property is defined, = then + the driver will set the oversampling gpios to high. Otherwise, it is + assumed that the pins are hardwired to VDD. type: boolean =20 required: --=20 2.34.1 From nobody Sun Dec 14 12:17:33 2025 Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) (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 6B8FA1C004C for ; Tue, 2 Jul 2024 17:34:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719941653; cv=none; b=sxuDsBzcKYLBK1WBJMLxE9v1qXAY/E1hdIJ3nDmy/UCxb7O4uUb9zWtYv1PmVsgjZDI+1ZKdfF7vPqda2SeyCqAWMExtGA1/vbU9rQ8w3alkaxQI2FrgH2XEfkR0V02NIP3YSRUaCRDi9EeJlRDINK7r1KPRR2XOSLwx/sQXhMU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719941653; c=relaxed/simple; bh=rhz8IsaaVIFnTZZrBz6KjBh9OTq7v6hGHb8ljoHazaw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=q/Kf7GS9G8jRol/8KI2ZXKyIB3gmNMNkUGK4eN4B2QjFsPIhI40N8Hknu3eeh3UQaHL5Ij0JS6dvJz86rbLp2zGgLMe+miFTUS3aKwG1giYUJXqIHX3mUrs8mLoa6yxN7Z72+zQu1lsMyOzj/XgfWTouSLP1NvFJUZmcaX2RVr4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=MMQfxXhx; arc=none smtp.client-ip=209.85.167.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="MMQfxXhx" Received: by mail-lf1-f47.google.com with SMTP id 2adb3069b0e04-52cd717ec07so5609035e87.0 for ; Tue, 02 Jul 2024 10:34:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1719941648; x=1720546448; 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=W4PsgI6ViSPMjJzEXz9ZwZPETs75x12HxOOvUnLBogs=; b=MMQfxXhxHILGpuIKp7BXBARHk67TYPEtouN+SIQNb/okU9lwCsaVwPUui8IJdSAnwq eELlxHmR7iXrka7txLZRSn4LI9QY+6s3uf7QoQicsEjT8zkdWIKf7Y5R3oGsWyMIhgDW NOdTRaM/dyhHjsDtVv6JTsl1HPbeBA5ilCvMN4hSenQ3nPqjZR9JC9Vg6fCJ+ydiR5fs B3Xbyskyg5ffV8ONLy1CuWbsLLm89Md/CgQ8tSxYhgl8Kocmi/9xWyMjbKkc7hiZbiss GjNj8dxHP2FtztI9SQLm54lmwW8KGpUbxQqnaFFHm4qMxC9EaEx5gCFD7grgZxyqYiv/ NdfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719941648; x=1720546448; 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=W4PsgI6ViSPMjJzEXz9ZwZPETs75x12HxOOvUnLBogs=; b=g7quxWeBOYI05riV25b9z8emwdgN/E/fE8wNBwV/J4cLhD639pXHjJsgMBz/MSpWNq 5cYcN8Q1wuZBiWa//BnnJijcZQoFVzIAOoOrTNVNiDxqCZ2BFVha9qXSiVVcQB81yfT2 ML4no5uTYqQMCBL+EXQJvVDRB7rkIZF+SFqbnl2eBrMqEa7PYYuBIGUzSnd2JTd0YJ+e BDAfnswt3WnIig/ZnkKDjS649JFjFaMLglkWeJ/4JiZYFjOnzRWLg8KP1fViBXbGYfLh O7Wan1EB62icVky6RCVllBVPWQ1cDFgTt2DmPYaGME4uV6hdkfV7QrpaZemCXByhmaHw qjSw== X-Forwarded-Encrypted: i=1; AJvYcCX0mF35y1BKrEmy04Fc3CBR4xNoYDPW2cOH65nz/Y7Iv2juZ8kYYR2mofg1vBL80eWJjBoG8hrikwqHsQlAR/4OfcbtG0axgMe2hOIC X-Gm-Message-State: AOJu0Yw24unELo9CQJDUbBamBQRx0UwVArjuVL/VqF7OFJTtWlPzw+rK iKByN5rx+vBGQw/6ewzoDzlIW6412AVtaem0SmNfmUG4koHJ0+AFXdkveB87Izs= X-Google-Smtp-Source: AGHT+IGTeGpFakXpFvB+K8s+jVCiEGTABpmrQyZUGoo7/gqdCCvxwaVwIzDm28ZLP34Gl/f3b2j9yQ== X-Received: by 2002:a05:6512:3c9f:b0:52e:7a8c:35a0 with SMTP id 2adb3069b0e04-52e82651c44mr7961021e87.7.1719941648256; Tue, 02 Jul 2024 10:34:08 -0700 (PDT) Received: from [127.0.1.1] (frhb82016ds.ikexpress.com. [185.246.87.17]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4256af59732sm207594485e9.11.2024.07.02.10.34.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 10:34:07 -0700 (PDT) From: Guillaume Stols Date: Tue, 02 Jul 2024 17:34:07 +0000 Subject: [PATCH v3 3/8] dt-bindings: iio: adc: adi,ad7606: add supply properties Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240702-cleanup-ad7606-v3-3-57fd02a4e2aa@baylibre.com> References: <20240702-cleanup-ad7606-v3-0-57fd02a4e2aa@baylibre.com> In-Reply-To: <20240702-cleanup-ad7606-v3-0-57fd02a4e2aa@baylibre.com> To: Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Hennerich , linux-fbdev@vger.kernel.org, devicetree@vger.kernel.org, Jonathan Cameron , Guillaume Stols , jstephan@baylibre.com, dlechner@baylibre.com, Conor Dooley X-Mailer: b4 0.14.0 Add voltage supplies Acked-by: Conor Dooley Signed-off-by: Guillaume Stols --- Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml b/Do= cumentation/devicetree/bindings/iio/adc/adi,ad7606.yaml index 76fd6df5f9ca..bb716182db63 100644 --- a/Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml @@ -35,6 +35,15 @@ properties: =20 avcc-supply: true =20 + vdrive-supply: + description: + Determines the voltage level at which the interface logic pins will + operate. + + refin-supply: + description: + The voltage supply for optional external reference voltage. + interrupts: description: The BUSY pin falling edge indicates that the conversion is over, and= thus @@ -106,6 +115,7 @@ required: - reg - spi-cpha - avcc-supply + - vdrive-supply - interrupts - adi,conversion-start-gpios =20 @@ -130,6 +140,7 @@ examples: spi-cpha; =20 avcc-supply =3D <&adc_vref>; + vdrive-supply =3D <&vdd_supply>; =20 interrupts =3D <25 IRQ_TYPE_EDGE_FALLING>; interrupt-parent =3D <&gpio>; --=20 2.34.1 From nobody Sun Dec 14 12:17:33 2025 Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) (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 B92AF1C005A for ; Tue, 2 Jul 2024 17:34:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719941654; cv=none; b=q5qX9J0JhzG/U91uhSdI4qYNLEZv4WvUYketGFyo8suSgr1Inj9iSwoWuE8Yl1eUYnwa9Jo06g8fiGkcngkW0+ZxtzVKia5ziFe/+gniNpmoVsINpe/mmLbDjQPNNmY/lXUpQMIIaKIJfw5LsUhz5As9yrsB2FWmv8lIH5Wgfx4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719941654; c=relaxed/simple; bh=nGzK2S78m0bky0xL6X4TlkILzMXZbw7Q567KAtyItso=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XaDHJwYqPIBGehu07n4VSf1JFMNmmHAjO4rLU6qg5OzojGNzcT2ChjjhPBn5W9Oidkoieyn0Ii2FUoMruaCzC+nGlSJZHhwVCf5gtId5lit3qYjc7AIlsE3Tyu22kjj+dfN1Ia9mt64GAywQamHmXj+vwzSm42iYlo+X33lEAHA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=X9OwpT/G; arc=none smtp.client-ip=209.85.167.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="X9OwpT/G" Received: by mail-lf1-f46.google.com with SMTP id 2adb3069b0e04-52e94eaf5efso23494e87.2 for ; Tue, 02 Jul 2024 10:34:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1719941649; x=1720546449; 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=bqVxrCmaqTdd1OivUsUaCiiNGBxmmQjkW28fKPO8hWM=; b=X9OwpT/GOyRvGYNRAocpe5BorQ35LZ8cPEWEfpTR6VVmG/PAiBclZWeABUcaqBY7qh LDPrH3wmj2M9egaLNVE0QXywMfeRljb3nFTSSHVEA2Fq6BttdiEj5Wg1LvIhwsPo3FQN YSjl8QJTLn5CachTFU1FE9zAyxIYewQNASAbijE5rrbCTLor6iymiVQlZGI3yH81+hre hmhcxSoPQ6mjcnmwbRKMq9gwBFiRFv6XD3dcXiah3zLKRFZiNea74dhik8S2mz6Ho3lL t4WG2pmXB7JXCj9SJxI9Vc/mfFhv7GyeVtS+zPSNqggUVVSPskvwEtL0EMutxK6dI13F TPZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719941649; x=1720546449; 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=bqVxrCmaqTdd1OivUsUaCiiNGBxmmQjkW28fKPO8hWM=; b=LO7TbXAn68FWRy88lqJfdaizvwoOzXQg7Qd4E+J1ow+cR1mg9SjjxA5qnATQHSV5gb Mp8c9ZfE/TCm9DIbypgHfM8/JaQijoljel9YSaZJeyS9W6J18TCfvKhl/JIrLl3tD4Bs ok5DP/cb4FZOoGy5QWNeQFJmXjkCDGsJaSTcwn5K34ZOhrET+joNxLTObk0Ptuh/J6pG uzWqW12Uoi8C0HplvKsLB1+fkNuikkDeCgRzN1NADc0//sLOHO1n/gqtLUWEI9uxX6h6 5qHrDm3kduvOW4AiiRXwNGaBBPQ9cUl3KX1oDBXc4OMavh12mJci2wTTxdgBXa20MMvd g/+g== X-Forwarded-Encrypted: i=1; AJvYcCXTGMdhxJZPt2gMAH2xSsKWYoE36QwErYTZW3CwZZTrZMrIEuoiGhY9voRdkgT2v2pgDBaFMSpvrKsTkaCzgQtgPUtck0pBZoIYPRBO X-Gm-Message-State: AOJu0YykYwaCheFvSlJ58ZmFm5h3p433AgcGiCFZ4yuqc4pekuxxbYxu 8b0Y3dmJBDj6Eftig1Iwowa2Aku1tkqaEANYm2he5vziaU/ujShOnzCU0XvW/z0= X-Google-Smtp-Source: AGHT+IENS/hi3LdGvHKX10bpeZAX/pN6vBzZfnzLA+VvEBpaHsDKR8zQxnIVkfkUxagS9XQHEEGRZQ== X-Received: by 2002:a05:6512:3d1b:b0:52c:b008:3db8 with SMTP id 2adb3069b0e04-52e826898e6mr5673752e87.38.1719941648842; Tue, 02 Jul 2024 10:34:08 -0700 (PDT) Received: from [127.0.1.1] (frhb82016ds.ikexpress.com. [185.246.87.17]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4256af59732sm207594485e9.11.2024.07.02.10.34.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 10:34:08 -0700 (PDT) From: Guillaume Stols Date: Tue, 02 Jul 2024 17:34:08 +0000 Subject: [PATCH v3 4/8] dt-bindings: iio: adc: adi,ad7606: fix example Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240702-cleanup-ad7606-v3-4-57fd02a4e2aa@baylibre.com> References: <20240702-cleanup-ad7606-v3-0-57fd02a4e2aa@baylibre.com> In-Reply-To: <20240702-cleanup-ad7606-v3-0-57fd02a4e2aa@baylibre.com> To: Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Hennerich , linux-fbdev@vger.kernel.org, devicetree@vger.kernel.org, Jonathan Cameron , Guillaume Stols , jstephan@baylibre.com, dlechner@baylibre.com, Conor Dooley X-Mailer: b4 0.14.0 Example uses adi,ad7606-8 as compatible, but adi,sw-mode is not available for it. So remove this property from example. Acked-by: Conor Dooley Signed-off-by: Guillaume Stols --- Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml b/Do= cumentation/devicetree/bindings/iio/adc/adi,ad7606.yaml index bb716182db63..499b6ad5525a 100644 --- a/Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml @@ -152,7 +152,6 @@ examples: <&gpio 23 GPIO_ACTIVE_HIGH>, <&gpio 26 GPIO_ACTIVE_HIGH>; standby-gpios =3D <&gpio 24 GPIO_ACTIVE_LOW>; - adi,sw-mode; }; }; ... --=20 2.34.1 From nobody Sun Dec 14 12:17:33 2025 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (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 3C6181C0076 for ; Tue, 2 Jul 2024 17:34:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719941654; cv=none; b=Sdt7C6br9v4t8/ghnJAcLRUQUoP59G7q0P8N7bMmf8m6Bv0htk6ZCCMh49R0QDUwj5MjeVFqSuOc8+MVLCnrClwek1FI6RyEPPLAqK19QdcItmm9mAqT7zvhAeRkI4klCBoKGYfRZ3rkSOTgCe2uzSqF3HB9BYdt+8h8yIjC46s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719941654; c=relaxed/simple; bh=/LA/tVbUGREpux3rwFNrtFexWvYIFIQqHifGylYOE7Y=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=RPjmzcjhXHS1U1Peu4k5+cWZJpH0L5HKm6QXRkjIewiCxn+uOcyqyBdEqwtIzsOA1si+wr7ztRNpvl64QjnGk8an7/QlfCJZGNU+pPHtRTK4Ae27gBGQ7y74cvbgSrFvkbVCQ5Ja2ATKkxxeAZ5oujw78d/uvVSwvAaR7/+Vd78= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=Tb2/hbh2; arc=none smtp.client-ip=209.85.128.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="Tb2/hbh2" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-425814992aeso17037455e9.1 for ; Tue, 02 Jul 2024 10:34:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1719941649; x=1720546449; 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=OlOMVM0Oi/I1G5ABSh4CvVIoiZHYlhaelZAr8Gl3RX4=; b=Tb2/hbh25bo/t5+n3AURyKbt8RCGLirlj9Dzhx3WRbY6Rf+9SPAc3FH73mXmDXjc0r oecveLKmgKuQw/9hNnyGi3S8L3W5Pl1wLMFYIssGi0QiqdTx/Sd2nib8Fx1In2mmZEsX sTf/I2R1uYfqUD5y8rktm73lE4yBU30TQmo7sEO8s5TYZH1Uwb4+5dzNJ8sMd4RwXGcq l9+7mQd1CAiNBGxZjte/NKmjepAXvKOk6Zv2biaaN7SQyReGZnQENMVNFAWySePshDyN GC7BBHxwts+6IJ5bqdtKCMMLLyNhx3yziQS5JJQ/Qk5WIGRSX6YvxjfehsrHOQ5BqcMW VatQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719941649; x=1720546449; 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=OlOMVM0Oi/I1G5ABSh4CvVIoiZHYlhaelZAr8Gl3RX4=; b=bOgNd5bcQ+yQsM8NRZHWNIh7ZGgfRKDLj1uTBCjQYeGu7P0mAKCySb930I2Mmq/9U1 3SV4lHYBaVb4vwWXyx9UwDVb7+XCkDDAKQkSzgKOR1mq0mpSpKr/YsDq/7m1D70cu03R UhPGec3wG95pbs23pr4Fll71np08aXWXa2uOdSyfBhyuISdj8u8bIYA5KpgICaj8hW64 SLhHRlcDrv36GLVzEKehfZ4h4Oky3P5vlb3cQV3O+hx13rTqjUsoq1QK0uSajpc4iSME A0ff3V60z+zvJusV5xZE31pGSQMajqvCoOLiX8CY40zGF65GV9imuB9pR0SiXtn1qUvW hyig== X-Forwarded-Encrypted: i=1; AJvYcCUSPj1QFq5n+jmdOwq4FTp8Qe6eOPlLntqVycfvxET+etGRCAEHngiY1D9pg9QjC5Lx6LqwmgtGnxy94OwbM23qM2WeFHmB3dnzv2Ax X-Gm-Message-State: AOJu0YyRhRaNbzdYDzePjgVjIKx5fcrt+OITm4uz+Ej2/xH8llA6SDR3 Nvpi/IDckMGOWKp5048nK1sBsIacSScJJPdF9OvqUMzfqML5CA4RXDOR8u8awAI= X-Google-Smtp-Source: AGHT+IE7S6mRIdq/pwCzKBcD26Jq2dW/C6XfGEiQgs8D7NweKQh0I45uV18IHCqTsOFz+vvMfcxK8A== X-Received: by 2002:a05:600c:3542:b0:425:77ad:93cb with SMTP id 5b1f17b1804b1-4257a009c1cmr61212815e9.2.1719941649375; Tue, 02 Jul 2024 10:34:09 -0700 (PDT) Received: from [127.0.1.1] (frhb82016ds.ikexpress.com. [185.246.87.17]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4256af59732sm207594485e9.11.2024.07.02.10.34.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 10:34:09 -0700 (PDT) From: Guillaume Stols Date: Tue, 02 Jul 2024 17:34:09 +0000 Subject: [PATCH v3 5/8] dt-bindings: iio: adc: adi,ad7606: add conditions Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240702-cleanup-ad7606-v3-5-57fd02a4e2aa@baylibre.com> References: <20240702-cleanup-ad7606-v3-0-57fd02a4e2aa@baylibre.com> In-Reply-To: <20240702-cleanup-ad7606-v3-0-57fd02a4e2aa@baylibre.com> To: Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Hennerich , linux-fbdev@vger.kernel.org, devicetree@vger.kernel.org, Jonathan Cameron , Guillaume Stols , jstephan@baylibre.com, dlechner@baylibre.com, Conor Dooley X-Mailer: b4 0.14.0 Since the driver supports several parts that present differences in their layout and behaviour, it is necessary to describe the differences from one chip to another. Reviewed-by: Conor Dooley Signed-off-by: Guillaume Stols --- .../devicetree/bindings/iio/adc/adi,ad7606.yaml | 60 ++++++++++++++++++= +--- 1 file changed, 54 insertions(+), 6 deletions(-) diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml b/Do= cumentation/devicetree/bindings/iio/adc/adi,ad7606.yaml index 499b6ad5525a..69408cae3db9 100644 --- a/Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml @@ -52,10 +52,11 @@ properties: =20 adi,conversion-start-gpios: description: - Must be the device tree identifier of the CONVST pin. This logic inp= ut is - used to initiate conversions on the analog input channels. As the li= ne is - active high, it should be marked GPIO_ACTIVE_HIGH. - maxItems: 1 + Must be the device tree identifier of the CONVST pin(s). This logic = input + is used to initiate conversions on the analog input channels. As the= line + is active high, it should be marked GPIO_ACTIVE_HIGH. + minItems: 1 + maxItems: 2 =20 reset-gpios: description: @@ -88,8 +89,11 @@ properties: is tied to a logic high, the analog input range is =C2=B110V for all= channels. On the AD760X, if this pin is tied to a logic low, the analog input = range is =C2=B15V for all channels. As the line is active high, it should = be marked - GPIO_ACTIVE_HIGH. - maxItems: 1 + GPIO_ACTIVE_HIGH. On the AD7616, there are 2 pins, and if the 2 pins= are + tied to a logic high, software mode is enabled, otherwise one of the= 3 + possible range values is selected. + minItems: 1 + maxItems: 2 =20 adi,oversampling-ratio-gpios: description: @@ -122,6 +126,50 @@ required: allOf: - $ref: /schemas/spi/spi-peripheral-props.yaml# =20 + - if: + properties: + compatible: + contains: + const: adi,ad7616 + then: + properties: + adi,first-data-gpios: false + standby-gpios: false + adi,range-gpios: + maxItems: 2 + else: + properties: + adi,range-gpios: + maxItems: 1 + + - if: + properties: + compatible: + contains: + enum: + - adi,ad7605-4 + - adi,ad7616 + then: + properties: + adi,oversampling-ratio-gpios: false + + - if: + properties: + compatible: + contains: + enum: + - adi,ad7605-4 + - adi,ad7606-4 + - adi,ad7606-6 + - adi,ad7606-8 + then: + properties: + adi,sw-mode: false + else: + properties: + adi,conversion-start-gpios: + maxItems: 1 + unevaluatedProperties: false =20 examples: --=20 2.34.1 From nobody Sun Dec 14 12:17:33 2025 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (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 E193B1BE873 for ; Tue, 2 Jul 2024 17:34:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719941654; cv=none; b=f/NDUOvkl+3z0ZpG0O0dpmPKDwnt9Likexm6nceVODc+EoS14LwS3PmbJbP5DGuH0LetDeQV6XY157fC1fHu16tQXo7MFzyAGvx0O5GJa4DeFCIr/+G8wNX7sjL46YKytmgpg1HWnPO3JI6ntEy2s69y1NMf3rGM3igfeYTt8P8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719941654; c=relaxed/simple; bh=+tapIW5xMEMTE9vSs0hYWkwNQRRONWz74WVOg6rVMnE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=NsRr1cxGEyQGpOga+K1sE03sWbC3ado9daqLHImn6AKAZgWPFBYPg/I488Ke1dOvYwQ/aJb3oqqHwiwhESIQJRKB596Qqocr62RmGxAhFSDlKsYVyG9oMASCT1gxoJL1ejhzACUuk+tHcZ0CUdBm0Gmy2ZZpm0G38quHmt6cuAE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=svL4kTXc; arc=none smtp.client-ip=209.85.128.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="svL4kTXc" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-42122ac2f38so27498945e9.1 for ; Tue, 02 Jul 2024 10:34:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1719941650; x=1720546450; 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=iYOb3cXloM7JPnPejGsCNHK/CDwXTFwHzLHb3/a7qrs=; b=svL4kTXcPOQ9HPCJ3Xp0NAJEsOuZVPfLRyOAMLjPjEaUjFowOymTlyXzxtdSE4+pQ2 XFfjnZSuNjeoiP4z6JQExroqoVw1VCkW1sb+A41j8cTp17lN5LaM9oY8zEdBiLA+xov7 LcgwmBWgQKXaEm+zHRwsTpBXVcLaRmMmlc/tLo4Y77a9FVLYJDSQLOJwPDFBTlfTPMCa UK8IWdqXS/+zUWQXXjPiNObYDFcUl/Tfnsx6dnyrZhiLl4ySc73QtT4j5/1wnkpSBCrY NelVVL/dWhhd1AhsABv9fMBhGBc1BqovDozxd1OS/0GOunqEU802FHzfDHHa96O5uDzO t2dA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719941650; x=1720546450; 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=iYOb3cXloM7JPnPejGsCNHK/CDwXTFwHzLHb3/a7qrs=; b=U3lSq/uQ/Tuq8cRqgz2mpo5kGdoBqZ5SDjln4fY1Q44HllzprhXLsWimzONHsjC5mt Eh2y12gDk4hJZMByIxVLwHt3aDAnrsaGESmHibpHzYdI7Ulw1EtOjxc3me9WbdWY8EhZ Lil4ADWFbifTqSFcp8IYN/qZ+AQixqnTGyoG6cE9Gu0v30TAVFnaKk4zC0A3Ogkt8iKV ni5ZTmB8RuyTdIkuciZduafXVx4CeWAZ8/hMPS4oYSwQ8loJVAK7f5rkK3eyFhKvYzut PW+hnH7cAkQNvASBC9XHkNNUFpiVpdrYIgsCqle4Jg1h3XCpaTHTwbNDwn+3VHV4VguA UQIQ== X-Forwarded-Encrypted: i=1; AJvYcCV6Dtucy2x2sxmGJ4oJEX7+9g5NzMbCtv6mMCcbRCu2ZMR7Hr8RD5syHeIdwcWHR3Pt7iO9ctf9wu27XTqUg0mY3goVqgiIzDgHX7we X-Gm-Message-State: AOJu0YwdvMjZborP2OyK9Ei7+V9PR1qjXRqLjkQsEPV/L3qrFn0aBR8M TWBDsvrbZ8xS+txCjZb1hhtxQMa+joios8l0iWQEWn6dkfWrzBBC79krh5Kmtjg= X-Google-Smtp-Source: AGHT+IF0v1A2YXGjxPVTBkzc5mncwxy/ANzmwUqXjG1c/rtrcB9CkyYZtIAM9w096E4U3MvbXg0WUQ== X-Received: by 2002:a05:600c:1d20:b0:424:a823:51d8 with SMTP id 5b1f17b1804b1-4256d4fb273mr110670415e9.11.1719941649848; Tue, 02 Jul 2024 10:34:09 -0700 (PDT) Received: from [127.0.1.1] (frhb82016ds.ikexpress.com. [185.246.87.17]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4256af59732sm207594485e9.11.2024.07.02.10.34.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 10:34:09 -0700 (PDT) From: Guillaume Stols Date: Tue, 02 Jul 2024 17:34:10 +0000 Subject: [PATCH v3 6/8] iio: adc: ad7606: fix oversampling gpio array Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240702-cleanup-ad7606-v3-6-57fd02a4e2aa@baylibre.com> References: <20240702-cleanup-ad7606-v3-0-57fd02a4e2aa@baylibre.com> In-Reply-To: <20240702-cleanup-ad7606-v3-0-57fd02a4e2aa@baylibre.com> To: Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Hennerich , linux-fbdev@vger.kernel.org, devicetree@vger.kernel.org, Jonathan Cameron , Guillaume Stols , jstephan@baylibre.com, dlechner@baylibre.com X-Mailer: b4 0.14.0 gpiod_set_array_value was misused here: the implementation relied on the assumption that an unsigned long was required for each gpio, while the function expects a bit array stored in "as much unsigned long as needed for storing one bit per GPIO", i.e it is using a bit field. This leaded to incorrect parameter passed to gpiod_set_array_value, that would set 1 value instead of 3. It also prevents to select the software mode correctly for the AD7606B. Fixes: d2a415c86c6b ("iio: adc: ad7606: Add support for AD7606B ADC") Fixes: 41f71e5e7daf ("staging: iio: adc: ad7606: Use find_closest() macro") Signed-off-by: Guillaume Stols Reviewed-by: Nuno Sa --- drivers/iio/adc/ad7606.c | 4 ++-- drivers/iio/adc/ad7606_spi.c | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/iio/adc/ad7606.c b/drivers/iio/adc/ad7606.c index 3a417595294f..8cce1fad9763 100644 --- a/drivers/iio/adc/ad7606.c +++ b/drivers/iio/adc/ad7606.c @@ -236,9 +236,9 @@ static int ad7606_write_os_hw(struct iio_dev *indio_dev= , int val) struct ad7606_state *st =3D iio_priv(indio_dev); DECLARE_BITMAP(values, 3); =20 - values[0] =3D val; + values[0] =3D val & GENMASK(2, 0); =20 - gpiod_set_array_value(ARRAY_SIZE(values), st->gpio_os->desc, + gpiod_set_array_value(st->gpio_os->ndescs, st->gpio_os->desc, st->gpio_os->info, values); =20 /* AD7616 requires a reset to update value */ diff --git a/drivers/iio/adc/ad7606_spi.c b/drivers/iio/adc/ad7606_spi.c index 263a778bcf25..287a0591533b 100644 --- a/drivers/iio/adc/ad7606_spi.c +++ b/drivers/iio/adc/ad7606_spi.c @@ -249,8 +249,9 @@ static int ad7616_sw_mode_config(struct iio_dev *indio_= dev) static int ad7606B_sw_mode_config(struct iio_dev *indio_dev) { struct ad7606_state *st =3D iio_priv(indio_dev); - unsigned long os[3] =3D {1}; + DECLARE_BITMAP(os, 3); =20 + bitmap_fill(os, 3); /* * Software mode is enabled when all three oversampling * pins are set to high. If oversampling gpios are defined @@ -258,7 +259,7 @@ static int ad7606B_sw_mode_config(struct iio_dev *indio= _dev) * otherwise, they must be hardwired to VDD */ if (st->gpio_os) { - gpiod_set_array_value(ARRAY_SIZE(os), + gpiod_set_array_value(st->gpio_os->ndescs, st->gpio_os->desc, st->gpio_os->info, os); } /* OS of 128 and 256 are available only in software mode */ --=20 2.34.1 From nobody Sun Dec 14 12:17:33 2025 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.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 28DB11C230E for ; Tue, 2 Jul 2024 17:34:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719941655; cv=none; b=mmxSaKnDf9/vYjLki4y2/ijOSejq2kr+PJoR47KlXEUjCNgYMHLb1RDwykjzKIqjw7S1BOgXcuJ9yI6fnFSIH8B9glfJtDPvd3jq/c7GHM08QqFqP9p3bTD5bddviCOg6kXDD6MgwfFjXYS2DkddoLUskJ1heJ0J/IOKUPwpvDo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719941655; c=relaxed/simple; bh=TIZIXKMsUIcBcBNX8jkDzeY8VA7Mhb/sJ7N5yvRpSuw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=icjhkHxK7e6hBiJvQLFPlhd+DaymWleD+E0Vi/VOVM39RlTfS28nCoby1jmRlHKtNwcFvf60TIOHl7vVOusZWTbqTmYGbTaQaMuHsWVuyadKqXPUB751Wc24w3K9f7GKqtdufjqc08bs8sJf1cVkyafplOaBdx+Za8EMQEVLbcw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=f04+9I1Z; arc=none smtp.client-ip=209.85.128.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="f04+9I1Z" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-42564316479so27552845e9.2 for ; Tue, 02 Jul 2024 10:34:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1719941650; x=1720546450; 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=0syamWwYKEIgGFfBRP6mPS2Iu9QxWFGeekc+8eB0dRA=; b=f04+9I1Zp3cuLVlh/iAyzqvyLqR/68uCE60iStM+7uiaA+NyLfEIhUU/fBEOK5ahv9 W5+qEKQMAGz/8TAzWesVAKfHURcOsU7/4EI79CGAKDVsLbK4sFiuQ4dofCfXafxeFlul V8uTBRmqvkYu2dqTJLQvF1K7REeYy0oFREGAzcwdrf7EgM29goqFrq5pr1WyPTwkdcD6 n7ijdi3EdUM+RDW2MaQ4QQqt0Ne5eD1XrPOTBcnHD/8ysSZenDYfb7WlBnVkj8qJ7uBm r5kODm7INJp8Tep99c2QJzme64wh1O+bsN33Izg3hdakNMh5AgcvfVblmgqQ+C+/M6gb U5+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719941650; x=1720546450; 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=0syamWwYKEIgGFfBRP6mPS2Iu9QxWFGeekc+8eB0dRA=; b=SQHucIHmTK8PWaYeS65Yyvag+l+b77sgpS1aDekAF7WlERYl3KknRXaRLIWTG68arn uVaVlHLfPoV4UHAsBdvOuZEpqfTnXmmAjjY7VLn8j/xLvkSzRZmbR5yxnK4Dm3GQIW2+ 8mbX6UaTGN3vMQVTUNC1YfHIObfXKqU6acqXVjhOi6Et9WB8JTUuohI+CuklpoyRk0GI dhXjNNpzbpy3cZOZnCm7pFKZjXFhCU3iXTJPnC1jnbvLcPZmAGhF5ErnXjdD3q0Dc76L cDrf8qoa/w5Vjkuh/rDgEHZEBFxrbqCXYe0EX1/wbvk6T5ePgbH5VZp42T217U/KwgUn OIgg== X-Forwarded-Encrypted: i=1; AJvYcCWXyq5XH5uIqMTqr6vvzJz/46YhKe1hd8WajYJX/lXX+iiJPzugQDCdP2zuJxgkkPw66R2s8rUtkZ3tpc7WWLyV8Bmy4ZfacHCFjDXs X-Gm-Message-State: AOJu0YzvqTQb+VXgfUNKUs8H0syvI76gvQL9NJv6C2pGlWsaTMcdMenT +TjELYIoncUQKPw4xPQFq3/XgLgAoEdoALmHoEp6AkJ6noMvoN33/rC6otpwr28= X-Google-Smtp-Source: AGHT+IGN3I1TDjEjBKz0vG4KMqWMRnm2beW749dxNHUbKBT8wXNy3HGwouwwrskcWlVXirnWgcSw2w== X-Received: by 2002:a05:600c:1c8a:b0:424:aa64:e9a9 with SMTP id 5b1f17b1804b1-4257a04fe59mr72838155e9.26.1719941650328; Tue, 02 Jul 2024 10:34:10 -0700 (PDT) Received: from [127.0.1.1] (frhb82016ds.ikexpress.com. [185.246.87.17]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4256af59732sm207594485e9.11.2024.07.02.10.34.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 10:34:10 -0700 (PDT) From: Guillaume Stols Date: Tue, 02 Jul 2024 17:34:11 +0000 Subject: [PATCH v3 7/8] iio: adc: ad7606: fix standby gpio state to match the documentation Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240702-cleanup-ad7606-v3-7-57fd02a4e2aa@baylibre.com> References: <20240702-cleanup-ad7606-v3-0-57fd02a4e2aa@baylibre.com> In-Reply-To: <20240702-cleanup-ad7606-v3-0-57fd02a4e2aa@baylibre.com> To: Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Hennerich , linux-fbdev@vger.kernel.org, devicetree@vger.kernel.org, Jonathan Cameron , Guillaume Stols , jstephan@baylibre.com, dlechner@baylibre.com X-Mailer: b4 0.14.0 The binding's documentation specifies that "As the line is active low, it should be marked GPIO_ACTIVE_LOW". However, in the driver, it was handled the opposite way. This commit sets the driver's behaviour in sync with the documentation Fixes: 722407a4e8c0 ("staging:iio:ad7606: Use GPIO descriptor API") Signed-off-by: Guillaume Stols Reviewed-by: Nuno Sa --- drivers/iio/adc/ad7606.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/ad7606.c b/drivers/iio/adc/ad7606.c index 8cce1fad9763..50ccc245e314 100644 --- a/drivers/iio/adc/ad7606.c +++ b/drivers/iio/adc/ad7606.c @@ -443,7 +443,7 @@ static int ad7606_request_gpios(struct ad7606_state *st) return PTR_ERR(st->gpio_range); =20 st->gpio_standby =3D devm_gpiod_get_optional(dev, "standby", - GPIOD_OUT_HIGH); + GPIOD_OUT_LOW); if (IS_ERR(st->gpio_standby)) return PTR_ERR(st->gpio_standby); =20 @@ -686,7 +686,7 @@ static int ad7606_suspend(struct device *dev) =20 if (st->gpio_standby) { gpiod_set_value(st->gpio_range, 1); - gpiod_set_value(st->gpio_standby, 0); + gpiod_set_value(st->gpio_standby, 1); } =20 return 0; --=20 2.34.1 From nobody Sun Dec 14 12:17:33 2025 Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) (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 2FE481C8FA3 for ; Tue, 2 Jul 2024 17:34:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719941656; cv=none; b=m4Sg84xEmIIinpJGjYQDzSAhdbjlxAKhvNYzKQx3YEvCHt6MsOBv4v50xTC51rkxM9JC+hRS2fyoog7C2aR/2yopvSwoF8ZyXwtJxvhWL3UJgzq3AKAGu8ykfzeb25clYe1YzKORDCN7TTR5ji7gswjyN5ZGZ1I1ZpOqZAFdX2c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719941656; c=relaxed/simple; bh=jsNkkIXGs4/h3lv8BZLIzqEnp8c8kmrQBKCwKtjidUg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=TQNcHtb6xEn279srN/02kmwLnvgJWR2bsHeSRxjuXZpaxp5B76IRMvZEoSxSJnj36YVCprFkqk7uRvXTtrWKXSk4cj9TkZ64mRtnyD3ZXywr01kefP083ajZNXdL1kx4x9WjHenQLSwsuWlX/ggfgSzWJx7lJ61ICM9SnHYKNH0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=wjgEClSK; arc=none smtp.client-ip=209.85.167.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="wjgEClSK" Received: by mail-lf1-f44.google.com with SMTP id 2adb3069b0e04-52e8037f8a5so4373159e87.1 for ; Tue, 02 Jul 2024 10:34:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1719941651; x=1720546451; 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=E8NfF8jZGHkcRRoEHwh26DQAMmLR92lEfTyFLVBd7mk=; b=wjgEClSKZUgLm+5X2uffIcPZ8XKSVrPa9StW/UaOK5HuR6isRw6VJz5Abx/rf50QAK kXoyWi3gZXDLrOqoXcGEVlQADzT5gdleupF0ljteP8kq3rDZuTH8zQphgZd1z3BvunqE amG4Najj73fS73XTLLMMnVCA0nDi+RXZ82kYZDtzRelT5ljnj9cVx3pC2d5/EhEm5N4n saRx1qzD+F0MB2TwYFKRfia3C618gHwpIsLwWzJW41EjofybfJNFG1TYpFzI8yr9LsC2 oPGOhUyASfS+bYAyBzQ1P38qh+ni12suKkDrOHDSdrZ+kJ/0UNmx2bBUMiQ16vnxJ97j FiPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719941651; x=1720546451; 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=E8NfF8jZGHkcRRoEHwh26DQAMmLR92lEfTyFLVBd7mk=; b=MzuhlUlG/N6gIgH/fPZ3YHLbUdQVlisC4VOp81QdG7wHDbcaq/kqPrgE2tp9gw1ONU GlpN6djBisnwGGgHlxOe8aHQxKH7j2xXOWjbr2SOEDsm69EjiR54FuJHnXwNkpYDXBJO QQ/WgOtnbCogOiXNK5wdqLC8T/nwWcVznRhAJhLlDcnEQqnYMtUrZlDHJKJJH6Lxhd6J zPLnwIGTyiXM7wsEoO8TCXlIaWkkbqBFYeOl7RPttVojMSibRbYAeix/3NDvPruJgCEV Q6fiLb/okjWjykgNnM5owd6G+ZgjycPc6WlgG7YNVHXSrsT+lirlFSxeOgcu+JH1yPOQ uivA== X-Forwarded-Encrypted: i=1; AJvYcCV7RzgD4I7bzWzLU1pdYRz59XMu5e7OvexsbM8CICzefrbaLWiymO5IdojV7PtRaaqGA8zpwg4hU0vgxCh0R4xUl7howNMmEjPQKbFH X-Gm-Message-State: AOJu0YzOMIcBh9jmPbaP1JnC4lw+ZVjhzVRNhku7/mtFeRKlY/MzQwP3 J6sJxHjRFcFXzMQt9gCFxFzfJVfVXD63iGueYelAwhNUjVai3/HRMhd+HavsO5U= X-Google-Smtp-Source: AGHT+IGCaZQAPHw7/TMvFuKvssrA/aWcSDKW1tDQD+mxtwBkbk6h746EqKnqbXVQs/kfXAIlS+JTcQ== X-Received: by 2002:a05:6512:2355:b0:52c:b09e:136d with SMTP id 2adb3069b0e04-52e8268b415mr7979931e87.32.1719941650887; Tue, 02 Jul 2024 10:34:10 -0700 (PDT) Received: from [127.0.1.1] (frhb82016ds.ikexpress.com. [185.246.87.17]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4256af59732sm207594485e9.11.2024.07.02.10.34.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 10:34:10 -0700 (PDT) From: Guillaume Stols Date: Tue, 02 Jul 2024 17:34:12 +0000 Subject: [PATCH v3 8/8] iio: adc: ad7606: switch mutexes to scoped_guard Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240702-cleanup-ad7606-v3-8-57fd02a4e2aa@baylibre.com> References: <20240702-cleanup-ad7606-v3-0-57fd02a4e2aa@baylibre.com> In-Reply-To: <20240702-cleanup-ad7606-v3-0-57fd02a4e2aa@baylibre.com> To: Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Hennerich , linux-fbdev@vger.kernel.org, devicetree@vger.kernel.org, Jonathan Cameron , Guillaume Stols , jstephan@baylibre.com, dlechner@baylibre.com X-Mailer: b4 0.14.0 Switching to scoped_guard simplifies the code and avoids to take care to unlock the mutex in case of premature return. Signed-off-by: Guillaume Stols Reviewed-by: Nuno Sa --- drivers/iio/adc/ad7606.c | 39 +++++++++++++++------------------------ 1 file changed, 15 insertions(+), 24 deletions(-) diff --git a/drivers/iio/adc/ad7606.c b/drivers/iio/adc/ad7606.c index 50ccc245e314..539e4a8621fe 100644 --- a/drivers/iio/adc/ad7606.c +++ b/drivers/iio/adc/ad7606.c @@ -69,19 +69,17 @@ static int ad7606_reg_access(struct iio_dev *indio_dev, struct ad7606_state *st =3D iio_priv(indio_dev); int ret; =20 - mutex_lock(&st->lock); + guard(mutex)(&st->lock); + if (readval) { ret =3D st->bops->reg_read(st, reg); if (ret < 0) - goto err_unlock; + return ret; *readval =3D ret; - ret =3D 0; + return 0; } else { - ret =3D st->bops->reg_write(st, reg, writeval); + return st->bops->reg_write(st, reg, writeval); } -err_unlock: - mutex_unlock(&st->lock); - return ret; } =20 static int ad7606_read_samples(struct ad7606_state *st) @@ -124,19 +122,19 @@ static irqreturn_t ad7606_trigger_handler(int irq, vo= id *p) struct ad7606_state *st =3D iio_priv(indio_dev); int ret; =20 - mutex_lock(&st->lock); + guard(mutex)(&st->lock); =20 ret =3D ad7606_read_samples(st); - if (ret =3D=3D 0) - iio_push_to_buffers_with_timestamp(indio_dev, st->data, - iio_get_time_ns(indio_dev)); + if (ret) + goto error_ret; =20 + iio_push_to_buffers_with_timestamp(indio_dev, st->data, + iio_get_time_ns(indio_dev)); +error_ret: iio_trigger_notify_done(indio_dev->trig); /* The rising edge of the CONVST signal starts a new conversion. */ gpiod_set_value(st->gpio_convst, 1); =20 - mutex_unlock(&st->lock); - return IRQ_HANDLED; } =20 @@ -257,19 +255,17 @@ static int ad7606_write_raw(struct iio_dev *indio_dev, struct ad7606_state *st =3D iio_priv(indio_dev); int i, ret, ch =3D 0; =20 + guard(mutex)(&st->lock); + switch (mask) { case IIO_CHAN_INFO_SCALE: - mutex_lock(&st->lock); i =3D find_closest(val2, st->scale_avail, st->num_scales); if (st->sw_mode_en) ch =3D chan->address; ret =3D st->write_scale(indio_dev, ch, i); - if (ret < 0) { - mutex_unlock(&st->lock); + if (ret < 0) return ret; - } st->range[ch] =3D i; - mutex_unlock(&st->lock); =20 return 0; case IIO_CHAN_INFO_OVERSAMPLING_RATIO: @@ -277,14 +273,9 @@ static int ad7606_write_raw(struct iio_dev *indio_dev, return -EINVAL; i =3D find_closest(val, st->oversampling_avail, st->num_os_ratios); - mutex_lock(&st->lock); ret =3D st->write_os(indio_dev, i); - if (ret < 0) { - mutex_unlock(&st->lock); + if (ret < 0) return ret; - } - st->oversampling =3D st->oversampling_avail[i]; - mutex_unlock(&st->lock); =20 return 0; default: --=20 2.34.1