From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oa1-f54.google.com (mail-oa1-f54.google.com [209.85.160.54]) (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 3E07042070 for ; Sat, 18 Jan 2025 17:09:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737220158; cv=none; b=oupaJlhNieT4zSdSi2+OJ+yJbTISut6Gd3NHsq/ib5CjW6m/tGpzUhPt32fVzBYVhloxHrF+g44KmpZmP3Qx2M9o7gDwIj6673I0zz43Njp2ps8ngoVKAYsh14vqrLcAt9L4YyFyihiYwGbQlbHFi4ASKq9TLmhKpQIYB+NJlj8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737220158; c=relaxed/simple; bh=kZrCpn6iY8XtGJTKSSIuBQiF03IUSPNKK/CSIsfxi+s=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=ud9DGdXRnN2TbfhyqR0D+Q8qZcOKEBiijurRpss+QIXeiFgJRMGt0DOoVgDF3qsYEdZVlam9MZgwzukZvBw6QXToa28djypyrztq6453YpPSVp8O2M7/YyndKQTln2VgYTms/9Xj2s9FEPo+kb1BeEEsPNB9aJG1xh9JWRorcYk= 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=yLGe/uX/; arc=none smtp.client-ip=209.85.160.54 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="yLGe/uX/" Received: by mail-oa1-f54.google.com with SMTP id 586e51a60fabf-29fad34bb62so1882244fac.1 for ; Sat, 18 Jan 2025 09:09:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1737220155; x=1737824955; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=gBzJX3Q/fcfCDTYZ+q6Yetl/p7poSDSwPoWKQfNelcU=; b=yLGe/uX/ABgCFPU8DAbUvToy2Y/qgHGH6VB5pk+eOarvVH+8DbYV2fpDtq8qisqATF XUpKoVnjjsg/fKARVzO11PcvM56uxoJ7si2zTqlXCsebG2qBQam4HDmh1AvC/YosneZa Vw7g/PE+uhn8KTpeWQPHM+ZnMi3fyjPuM1wCDHShUJOuXBVvhBO9ZnqfabuqYsOGcfvs daC4y0BhVew7F3eAhDqRyBpFAlW3zd8n37jaCY8Q1XYBgVUkIuLFR1HdB/Ik4DvH6gbd +blyP0mVJrP18VIIVfRoYP2sTwxLOqojhzpkL8udL3tPa6Z0Y/UVgllHbHZFxh7SwTsR M/iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737220155; x=1737824955; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=gBzJX3Q/fcfCDTYZ+q6Yetl/p7poSDSwPoWKQfNelcU=; b=sAYRQY1juIta6DCySWkZxSdH2NzPIrbRVQxvcma4JVKsbeHNEq7e1SsJh+ynP82SMK 0ylfcnI0aXnGvP0lfPm53HI1XRrKj1HdGeHDllXSkY59CBHaJSVFm9QShdUefLUF0MXR 91WsHdFhCaUY5w+6lrvFl+W+g/EAlnoTUBUkGTOy4g8EnEPTVJPD7NjtdhpdUWzCfSJw UNY4DdGQtetl3oESd+iBxdzWrLXThh/OBF0S1hZd7bncVmhOzRZvWv+iZ7+NASidLz4Z fztuBQwMEOTLIY0ZP9BBcloWj18h0hY3wCtTiDBiPswsYkCnrAZH63M6r3hWdRB5izX+ xbIQ== X-Forwarded-Encrypted: i=1; AJvYcCUzZLjVOIU70NMQ4qMksaCvfzvuB2v0vi7yKe6kqlL84fFtaG29UrB3utSz5sYK8IuGvtrRWRczES7xYZ0=@vger.kernel.org X-Gm-Message-State: AOJu0YxnuXJXGLCs5sut8l7PChqVXjLJ7+uCR+oXEQOptclOd3NWXUzK s7cUPi9gf/IpEpRF75wzHTp81X5o+jzxqeYZHFJvqMN3rLzW462qFvQ/OqzG3VM= X-Gm-Gg: ASbGncs8eU7DaZf77qVPWYtBTjz/HbNeUoWZvJynixuScMLow45yZJie8NILYNUzRvN iDhHou0OFTr2Y+9VAr/m6PxukN+IqGpxDfngO4KYM0s68ebBYqbxUdJZt+BvPYXvfuM6xQgMUzz AQQ3P7MRaUQmGMvhNMyS58ubiYa/esmcr8GKgtrq2bWjYCUm4/Am9T1BJF9pnUJgvb4s9PDb+s9 BT4RWg67JjA7jqB3rbwCYMiT2NjJyTGFSSxUv/Ev0mAE9juLWsr+aw5ZXQzoB+UyS4+p6tZB1hp tF73+QRR7fzTxB2lYMM6BeNWzmlG89c= X-Google-Smtp-Source: AGHT+IGodFluwpk4HXpxuTQ4CaYwnD6yRgyO51ig2CiRhLaGAjJBxBcCjfP1Uw9hFIL9zJCC5XXkUA== X-Received: by 2002:a05:6871:8112:b0:29e:69d9:8847 with SMTP id 586e51a60fabf-2b1c05b3854mr3348215fac.0.1737220155396; Sat, 18 Jan 2025 09:09:15 -0800 (PST) Received: from [192.168.0.142] (ip98-183-112-25.ok.ok.cox.net. [98.183.112.25]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-2b1b903c5f0sm1818089fac.49.2025.01.18.09.09.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 18 Jan 2025 09:09:14 -0800 (PST) Message-ID: <134bd7b9-f659-4010-9c78-48eee1dc901a@baylibre.com> Date: Sat, 18 Jan 2025 11:09:12 -0600 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v10 8/8] iio: adc: ad4851: add ad485x driver To: Jonathan Cameron Cc: Antoniu Miclaus , robh@kernel.org, conor+dt@kernel.org, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pwm@vger.kernel.org References: <20250117130702.22588-1-antoniu.miclaus@analog.com> <20250117130702.22588-9-antoniu.miclaus@analog.com> <20250118165751.334fe37b@jic23-huawei> From: David Lechner Content-Language: en-US In-Reply-To: <20250118165751.334fe37b@jic23-huawei> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 1/18/25 10:57 AM, Jonathan Cameron wrote: > On Fri, 17 Jan 2025 15:45:35 -0600 > David Lechner wrote: > >> On 1/17/25 7:07 AM, Antoniu Miclaus wrote: ... >>> + if (fwnode_property_present(child, "diff-channels")) { >>> + *channels = ad4851_chan_diff; >>> + channels->scan_index = index++; >>> + channels->channel = reg; >>> + channels->channel2 = reg; >> >> Typically we don't set channel == channel2 for differential channels. > So i guess this is tripping up on these being dedicated pairs labelled > +IN1,-IN1 on the datasheet. The binding documents those as matching > the diff-channels - hence both channels and reg are the same. > So maybe best bet is to enforce that in the driver by checking it is > true. Are you saying that in_voltage0-voltage0_raw in userspace is OK? > > It is a slightly weird description but only alternative would be to > invent some more channel numbers for the negative sides which is > less than ideal. We could go that way though. > > Some comments alongside a sanity check is probably the best way to > handle this and no surprise us in the future. >