From patchwork Tue Jun 18 14:02:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guillaume Stols X-Patchwork-Id: 13702428 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (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 86CA416DC2D for ; Tue, 18 Jun 2024 14:02:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718719359; cv=none; b=nfUCS1Ox0QWESiqTuaxMByJLs8Fq1RmiommcNn534wV1Gjh+tJlCJ8QHTyAwEiNxclcbW4ykcrAzdwe9e+sy4Oq+JW5C04vwXlhxhGU6+hKEoCtlVjBuw7zpNfWEI9XR3Ld/FpnBsLWP/OUYFLCP9m4HRd7O67oSA5PzButnkbo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718719359; c=relaxed/simple; bh=PLtj7bSe++tHU1muE0ellbCUBsOVwaNLui/U8TXTses=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WrLv0HIR1+xb731nZV0MmTH0hRwOxZ2osDkuOwN5PSmrXyRu2KfE3qM5ymANFmy1O3m6T8DwN1GY7Znd6KkDK3vGJBabmGG4571uiv40prHw1g8z/kG2ZJB6+CFHHV/QgrjuZxhwGPz71/M3EF/D95/DDc8CtrqLw0W9439A6D8= 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=vypcjnui; arc=none smtp.client-ip=209.85.221.43 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="vypcjnui" Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-35f14af40c2so4574739f8f.0 for ; Tue, 18 Jun 2024 07:02:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718719355; x=1719324155; 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=uJg4U+PW9Snx8tG5VLs4l5kg/oNVaqq+3EVHHkcbQfc=; b=vypcjnuiJke07aPcLopSP2JneN2mnNHmsXw7xgLzXa8jq9pBV2NnxEs9W+AMySMcgx FPkt95Cny9Mdqq2ai6lF+rlm1p1WW9eVGUSCXhQT3AM3GENw2atiJQXAW2GK+o4WOtZZ Q7oJWFTF6MilkHHPKrpD90AS2Dvl/4qG9RHqvCkun8W36XnGuCK2WEz0fL7QFdPUXWp0 rkKohkFRmS5HFQbKZsS7dFJI7iM5uv5J9+Nw5F/qasNfFHJS/vDk5zMpZE6cO0FT1m58 Z27OzAdR0/8QGEE+zIwpmy8iGhrz982wj7bLXgayPypcH9dCwNfb+z42JC1jhOQwIYFw IM2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718719355; x=1719324155; 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=uJg4U+PW9Snx8tG5VLs4l5kg/oNVaqq+3EVHHkcbQfc=; b=agx7gAvmcOqD9tKlZjzTfGv5uzfD3ZoDuRlXf2JgUI3oDN9kI7ka9a+0nbGUClHcuj scsfdejS++kMwiP8QZHWLLRhwyGANHbCi/DbGi5+HdeSgED8YFtszPA6lfMioin/OflT yIwVapC5fXdpO3DdwLRW/WGMGR5Yv86f9NAzu1sLMjvLMD5AmwC6Ge3W+pttmH5paHiL eZW6IxS7N7m1rpu0fYsx/eV1GvwjVWneYHHiXdFsdeZLfbonF7kZ9Oi8tpEuCjZ22cu1 sVonx1/6o2v3QZhmhrdrGHZSEQmG3Fxt+G8HvxOBkSY7xN1SDaN3lj78SzUAfC7BbLHq UeCA== X-Forwarded-Encrypted: i=1; AJvYcCVn7oZKu6ZHjzl3pVQpwuksEMzL76DVx0/oXx+Wwfvw12hufXYuN6SuEdibzCk28ozIR+uP6r3QFVR462Uix5m4K8kJGLfgREB+HQc= X-Gm-Message-State: AOJu0YxDeG0e4IGcuPeQ29tcgAzYdL9i+b7KSY4HBWmSbypiQvHOBkTo pEW/04KckX7e0IaV5SIs1Qye/ypcNeQ9Ry/nwD/jhZd3H5WNeF5yA7sV3KDMujo= X-Google-Smtp-Source: AGHT+IEpUUcK2t2NT0uyE9LsIkX7F9ePlZPM6Wgs49S7h0PwgLnOw5XdUvtGqV7G0aa932wJUiWaZg== X-Received: by 2002:a5d:5607:0:b0:362:ea80:db0d with SMTP id ffacd0b85a97d-362ea80dc64mr155775f8f.11.1718719354954; Tue, 18 Jun 2024 07:02:34 -0700 (PDT) Received: from [127.0.1.1] (frhb82016ds.ikexpress.com. [185.246.87.17]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-360750f22absm14412546f8f.79.2024.06.18.07.02.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jun 2024 07:02:34 -0700 (PDT) From: Guillaume Stols Date: Tue, 18 Jun 2024 14:02:33 +0000 Subject: [PATCH 1/9] dt-bindings: iio: adc: adi,ad7606: add missing datasheet link Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240618-cleanup-ad7606-v1-1-f1854d5c779d@baylibre.com> References: <20240618-cleanup-ad7606-v1-0-f1854d5c779d@baylibre.com> In-Reply-To: <20240618-cleanup-ad7606-v1-0-f1854d5c779d@baylibre.com> To: Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Beniamin Bia , Stefan Popa 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 Add AD7606-5 datasheet link. Signed-off-by: Guillaume Stols Acked-by: Rob Herring (Arm) --- Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml index 7fa46df1f4fb..d55c58400df5 100644 --- a/Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml @@ -11,6 +11,7 @@ maintainers: description: | Analog Devices AD7606 Simultaneous Sampling ADC + https://www.analog.com/media/en/technical-documentation/data-sheets/AD7605-4.pdf https://www.analog.com/media/en/technical-documentation/data-sheets/ad7606_7606-6_7606-4.pdf https://www.analog.com/media/en/technical-documentation/data-sheets/AD7606B.pdf https://www.analog.com/media/en/technical-documentation/data-sheets/AD7616.pdf From patchwork Tue Jun 18 14:02:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guillaume Stols X-Patchwork-Id: 13702429 Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (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 C8CB816DC3F for ; Tue, 18 Jun 2024 14:02:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718719359; cv=none; b=Vhl998lFxLdyrqQcW4HROdFWYTjkVWZdSd1yOsGO7hGMPwWMqal+7rKvb5R9vdetAE3ya7REPH7atmSodbRgrM/6iGjN6DkiEsGOGlIb4pQZz+Qkkg3NAjE39Xlnoihgx+ROytutAoT/QRw2Jd5YnzCD2zfll73QT1Wpred6C64= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718719359; c=relaxed/simple; bh=fMDqf1KM7W/RA77rezMz3nE602KNHtmJiEMO09XyypI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=mutdELBoTBpmmvvjX7TYuhuRVJye9muGUs8q3Birl1dLHkPb6XV18rs7a8ykG5L7ZRgQheI7hiBHDDQId0wgwMHvd6+3Ky9Ao8FIsHmd7u/h+5ruUEW7FDJVvjG/EeVCtA3zLIAxLEWcrVuTy4pWDo5jzkiMigZxzMBDTwtQJRw= 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=g8K4zTrc; arc=none smtp.client-ip=209.85.221.51 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="g8K4zTrc" Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-35f1dc4ab9aso4506277f8f.3 for ; Tue, 18 Jun 2024 07:02:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718719356; x=1719324156; 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=6PSO/1gMPYozHX3dfKEvclJiI5tF+MksrCbjn3VycYQ=; b=g8K4zTrcB5EEc2FjvPAPTibOgigNssdsV0Nav1MvTRwvBEVeKKcNyCf350+kHi1RAH vaDci42ni4P+wOPxWdToieOVNFY4ssEsd8GmFNH6B0p6BFfsYUOZ6li14l2kfbJZI7+u 5aF9XLQQVHY7zqc71qz5/tbc4wnAFU7u0xv8EA89jwNXgOdc99zzCEnqohzanEDLsYzn d4FjMocb0KXlkvti6BbNhsXCAr/dG5cR4M9tEDbvp0lwSZ4QmmZ59/IMivxMe+204EBr SaGcZzGpz+KUk98e8pFOc63fkqgOYh7RZZHCom7GJmd9ovd9v2stUaSwGHx/9G42oyuw meOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718719356; x=1719324156; 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=6PSO/1gMPYozHX3dfKEvclJiI5tF+MksrCbjn3VycYQ=; b=OX4vf145gL6NLWPsu1hSE2IsZBZHCLPKaKZC8gEs9jYerz84bqYxTZ54AxRSP2wVqm leFSforUYmgrdsEtgK9XTJzlnNTFsUee00w5xsV01U6i7UiDJLFjU+c0HeMsMjTncT01 +pwBQXQ68X7UiQi83HB41mUwPwQVQUvOCV+/NBtSpY/MhBd3BWoGer4/aopWDK5SLAaH C8XmjMivco0lUc5nEMcihKhdRpT4n1x2itaP01W1tTrsnfK3ierPg9n27+9QBmm62ZsF lT26elx0P3wrwAR6zfXQw0mtKbOTJ3qpkFFfGmGWsirTKRUSZtvFqYZ3Bz9TIahgCQfH o1Ag== X-Forwarded-Encrypted: i=1; AJvYcCX9njwuH2Zd38LWhPy8j6yTSFFbQ791tbTytJ/+WOTej6kNidddtaTSu0e0VON8UhECLBBv6jHjaZxDNBBb351Ru8RvH6LHKP/logQ= X-Gm-Message-State: AOJu0Yy4PclLuB6XqVLFIhMIBjf9VKIJw3WzIZbbwmV+l0T1XLE3/dCt zXGFCigtagHcaqYeVOvqsI4qMk+1O2QHxvFCXXyn/Kt+pmsm+8g/Ybl82C3EVF0= X-Google-Smtp-Source: AGHT+IFhaLPzqepPaG30Gpc5wKJD8gFH+IxtsauFUs+mCd/Kver+eAIQm2Ywl7oZ1ItrgT/c7vP4Wg== X-Received: by 2002:a5d:6192:0:b0:362:6e61:a342 with SMTP id ffacd0b85a97d-3626e61a39bmr1041071f8f.36.1718719355495; Tue, 18 Jun 2024 07:02:35 -0700 (PDT) Received: from [127.0.1.1] (frhb82016ds.ikexpress.com. [185.246.87.17]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-360750f22absm14412546f8f.79.2024.06.18.07.02.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jun 2024 07:02:35 -0700 (PDT) From: Guillaume Stols Date: Tue, 18 Jun 2024 14:02:34 +0000 Subject: [PATCH 2/9] dt-bindings: iio: adc: adi,ad7606: comment and sort the compatible names Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240618-cleanup-ad7606-v1-2-f1854d5c779d@baylibre.com> References: <20240618-cleanup-ad7606-v1-0-f1854d5c779d@baylibre.com> In-Reply-To: <20240618-cleanup-ad7606-v1-0-f1854d5c779d@baylibre.com> To: Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Beniamin Bia , Stefan Popa 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 AD7606-8 is referred to as AD7606 by Analog Devices. This comment aims to avoid confusion. Also the compatible names were not sorted by alphabetical order. Signed-off-by: Guillaume Stols Acked-by: Rob Herring (Arm) --- Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml index d55c58400df5..00fdaed11cbd 100644 --- a/Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml @@ -20,9 +20,9 @@ properties: compatible: enum: - adi,ad7605-4 - - adi,ad7606-8 - - adi,ad7606-6 - adi,ad7606-4 + - adi,ad7606-6 + - adi,ad7606-8 # Referred to as AD7606 (without -8) in the datasheet - adi,ad7606b - adi,ad7616 From patchwork Tue Jun 18 14:02:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Guillaume Stols X-Patchwork-Id: 13702431 Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) (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 3864D16EB46 for ; Tue, 18 Jun 2024 14:02:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718719360; cv=none; b=fZBejQFOid5rIM1tp97/cjCFLriZBjxdchc5szRhTY8lMyUxqXNk5xmJQXe43YvLcZEXwRf/pMEKnEEjXbazTChCpNdEg7gVgZle85GMX7MHr+3GtSVHA0visAyYFxloRYwZf5FuNyseojfTCdCGQKigDjvlNOZ4aTyM5N6dw20= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718719360; c=relaxed/simple; bh=AeL4Pk19lY57evpSum6bOchrffJafZiZaW5AICh7VeE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WcWXEVPeKGx0ix4Wv8ZC6GRn0SZhZQyuoO15pBFWoGXc9coCEMJAqtrXVWsTDvYp9CGtPGJS89COiiv1hQfjovMb17uRNvW4A2bww/MfpAGz97Wj5UKDbYtLxbzS0px3csBVsNDiMN0DA5K5mYrV8OkR3WXy7Z7pAIZVKbdmmuo= 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=3d+5culG; arc=none smtp.client-ip=209.85.167.51 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="3d+5culG" Received: by mail-lf1-f51.google.com with SMTP id 2adb3069b0e04-52c8ddc2b29so5944556e87.3 for ; Tue, 18 Jun 2024 07:02:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718719356; x=1719324156; 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=9SeP0fiD+XkWTbLmWwucHAiPV/yHkLPDQUL8k4EXkjc=; b=3d+5culGlVfvKz6fRwxst8suLhL5+V+rh7bisVfjUh2Rd1KBP74kxaXWvPEYWydgi6 30hiHcXFgBFPoyK65kb5y0nYsoviaFPs5aDZ7XXFhgBVkFsMlJdXr/b4PpXa0htnmmDF FIQOHJNng+W4sZrlmtjB5rzIHVq0GjljaCsQ1PrCWztkpaA44v6+Y4dH5I7V7cefdWYb dC5hMyxhqYUarHd7QGiIi5sKOz5pQO3izOtOcP9+OYR2PKS96xzJkRi9qG2Z17QFpS9i dQym1nWHGWvTgFBtEmnHjIucu+6DBzund11WhuAl3MsnH0EYKXOmKYAUNhPOy3qlrG8i bl7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718719356; x=1719324156; 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=9SeP0fiD+XkWTbLmWwucHAiPV/yHkLPDQUL8k4EXkjc=; b=f9VQcAVKlYDlrD4OzvBEVivg/M1/P7U+FTXzcR2MQMEn0GKSwt4K79VXAdzHMXUGXp OMSeV2jJ9uCsxgMyYkQT4uj2AKt4efdfpIBP8cY8nw1P+7KKolV3x/jhFWbyTwY5lS81 VV3QhPQBJ04ym8EmhnNaQ1R+sNlnADLkIyh+pRu5/DYaayUJhqdS0Qs3NGgkKLNem7F4 vGTa+kiTzul+Q1Lvq5I45EPlnno5VPzkgI1JeC7ADgcu4amEE5zY7RHbr0HJXc5vk/52 XMznEcLhYvZewHDmCH1zUZ15TOEmshW/8zZzCAq24DVeubLiZvTFemh7esoTEdmcKguj 6DyQ== X-Forwarded-Encrypted: i=1; AJvYcCV5mi+/dNtdRhzhja7x2MusNDxxfNgor02XRQKJYtR+44ROofKjhT8hHoksE0FFcNj3cW9Q4JN7iAdYZsm8GqZPsJnKY5hI3r5Sr5Y= X-Gm-Message-State: AOJu0Yy+HJfEYT1sjcPalfmLscEHH5Yj0AGe3nu63vaUjXPTDKFPMMNc 1C10jrQ2OH/+l9tUO/f2UUFaenkYYmc6egApRVVgc94AgnyLQjVHc1hL2+9JC40= X-Google-Smtp-Source: AGHT+IEY5B0LzHI9+FwCWaKQXo1GE1Kli8+qybz/4z9W/1TjwNEVska4Fq3q9/R21mxYrGGIzpCLCg== X-Received: by 2002:a05:6512:280d:b0:52c:adc4:137c with SMTP id 2adb3069b0e04-52cadc414a1mr10544387e87.20.1718719356086; Tue, 18 Jun 2024 07:02:36 -0700 (PDT) Received: from [127.0.1.1] (frhb82016ds.ikexpress.com. [185.246.87.17]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-360750f22absm14412546f8f.79.2024.06.18.07.02.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jun 2024 07:02:35 -0700 (PDT) From: Guillaume Stols Date: Tue, 18 Jun 2024 14:02:35 +0000 Subject: [PATCH 3/9] dt-bindings: iio: adc: adi,ad7606: improve descriptions Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240618-cleanup-ad7606-v1-3-f1854d5c779d@baylibre.com> References: <20240618-cleanup-ad7606-v1-0-f1854d5c779d@baylibre.com> In-Reply-To: <20240618-cleanup-ad7606-v1-0-f1854d5c779d@baylibre.com> To: Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Beniamin Bia , Stefan Popa 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. Signed-off-by: Guillaume Stols --- .../devicetree/bindings/iio/adc/adi,ad7606.yaml | 61 ++++++++++++---------- 1 file changed, 34 insertions(+), 27 deletions(-) diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml index 00fdaed11cbd..80866940123c 100644 --- a/Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml @@ -36,64 +36,71 @@ properties: avcc-supply: true interrupts: + description: + The BUSY pin falling edge indicates that the conversion is over, and thus + new data is available. maxItems: 1 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(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. maxItems: 1 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, it will + be asserted during driver probe. On the AD7606x, as the line is active + high, it should be marked GPIO_ACTIVE_HIGH. On the AD7616, as the line is + active low, it should be marked GPIO_ACTIVE_LOW. maxItems: 1 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 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 either + the parallel, byte or serial interface. As the line is active + high, it should be marked GPIO_ACTIVE_HIGH. maxItems: 1 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 ±10V for - all channels. If this pin is tied to a logic low, the analog input range + Must be the device tree identifier of the RANGE pin. The state 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 ±10V for all channels. + On the AD760X, if this pin is tied to a logic low, the analog input range is ±5V for all channels. As the line is active high, it should be marked - GPIO_ACTIVE_HIGH. + 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. maxItems: 1 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. As the + line is active high, it should be marked GPIO_ACTIVE_HIGH. On the AD7606X + parts that support it, if all 3 pins are tied to a logic high, software + mode is enabled. maxItems: 3 adi,sw-mode: description: - Software mode of operation, so far available only for ad7616 and ad7606b. - 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 will set the - oversampling gpios to high. Otherwise, it is assumed that the pins are hardwired - to VDD. + Software mode of operation, so far available only for AD7616 and AD7606b. + It is enabled when all three oversampling mode pins are connected to high + level for the AD7606B, or all two range selection pins 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 required: From patchwork Tue Jun 18 14:02:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guillaume Stols X-Patchwork-Id: 13702430 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 32ED516EB44 for ; Tue, 18 Jun 2024 14:02:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718719360; cv=none; b=MpfGRE6Invbml5Nkmy9wsHDgU/XM8YuthA6PWQkt6nIW6k+MOKCWPcmrWoAfAnLSV+id75l3wER/aD55M5JbAKg3OeHLZUBX+c9KQVtqf6CoojT/63BC6LN8Wkp6YQff8+NWvHvKiz1aPfP3e9goaMm5ashV9OyhXZkl6uxt7so= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718719360; c=relaxed/simple; bh=cWqIUPEPN7Udkq4+lFTiE2RXC6AoRwx5p3drvRYtbjY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=b4ZSCg32VDasG4SxpGayihntxGgxl9UwY6hLy422tSWUOjlKR3pdUsfYVxc9tRo84H0c42FCcT8Q2+x5oVmCzgoyj6xQwTfalQRiCo+OaLNQZsiJsttIO+sXW1N71OXipwcN6MsBMLQEh6l0B/dVXm+tmwq6BarOJEAW76ojJ6c= 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=vHcANnZj; arc=none smtp.client-ip=209.85.128.49 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="vHcANnZj" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-4218180a122so39077955e9.1 for ; Tue, 18 Jun 2024 07:02:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718719356; x=1719324156; 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=4Wrqm5DzrB9rfiL9awg4tiFTM9PHAHUELJgH4ibg92I=; b=vHcANnZjlBkre4EVmaL8tGKwfZYGinBHtZB2QV/GzNNqhcDLAxo+ykSOXMcHZNEx4F Q2jxQW1MAR/HA94+Z7CXpcGwyuW5QMQpSU3/wrCdUgtYwykd0/zznidOBimAsM+fMYZF 5X1/yZEs+iX323dApLuN/qg40Io1Lq9pPEvznmlPNaKKgFIzoyOWtS6GH2IBHjlFob6X d2J0c7JoQEOMGjDOG61XLqYS5+76WZFFDRiHDiqWP9xiGc3OxUk92hZnKmUX65HLzVM+ aBZwcSk7Bhg8EUrwhq4cGb3GzXrqP/cR7NYKyTULfZeVWdQUd6dfBsG9bGpeifWG5Rnu 1cOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718719356; x=1719324156; 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=4Wrqm5DzrB9rfiL9awg4tiFTM9PHAHUELJgH4ibg92I=; b=AXE4Wx9yqDNbyWxdfCPXP4cf8Wr6bP7yKspQcjLz/ad/fHYZlML3nf/oGOeZw2O+We kJNp0ofPvO/VO4oLlSS0eu3PU+c/ynGdpg2FQkRDwyfwqSFJr0RbWWxhKxjEUk7qsi57 0pQAxVTXKJqTWdnNRSpVG/yA1TcTqBHnJgwUBq36i/4uCSYEIo5u2vX43v+gl0GZAy+t YCLaIlGFTn1sCr3K2mg54far3QaVK5PhbJ7abLHmU5R/hQPckAqlRdGPq2s/kxlW662A VZlColFfobYXRPMPnRSyAFPCc7I90NrEd5qlHxabDXXNd8G7Ry0McZW/0oooOPVevZBa 7lFQ== X-Forwarded-Encrypted: i=1; AJvYcCVYVeilKTI1nt5lywfgVaWeW6eGahdP8kM9bKn2AVdjtK01G8fqBugWBo+s6eZL8Nd0uDUaxZpxF9Q1vFE/GJvVROU4MOeDBwFTrU8= X-Gm-Message-State: AOJu0YyUfKsy/nB45OzRlW+0Ehnze0WscyN0W6Eo6vY9Vnxqnqoh4atK yA7F+6OAu2MRIDu3nKXLg/v1Ks0NhSXFNnSqM8J+EYR15Ds+1MH7fiZfSRMe000= X-Google-Smtp-Source: AGHT+IGeSMCl1GadLFgkDPuhpwEcL3FXopw0KUDqKdsouTUQDtdzzlakx+O+Eto4p6nRE0Ptb091YA== X-Received: by 2002:a05:6000:b42:b0:361:fd04:95ed with SMTP id ffacd0b85a97d-361fd0496a1mr1497363f8f.15.1718719356709; Tue, 18 Jun 2024 07:02:36 -0700 (PDT) Received: from [127.0.1.1] (frhb82016ds.ikexpress.com. [185.246.87.17]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-360750f22absm14412546f8f.79.2024.06.18.07.02.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jun 2024 07:02:36 -0700 (PDT) From: Guillaume Stols Date: Tue, 18 Jun 2024 14:02:36 +0000 Subject: [PATCH 4/9] dt-bindings: iio: adc: adi,ad7606: add supply properties Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240618-cleanup-ad7606-v1-4-f1854d5c779d@baylibre.com> References: <20240618-cleanup-ad7606-v1-0-f1854d5c779d@baylibre.com> In-Reply-To: <20240618-cleanup-ad7606-v1-0-f1854d5c779d@baylibre.com> To: Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Beniamin Bia , Stefan Popa 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 Add voltage supplies Signed-off-by: Guillaume Stols Acked-by: Conor Dooley --- Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml index 80866940123c..e480c9a7c7ca 100644 --- a/Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml @@ -35,6 +35,15 @@ properties: avcc-supply: true + 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 From patchwork Tue Jun 18 14:02:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guillaume Stols X-Patchwork-Id: 13702432 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (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 DAEF816EB5A for ; Tue, 18 Jun 2024 14:02:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718719362; cv=none; b=NYlYS19cXdscEdi7bk3QJhNj2XyIsSGnLtcpYSjzMTKs/mnZzqmRYPyqmMWAdy7zfVF7a1XQaT9aCmsEIbY9EcczQZKwkHWXUBt+Su0XJFh4FLiWG9t/e6h3EuZvhaaLvj7EQsZO4N6qxg7fVyQjOBnnrpVtDHovA9SGPlnMXKE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718719362; c=relaxed/simple; bh=Dg4uCUMceVWgsRkJ2KhN7U4MEvxhzasTmCDw03bT0EE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UzC4RT9O1uGP8f689lbDx0QTfzNXIHUYZMicMvF/jpeNVshwqBjLXi1cefjfbem8cTWxUDFNr0rGz3M8EG9IedAylbLYxagWliGPkRvIfGs3O0DOUXnNfh3k3ifa5oftMM4xVBm9jTc09zA9UJ3y5MBSFTN7VzLfeDYEnHcEg8E= 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=xj0YLYiX; arc=none smtp.client-ip=209.85.221.42 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="xj0YLYiX" Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-35f236a563cso4309794f8f.2 for ; Tue, 18 Jun 2024 07:02:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718719357; x=1719324157; 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=UGD/hgLLXAT/g5axsjVVgJLnf9y+tbpA9Y5GEUxIfgU=; b=xj0YLYiXLHxV4U/303CDwBc/IzVZDtF2GumC9oprxLUqcu/hVOAorem9Hs1ImxPZfJ QE4RRw6mB/4gUMIq/aWrd5e+bGDDwk8yTTNNkVt2n8pAkcnYSqRYqFFEdKEnq1m5Twqz T4D5hOUK4POcbZq/dweQ2yf6pW721TP/d4vgTXuDM6vI3Y3O4pCShNfm6KD0Oxdw9Wr+ XjeWHehc6i6wBDfn6ZvvIR47kMJJIES4Ju2CbWH3rIH24CRR7ZEN9olmhah16kNb95vR 1hbuwGLBiXCXdiKEgJ3e40Kjs2QCRum12IVwJQlLX0CZk607QdErt90OKegHkkuEMdhL NK6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718719357; x=1719324157; 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=UGD/hgLLXAT/g5axsjVVgJLnf9y+tbpA9Y5GEUxIfgU=; b=BqRWdiiT78PeGseJTKttQJ2xwe4jrTEPqdsEt5g1wZbKglkpghEVS3aqv53zfAknSX zEajzQ59imjfx3i+x3lCfsNvdyd3Z7qVNVvOU4WlFi9IyAI+JzhyJYupHasdR4QRGZ4o So5dq13r4oNQEUJ7QpUqzfAD4N8SbD/Hs8bIrwmIHhqpQ3ok/fwDwI6YofqeIdFbhwOt pSRRfdLvrhCMbvq5g4ibconNB74byL4uwLTK2/p6FnXQSWJHx7mLf5gVmVI3K4+3NNaZ XqoDzOJNPqinfX671yj/svAO8kYYirmbFzqkOE0Ir/To+7ZY3KRp48bBcZo2PzZED94Z f9MQ== X-Forwarded-Encrypted: i=1; AJvYcCVvlJ9aaxGrlL03LLpnx26Xt+/p/gY1kUPBnt77CHyNOlxRVrhrU+S39f2iSvY9aBuA8SlolSndjtOz8KnWctG+kQs6w4z6Sk/84jA= X-Gm-Message-State: AOJu0YxdKouQ3JafvduDYAFtha64slm3quvWrlO0X88lpd/mg6cryiX3 8LEPzBZpLiG82dLbyDhVMJaRYyJSXXhfroSc2iuKflOlM5e9TwLe7zcm6rJ1hvo= X-Google-Smtp-Source: AGHT+IHFuggadGWzuwPQ5BQ96caDqox/xXR0j4uFJ20Kej5bsP8G8KLJpvUeKbdPACifYPBZrEKCOg== X-Received: by 2002:a05:6000:1e90:b0:35f:1c3c:56b8 with SMTP id ffacd0b85a97d-3607a76242emr8887364f8f.36.1718719357245; Tue, 18 Jun 2024 07:02:37 -0700 (PDT) Received: from [127.0.1.1] (frhb82016ds.ikexpress.com. [185.246.87.17]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-360750f22absm14412546f8f.79.2024.06.18.07.02.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jun 2024 07:02:36 -0700 (PDT) From: Guillaume Stols Date: Tue, 18 Jun 2024 14:02:37 +0000 Subject: [PATCH 5/9] dt-bindings: iio: adc: adi,ad7606: add conditions Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240618-cleanup-ad7606-v1-5-f1854d5c779d@baylibre.com> References: <20240618-cleanup-ad7606-v1-0-f1854d5c779d@baylibre.com> In-Reply-To: <20240618-cleanup-ad7606-v1-0-f1854d5c779d@baylibre.com> To: Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Beniamin Bia , Stefan Popa 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 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. Signed-off-by: Guillaume Stols Reviewed-by: Conor Dooley --- .../devicetree/bindings/iio/adc/adi,ad7606.yaml | 50 +++++++++++++++++++++- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml index e480c9a7c7ca..65d6ca5843d7 100644 --- a/Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml @@ -55,7 +55,8 @@ properties: 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. - maxItems: 1 + minItems: 1 + maxItems: 2 reset-gpios: description: @@ -91,7 +92,8 @@ properties: 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. - maxItems: 1 + minItems: 1 + maxItems: 2 adi,oversampling-ratio-gpios: description: @@ -123,6 +125,50 @@ required: allOf: - $ref: /schemas/spi/spi-peripheral-props.yaml# + - 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 examples: From patchwork Tue Jun 18 14:02:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guillaume Stols X-Patchwork-Id: 13702433 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (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 E1FFC1AB8EC for ; Tue, 18 Jun 2024 14:02:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718719362; cv=none; b=Jk/v9O6ua7EGIs/O0ujf5kn9JD8c22wx7nsRJBDagbYau01CEyrXBkSZSPRivy5gf2fxrZXxK9goZqifBDaJJ5WkAcp2ecETp7drfjClK0Ibjwh5KWrjBOMwRxy9rHqNK3afKgfqJICpnO9r4Kd2BR/DA0WmcBayzoqwBoHBrI0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718719362; c=relaxed/simple; bh=A6kuif+EaXqoEMG7xaj25XS2KcSl5ZJh9WVTl3nCKxU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BSrnPma6BcmxigZrU8/ic1rMjd5nw9mrEwawJoEt7+yIzIzr8miLO8q+Mkf3wp4eigdxq8ByNkZnea0xydegWYrgG2ocH9/YuC7Cuur6qk2keKR3KdqMDXSXlKMl5pImgFdwao5036Q8zuVQS0023d18D4EkueHSCRHjDzt5bV8= 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=XXddTLld; arc=none smtp.client-ip=209.85.221.43 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="XXddTLld" Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-35f1e35156cso4723014f8f.1 for ; Tue, 18 Jun 2024 07:02:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718719358; x=1719324158; 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=C7A2H1vn46bs7vzUe2mxoJ5kUKOzuhCfRLK3RT+N/4k=; b=XXddTLldNAA7MBCQpQPNTn7HWZjIRyinpb8AAxMUtd4gElKlQhSMTx4sSi3d6SMGcB z7vi3z2cl2NYZq1NymiN6u2YL/rWVYuJjka+SYKf2tQfF22dC9yPlXnSccHDjmzkl7mS Z0ffF6IhwVK/EdtDeF7FwyIcJEUoZ3GTSIPuhNzdYkWli7lZxYopsnJOWLObllj4Ggt/ 8Grns8DyRYzKSI54ZGrHTRbaF9VgIsvfu76RRVV4yylQBheSVSHy13QxSWEjg65A4By6 ypdzTTvCkfXBZ9Ap8xqb4JxXuhiuQqcIu4u2+3j9o4ThnXgUbas7su7/TNhT/4XFYW+3 dskQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718719358; x=1719324158; 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=C7A2H1vn46bs7vzUe2mxoJ5kUKOzuhCfRLK3RT+N/4k=; b=JXCQ0UUFw7LjccSsecBt3x7C/feKbbP3YnGqmZKLHblaeF4aAfTs26TRo4M4xPkptX uVEraSJeVb3688LaIDiwU7w5Bt8h2tqg4E8fqYXs94FDXL8v1cxybLRmDTD5yVaNE/X+ qpz3+cSlrAguXvpwUxjiDDmwqJ9ZxWYaY8unBfEsyGKD7n2ZJZcinaznwGUWoTjA7nvw FLGHp3yUmNOOq25MT526JbDXKNKyICOwVYKHykfSHq6DzRcT7sTbdazzz0l0ZRqB7Kks dpTu8bzOun7tKju9EIjd8slwsP1DdPJWY5AzziyocY3YRlq20XlMxMAKdS9MkJy5AIZy 6lqg== X-Forwarded-Encrypted: i=1; AJvYcCVcs6yb2IeQ8IXPgd1FgN1oNaUczwgFMjus4AXlZ/eiSEaicBOs7kfikDA8Y/CmW0lEpwOG4yVS6Exi2JDhtgh+//7LKquANfs9Ack= X-Gm-Message-State: AOJu0Ywqinv7RHcqpC02P9SUWD/yd6KPYraCNfhZNu3mkfRzrfruMQWN KxhpZJUzk+3ghHeBCjwNswRKtTD23J1aEAfmclJ/oT0tUcU1BUpaHpR1FtPW36Y= X-Google-Smtp-Source: AGHT+IFveMAeeYnGXlbgaKPbEE636y3oEz+xbQvRxeYUKyvxdbSUC2rC5BJCZhSUrFoLatWxvWuhBw== X-Received: by 2002:a5d:6901:0:b0:360:8269:5690 with SMTP id ffacd0b85a97d-36082695cdamr7690748f8f.17.1718719357775; Tue, 18 Jun 2024 07:02:37 -0700 (PDT) Received: from [127.0.1.1] (frhb82016ds.ikexpress.com. [185.246.87.17]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-360750f22absm14412546f8f.79.2024.06.18.07.02.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jun 2024 07:02:37 -0700 (PDT) From: Guillaume Stols Date: Tue, 18 Jun 2024 14:02:38 +0000 Subject: [PATCH 6/9] dt-bindings: iio: adc: adi,ad7606: fix example Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240618-cleanup-ad7606-v1-6-f1854d5c779d@baylibre.com> References: <20240618-cleanup-ad7606-v1-0-f1854d5c779d@baylibre.com> In-Reply-To: <20240618-cleanup-ad7606-v1-0-f1854d5c779d@baylibre.com> To: Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Beniamin Bia , Stefan Popa 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 Example uses adi,ad7606-8 as compatible, but adi,sw-mode is not available for it. So remove this property from example. Signed-off-by: Guillaume Stols Acked-by: Conor Dooley --- 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/Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml index 65d6ca5843d7..a8fb0d926859 100644 --- a/Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml @@ -198,7 +198,6 @@ examples: <&gpio 23 GPIO_ACTIVE_HIGH>, <&gpio 26 GPIO_ACTIVE_HIGH>; standby-gpios = <&gpio 24 GPIO_ACTIVE_LOW>; - adi,sw-mode; }; }; ... From patchwork Tue Jun 18 14:02:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guillaume Stols X-Patchwork-Id: 13702435 Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) (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 33D151AB919 for ; Tue, 18 Jun 2024 14:02:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718719364; cv=none; b=FWWP9fvBwueGQMM1WUWOj1fy+umK4gjAPCuREd19laBYcpQup5+l9/ikyrMcpmiisV01dtlpyZmi7JRwHalPBK0p9xuHDVKHD2RpMiqr8NAFAP7TzIsGuQBwwBZ80kVFLeHhLLUtCe8j9Wn4w4jF/xFc+fQ3+SK2RlJW82dFv8g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718719364; c=relaxed/simple; bh=QmIv781VGnh+ryUYXx1F6xEK9035NP0/VEuO/oa1M9c=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=EL/NxghrwslRBpU27UH8blCFms1fxR9gnjVBhDqMM/uktNMWrqT28Z7ecN4aMtrXJwdpnoYfvCf+kT8VOrvXflTAKhpUfeu39GHrJUykQ4V9xt+HN3YnBTzAGSVX6Hqe+FLn4OaJDVx8wxhBI5ec2pwlzdHeiATHUNdVWMb415E= 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=ohKtDfAW; arc=none smtp.client-ip=209.85.167.42 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="ohKtDfAW" Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-52c525257feso7085179e87.1 for ; Tue, 18 Jun 2024 07:02:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718719358; x=1719324158; 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=iI4ADRyyzg0pZX/pPb/PmIK3doCtooaUT1uP9pqm4FQ=; b=ohKtDfAWXiBKfE+4MAHaz94DbyynxLd/BJICDyyhmBA8gD0M4xYqBXpVmUNHUGeKWw DwT+gqU4bqqakAFMpG1vXkgMA3YJP/luCFOrYwC1nzQjSS/UUuXdSf2f6risr73DPEvz zOA+0KdRPZ8ubD+fgzRlhuRmB2kSRLeT1W+4xG57WnUkRaFomzQjALT2CNw5o0a5nz5x EX5ov+NKAykBjBlq9tD0Ff+xBHuFOxdv3L2QKrydl8003kJyoZUF9SND0hGk/7siknwJ tZx+0d97LU9niYpjuMexauD347ecvnZRpSYx3T1GtFuUi/qHuq6G9cBJSrqMgczbrZWM 82Gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718719358; x=1719324158; 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=iI4ADRyyzg0pZX/pPb/PmIK3doCtooaUT1uP9pqm4FQ=; b=ht9XnTUK0dWA0dA5W0B+JWMbBB95n0SMLdG46YtqxNEzriPaPBj2JbEsZybv5m+Hye lR827b0PIYBBWW4mtBIiNlDgfDAAnibVQZU8og7OxCSuAGoZOU2KWaP8Us9kxTLyQXmO WKl8ELQ6dCalxQublVmC3yqHjdPRSb2Lnbamv5IS8PnMnpkhSJErADl/Ve32d5ONcOS9 EtRVQ+Tz4SAM4LK50N/oNMpj5ZCvLdqBv98OXNNzg2FOI5YwKerEksxNIIWvmNyKLrIG UkQTYqL0bZQujew7DZaZIR264f8C3aM3hAI+0RCyTISIvYgW04y7CqfnDO/0c/7HJ2Hj WqnA== X-Forwarded-Encrypted: i=1; AJvYcCV06n+xqlXHcXAamY7gCIGANyCEy36N092vwPYxc8WD3jJhB53iaaK0rd2wVPX5wi4QEqyvIc4X+dI0nOmSSy48I+Mo3VRqGAncERw= X-Gm-Message-State: AOJu0YxkXZ8nHKvQbnyGNCOgmKiBRzIodWX+tDaO9PaGRA+msUJuDQes BDvj6xtpJ2k2mW0STihfpmsUTF/gbxQdFgQRQPKNls05hwYoTsPcZxKrOB2r9ZM= X-Google-Smtp-Source: AGHT+IHBu4z952wNs7NhOwlF6llGWnDm5ZPTxh7b2obRWVw6BiFyuLwn+c+TGhzkzw2h3HLjRG9iow== X-Received: by 2002:ac2:58c8:0:b0:52c:9e25:978d with SMTP id 2adb3069b0e04-52ca6e8fe35mr7316607e87.45.1718719358335; Tue, 18 Jun 2024 07:02:38 -0700 (PDT) Received: from [127.0.1.1] (frhb82016ds.ikexpress.com. [185.246.87.17]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-360750f22absm14412546f8f.79.2024.06.18.07.02.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jun 2024 07:02:38 -0700 (PDT) From: Guillaume Stols Date: Tue, 18 Jun 2024 14:02:39 +0000 Subject: [PATCH 7/9] iio: adc: ad7606: switch mutexes to scoped_guard Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240618-cleanup-ad7606-v1-7-f1854d5c779d@baylibre.com> References: <20240618-cleanup-ad7606-v1-0-f1854d5c779d@baylibre.com> In-Reply-To: <20240618-cleanup-ad7606-v1-0-f1854d5c779d@baylibre.com> To: Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Beniamin Bia , Stefan Popa 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 --- drivers/iio/adc/ad7606.c | 71 ++++++++++++++++++++++-------------------------- 1 file changed, 33 insertions(+), 38 deletions(-) diff --git a/drivers/iio/adc/ad7606.c b/drivers/iio/adc/ad7606.c index 3a417595294f..e3426287edf6 100644 --- a/drivers/iio/adc/ad7606.c +++ b/drivers/iio/adc/ad7606.c @@ -69,19 +69,18 @@ static int ad7606_reg_access(struct iio_dev *indio_dev, struct ad7606_state *st = iio_priv(indio_dev); int ret; - mutex_lock(&st->lock); - if (readval) { - ret = st->bops->reg_read(st, reg); - if (ret < 0) - goto err_unlock; - *readval = ret; - ret = 0; - } else { - ret = st->bops->reg_write(st, reg, writeval); + scoped_guard(mutex, &st->lock) { + if (readval) { + ret = st->bops->reg_read(st, reg); + if (ret < 0) + return ret; + *readval = ret; + return 0; + } else { + return st->bops->reg_write(st, reg, writeval); + } } -err_unlock: - mutex_unlock(&st->lock); - return ret; + unreachable(); } static int ad7606_read_samples(struct ad7606_state *st) @@ -124,18 +123,18 @@ static irqreturn_t ad7606_trigger_handler(int irq, void *p) struct ad7606_state *st = iio_priv(indio_dev); int ret; - mutex_lock(&st->lock); + scoped_guard(mutex, &st->lock) { + ret = ad7606_read_samples(st); + if (ret) + goto error_ret; - ret = ad7606_read_samples(st); - if (ret == 0) iio_push_to_buffers_with_timestamp(indio_dev, st->data, iio_get_time_ns(indio_dev)); - - 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); - - mutex_unlock(&st->lock); +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); + } return IRQ_HANDLED; } @@ -259,17 +258,15 @@ static int ad7606_write_raw(struct iio_dev *indio_dev, switch (mask) { case IIO_CHAN_INFO_SCALE: - mutex_lock(&st->lock); - i = find_closest(val2, st->scale_avail, st->num_scales); - if (st->sw_mode_en) - ch = chan->address; - ret = st->write_scale(indio_dev, ch, i); - if (ret < 0) { - mutex_unlock(&st->lock); - return ret; + scoped_guard(mutex, &st->lock) { + i = find_closest(val2, st->scale_avail, st->num_scales); + if (st->sw_mode_en) + ch = chan->address; + ret = st->write_scale(indio_dev, ch, i); + if (ret < 0) + return ret; + st->range[ch] = i; } - st->range[ch] = i; - mutex_unlock(&st->lock); return 0; case IIO_CHAN_INFO_OVERSAMPLING_RATIO: @@ -277,14 +274,12 @@ static int ad7606_write_raw(struct iio_dev *indio_dev, return -EINVAL; i = find_closest(val, st->oversampling_avail, st->num_os_ratios); - mutex_lock(&st->lock); - ret = st->write_os(indio_dev, i); - if (ret < 0) { - mutex_unlock(&st->lock); - return ret; + scoped_guard(mutex, &st->lock) { + ret = st->write_os(indio_dev, i); + if (ret < 0) + return ret; + st->oversampling = st->oversampling_avail[i]; } - st->oversampling = st->oversampling_avail[i]; - mutex_unlock(&st->lock); return 0; default: From patchwork Tue Jun 18 14:02:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guillaume Stols X-Patchwork-Id: 13702434 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (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 967F01AB905 for ; Tue, 18 Jun 2024 14:02:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718719363; cv=none; b=HR5/EUBqRs3+ypsmv03w73KDXxNUb91H7Ts6+taTdQAVH4CyM0iHmeGZ9CPFzqtbilCE8P3BiJgu8OdrAqWzQ/xQ+PljY0pSVyc2kaQqhC3OU4vP+ajopSQ2AdLdh9lvz/uIzNxb+H9K9p/rhGgFBVxhmCR0Og7Zc9Uo7pGiEWg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718719363; c=relaxed/simple; bh=G0IEsc0YuwIVNtNFERXBYcEqbj6ugCGmrYZUFWavEKw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=GbwUlN5w26YhlNr4Cba6UKv1E9iFBFNjKyK5f0rUyaWSrMJRi9Q9a59NXNmdqPJFXOUoUBeFnJxGG4mQ7Pi1entml6jOspUOMdpl6hYskFMZMltu3sRQjKWXb4PrEN5Bp/SaTJa7+5AXxd59n2zmdvmY/O1OJT/i4Odu1HkrkQ4= 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=yKpwXGxa; arc=none smtp.client-ip=209.85.128.42 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="yKpwXGxa" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-42198492353so41692845e9.1 for ; Tue, 18 Jun 2024 07:02:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718719359; x=1719324159; 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=U4plLXWkBuN6eMxbghss2+pJl9NpmXZN9/hM9oRoKCA=; b=yKpwXGxavEO16aGtNkPyaQeDdXMa8Mao3TIaEK/2WeAXLnmbkT/F9Excncq8FhncnG 7bz5He/bOYnAgw/Fyx5/ZRY73Nk2BbhLk0hjTtwOo7SS0J3qPsvn1ASOnV3XwfFAsRvv iWIRUaD8a77HuQyhz1irKVMU6z1adgkS15FdF3JcFU3VqIHucPaebrZYIkbUYY43CSsQ +tuqn5z8NkKxH2Pu/AXampd2EE1xIwJNoMKKGOWGQW1XwHgFNEBga3q0lRdUWHSabhHi gFJxwGyEH6CS/3j3lhzmwdOHlbIVJzQQiEysGmFIYYI5DqW87FH/wqRA+ardR3D6eOQj mh3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718719359; x=1719324159; 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=U4plLXWkBuN6eMxbghss2+pJl9NpmXZN9/hM9oRoKCA=; b=hbW2JH5uCcAgSOpZxQ79ddOagZCvGSP9l7Grk0yhzYIJEQdNQJoMsPP5xd1Vubmy07 NSglwQemJygWvXPwKq2O8QtkmAWEle664lB6/e8NwKK+vMZHAZPWCbR19zu2F9SfcsDr x7beLxC+qAmP5Eo04oyf5/npENhGls/cSxhwa1vWgxmEV8joNoiZwNASctdtSXB2OK5q /0hSyQn91hQoWFizdeLszgtAtW48fMe2MNirym2RPN/f9KycgAhlhOxHb2tMLm6kPhyo ijKMkvuExyqWBkntK5Gb3ugXzx02HefC6n8YhmvNgsTdwEIgzDKyDbMDyaudj1USK2Y8 nbNw== X-Forwarded-Encrypted: i=1; AJvYcCXsvlxWTKUKmRxkgPiP0yi3333vNTi3DtAygQVCSjTlYqM97FTYm1EZYVYk8mQhXao5zTBsLXvcApjn3DAWVhrSTHPW1wckU+n2FqY= X-Gm-Message-State: AOJu0Yzcv/byw1Y68msfQ7rjNf8ftS7CwGkGhavOI/BpQyFyVKvGo9Lv gW2SYW2iFIsk+r3XTKh32gBzH6Mqp5Zlu66sxkqVJOwgdgI/B9fDWf5pBCEyq1k= X-Google-Smtp-Source: AGHT+IHk8eAM+xd2EgGrv4q4Al8sZ5/FlQ4l+KMnzE7MbVO9g2hq92wev9EA4GAAkpJE4kMFyryK/A== X-Received: by 2002:adf:ea48:0:b0:35f:1128:250d with SMTP id ffacd0b85a97d-3607a7842e7mr8900419f8f.68.1718719358881; Tue, 18 Jun 2024 07:02:38 -0700 (PDT) Received: from [127.0.1.1] (frhb82016ds.ikexpress.com. [185.246.87.17]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-360750f22absm14412546f8f.79.2024.06.18.07.02.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jun 2024 07:02:38 -0700 (PDT) From: Guillaume Stols Date: Tue, 18 Jun 2024 14:02:40 +0000 Subject: [PATCH 8/9] iio: adc: ad7606: fix oversampling gpio array Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240618-cleanup-ad7606-v1-8-f1854d5c779d@baylibre.com> References: <20240618-cleanup-ad7606-v1-0-f1854d5c779d@baylibre.com> In-Reply-To: <20240618-cleanup-ad7606-v1-0-f1854d5c779d@baylibre.com> To: Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Beniamin Bia , Stefan Popa 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. Fixes: d2a415c86c6b ("iio: adc: ad7606: Add support for AD7606B ADC") Signed-off-by: Guillaume Stols --- 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 e3426287edf6..502344e019e0 100644 --- a/drivers/iio/adc/ad7606.c +++ b/drivers/iio/adc/ad7606.c @@ -235,9 +235,9 @@ static int ad7606_write_os_hw(struct iio_dev *indio_dev, int val) struct ad7606_state *st = iio_priv(indio_dev); DECLARE_BITMAP(values, 3); - values[0] = val; + values[0] = val & GENMASK(2, 0); - 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); /* 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 = iio_priv(indio_dev); - unsigned long os[3] = {1}; + DECLARE_BITMAP(os, 3); + 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 */ From patchwork Tue Jun 18 14:02:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guillaume Stols X-Patchwork-Id: 13702436 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 DAF881ABCB6 for ; Tue, 18 Jun 2024 14:02:41 +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=1718719364; cv=none; b=rBEAyjULroBpaAhZdTFh/aKl7H1VDh4kn6D9sX2gSgvGfDOln4TDr06vReRckQoiINy7MmA1n2SvwTv2CqIh0VbFXgQQGZ5MLwJmrpb+rM/Fpf2d7sY/dHTD/4AOh7tC3qlGOAVf7Cgv3L2ovxYH1IQUJaMiubMCZErnTWfI8kE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718719364; c=relaxed/simple; bh=PO21rWTwSri6pXqW0QAoF3rRYxBHPQXcTMLtVuYPAPY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=l9Cm3oDiagtEyHZAO4ZG3M6i6TMaWIoi+noDJ4nCPJdjNMgfkFhgwaa6Q1awfYjIKMGt/NwmFb7gGD2+spuyDL2CCfG/9MbX6ZB81AfeJhSOCRqHwTolbrLBNqc83NbLCUdwTNFnAQAkz/xywHS+Eh5sSQ4uKs9a5EYrioqncCA= 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=MKexz67T; 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="MKexz67T" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4217926991fso48970105e9.3 for ; Tue, 18 Jun 2024 07:02:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718719360; x=1719324160; 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=SmU+WlwI0In7K1/gMjhndg/uoX9jW0QNIwYtnLhPUbw=; b=MKexz67Ty2ztXziEExBdmHVk87zPY7S6ofk/iXtqhacvTTxSsQXt06vuuQGxj5e8oV 7tsci5JrsG4hIBZPCI2asJwwf2ig6hdHZLHygUF6aMS0plVD4pRKrykHUXmaVYFTzSHA seeVsAMu1HeqzH2saOOgk9kof86rqUFFr7y0qPRH9UIw3D9LTciVu4yRxFrMFZhrDEwP RFiG3iuvSQCfu8l2VJ6ojXsqHjGQTV8pzXrS+q5FTp2RkXl5AKxDf4eAEklTRFVpfJUV IxkcGO/jnwHIjHEiNh3dIceMPIu5XtUKIgtzpmWHezR4a+mpGgy5JaE3FNufGgtdFLPQ KOtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718719360; x=1719324160; 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=SmU+WlwI0In7K1/gMjhndg/uoX9jW0QNIwYtnLhPUbw=; b=CsDzHspdl1XXGwie9LgaFmVgsaFVbPLI5j6qzdJ23BgHrvg4pmTR4a1+CMI+HKNGPI W5S7m8YAy8wdJMcgjfYPp84ACxVeW/8QmC2cMMUu2NxNH2is1NHB7MlMVFK628NG8tDI Nvfn/5RqvsVqUBiH3OS2cnocuyu1OBRutk+U3L/TWLg6Xke7ESh7lYfF7kQkt9bJZl4k amped6M6dNaqSJJJ2FO7u00qPYVw5GsLQjSmiHsS5ceWo3+Z7VFh7GdL8+CjnkzCYgT2 oeqg0jezoQH8ka0SPkd+NBJMeRAalJGypVT8CbBzs26oq/3iab5xBJm2w2GrQD6JlFCd 3FIA== X-Forwarded-Encrypted: i=1; AJvYcCW6p+9EKetpMlrfgkJxELCgujIS3jri5ldh4yfQfMV3czHoDsYpHNDEah8xnsVUVQ311XjdcMoz8N/sOKXe+UCZgvMoYl8WtnCFtz4= X-Gm-Message-State: AOJu0YywWqmtXb4l8Grn+V3LFBm4sVy7/b9ulWiPTtJqT9CIZMDtR0Ni +SLgkDGFFn2UVkNAtcRy1D82jOC1hwbEiksQ0fbO0E1IMTs2I7Rxk3k9UYe73wg= X-Google-Smtp-Source: AGHT+IEtKN5tC6ABJu+hRBezT/QshYcfhWNrkTMUXMHmMGcpraUk52c+2mvByGaSZJu3f52D9bSM2A== X-Received: by 2002:a5d:5412:0:b0:35f:259c:cca2 with SMTP id ffacd0b85a97d-3607a768b42mr8062269f8f.34.1718719359438; Tue, 18 Jun 2024 07:02:39 -0700 (PDT) Received: from [127.0.1.1] (frhb82016ds.ikexpress.com. [185.246.87.17]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-360750f22absm14412546f8f.79.2024.06.18.07.02.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jun 2024 07:02:39 -0700 (PDT) From: Guillaume Stols Date: Tue, 18 Jun 2024 14:02:41 +0000 Subject: [PATCH 9/9] iio: adc: ad7606: fix standby gpio state to match the documentation Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240618-cleanup-ad7606-v1-9-f1854d5c779d@baylibre.com> References: <20240618-cleanup-ad7606-v1-0-f1854d5c779d@baylibre.com> In-Reply-To: <20240618-cleanup-ad7606-v1-0-f1854d5c779d@baylibre.com> To: Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Beniamin Bia , Stefan Popa 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 --- 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 502344e019e0..05addea105f0 100644 --- a/drivers/iio/adc/ad7606.c +++ b/drivers/iio/adc/ad7606.c @@ -438,7 +438,7 @@ static int ad7606_request_gpios(struct ad7606_state *st) return PTR_ERR(st->gpio_range); st->gpio_standby = devm_gpiod_get_optional(dev, "standby", - GPIOD_OUT_HIGH); + GPIOD_OUT_LOW); if (IS_ERR(st->gpio_standby)) return PTR_ERR(st->gpio_standby); @@ -681,7 +681,7 @@ static int ad7606_suspend(struct device *dev) 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); } return 0;