From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ot1-f52.google.com (mail-ot1-f52.google.com [209.85.210.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 F0A561A0BD7 for ; Mon, 11 Nov 2024 14:21:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731334911; cv=none; b=dtKiRIO5x8V/K5EzXtJ/Vdg2/I2TJWziYE2iAjVVijKS10rKKGgO4MkZlphwgelU/BWqSg/xYWNGa/94rXp6+9y5A6dWIwg15u/HDWu8TNTWYiJC7c+gqIDXEA4qLqsXYmev5bllZypsn0ltm2LDhH9yrQ4CbAipBppiGwnSZYY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731334911; c=relaxed/simple; bh=sXs4BHvFeo0Y3ulkHWsHHmqqUYuxQyte2TAFTyzb7v0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=OWOs3WgsnoJEEsNPt9qkmnoZiERCqZnCIawbUK2bkuoYOiilXdMHNph21Wz7BFIfswR8s3Q/pa8ks60KqgySb/vLLlCfIpYmCelX9GZU/0B5Ho7YmMwKLxMTDVKhorsGADv8N3M9rBNObkiUsFoEKphu4wXGl5SFxaPWRwUBFPc= 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=AFHYuwSH; arc=none smtp.client-ip=209.85.210.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="AFHYuwSH" Received: by mail-ot1-f52.google.com with SMTP id 46e09a7af769-7181885ac34so2933531a34.3 for ; Mon, 11 Nov 2024 06:21:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1731334908; x=1731939708; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=HctBMgT84vBY4hzxiEZh7IsHrKp0XhtLMHme3Byg9B4=; b=AFHYuwSHkLOjleYo12O6HpOQ1zq8ctfn8d3wHhdhlREz/FNOVTNRkIAPh8QUP1lTBc IvNTjwsr1bC4N3QamFxcRMzMPpblwO3rQgVSjcYYUyhY5vLylWbioSBAcAPFVtWeMgXG Ro+gyZ0iOAdMVQbdyhU7WG9bStj4Qlj/jBqdBzqcwzHBwLWF1Foiy1Qiyzl0fZMiUimD 7kNSh/o3EdjD11iKKTi7S2dO8irH+dW/X9yWnGHpJLRfBlQmEptnytoqac9JM6fOwt6D pkT6dO0JideppueNRZ2fdd1bMLKjZIbeG9LcrmzxqGRxDWBeET9NIwe4EQ7+NkVFlXzT qRmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731334908; x=1731939708; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=HctBMgT84vBY4hzxiEZh7IsHrKp0XhtLMHme3Byg9B4=; b=NN4svboKrAbTDN0CKQ3rG/7UHGCJoftFcb4O/8V/j6NVfsawL4jf3gLn/wul4o85bn vf5/3gJIRpQw5MgWpTXoqPxdd8bH/dDYWRGZmr9xV+bq6/khu50qWLpXimBRRg/REuVF P9JZg/w3vvaHp6xLN+9qAMmQyLH6XOojl+RlrBZGM41d+rs6EfWC1sXdQCXck3nv9nbw xH1Ypug7gie8V8Q/ME20Bgaul5COe649f6AFlaAt/lw26zEJf6krsMQLHPrJnpuPVFsI gCaj3kM5rxYu7mV3oXVwBui8S2DFmXX07jm0gkALYphd/aK/Bjbob1eBeved80jDxgfe 2Wdg== X-Forwarded-Encrypted: i=1; AJvYcCUbC+6quNKSuMXsqUvgWV65lymZ4pNlnfoSAUqMf7HASYExaXS9cNRHJBjweKCkz2n+drKXCzBTpoxSavQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yw1wT3X95KerR6N8j72G2CvchKC5loP5UMRc3XZUjl4Gj2X7T3E KmqCMWjNyd+8n8wOYd+IcBaREfs98am7qn7L/M8ELyf4K9vOWdF10Ubk4/Y+0yM= X-Google-Smtp-Source: AGHT+IGVzdut7knNu4orGH/0e/98hy5mbsEg8EUQyO8+g5vXJP3AchBYsjwGGywSvzlxSF70zNgyPw== X-Received: by 2002:a05:6830:2116:b0:718:e44:6da9 with SMTP id 46e09a7af769-71a1c1d2fa3mr11254324a34.11.1731334908011; Mon, 11 Nov 2024 06:21:48 -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 46e09a7af769-71a107ebd43sm2266321a34.6.2024.11.11.06.21.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 Nov 2024 06:21:47 -0800 (PST) Message-ID: <8636a00f-81e6-4439-9778-abce6e0c931b@baylibre.com> Date: Mon, 11 Nov 2024 08:21:45 -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 1/2] iio: adc: ad7124: Don't create more channels than the hardware is capable of To: =?UTF-8?Q?Uwe_Kleine-K=C3=B6nig?= Cc: Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org References: <20241108181813.272593-4-u.kleine-koenig@baylibre.com> <20241108181813.272593-5-u.kleine-koenig@baylibre.com> Content-Language: en-US From: David Lechner In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 11/11/24 6:08 AM, Uwe Kleine-König wrote: > [dropped Mircea Caprioru from Cc: as their address bounces.] > > Hello David, > > On Fri, Nov 08, 2024 at 12:52:35PM -0600, David Lechner wrote: >> On 11/8/24 12:18 PM, Uwe Kleine-König wrote: >>> The ad7124-4 and ad7124-8 both support 16 channel registers. Don't >>> accept more (logical) channels from dt than that. >> >> Why should the devicetree be limited by the number of channel >> registers? Channel registers are a resource than can be >> dynamically assigned, so it doesn't seem like the devicetree >> should be specifying that assignment. > > Note the device tree isn't limited as I didn't adapt the binding. It's > just that the driver doesn't bind if too many channels are specified. > And while your statement about the channels being a dynamic resource is > right, currently the driver doesn't cope and allocates resources > statically, and happily assumes there is a CHANNEL_16 register if the > device tree specifies 17 (or more) logical channels and writes to > CONFIG_0 then which very likely results in strange effects. > > So as long as the driver doesn't implement this (possible) dynamic > mapping to the CHANNEL registers, it's IMHO right to refuse to bind (or > alternatively only use the 16 first logical channels). > > Best regards > Uwe Understood. It would be nice to implement such dynamic allocation in the future but as a fix to backport to stable kernels, this makes sense.