Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp728880rwe; Thu, 1 Sep 2022 06:54:39 -0700 (PDT) X-Google-Smtp-Source: AA6agR6ANrnvXH8Ymp+oHzrGT/g34UnNBudlCqIkeWUcmid7ACCsGm00GeqetR5FzKV86C9FBhgj X-Received: by 2002:a17:907:86aa:b0:741:a0d5:43bc with SMTP id qa42-20020a17090786aa00b00741a0d543bcmr12382971ejc.100.1662040479111; Thu, 01 Sep 2022 06:54:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662040479; cv=none; d=google.com; s=arc-20160816; b=Oa1p/+LvzT/zGd1xQ/leWB4t5Ym2NQiR8hLUsChdS1XPPItol0batMJoMAsqCuiIJJ NM5kDdfvSOImmmxRajRef5cPkQfPbXqFh0HgbNCNJJjysWzEoLQbTwO8marv/x3EKeUU GW64T5MXLkFpLVsTn0TxaEmUh0HcQagxJ6FoTvXusCJjA6uU23sWh/pUIzKAnOd7OwLu bkxOEpt9eqFXHwRsIfFBQM6GxiV1YhyR17N0PcjBWfItZP1zT5c0N78a8WiUdQlHjkOr ZtaBic/gU5S6fzneaDkRAy13EtpGgSkPZm8+Ccix3VwSZ5lSYhKK8eZgPkx5gRk94ZFa o5QQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=e3HK9US0WO1UkRfGxEbaELQy+bTEUcDkkmiL6uVF2yg=; b=KkPCv2fa+Ub61S04y5f4hunlKVL/b1R/1XUBctX7pk7cJ8laZm0HA8XQhATeH1bLYL 4idLYUlt/zRymXnHMfSl8Ds/6BMJ66FSo8e+SjsOCaU7+v8LRd78zlBE1Ds4/sNywHXZ nJSMSJtbMd0xmX6ysS+IETnEO9ngLdhlBy1Bzj7hhaRhDTU4GyO9Ya1m+LTlSoRT7z0v AyGPuZ6Ck8ylTZFxU7jRjF2hn7vaAlcR/1rE3rWppmlqQa6G9h2eD2ianvkoObQnEB7P Dc686qjk+1wy0YSoM5uSOcikSYK9arRb85njT/2Pu/sL+Vnv0eYs1Xz2dqekg1p5hUal ZmuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=apABlBOm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sa36-20020a1709076d2400b007303db545e6si13151839ejc.786.2022.09.01.06.54.04; Thu, 01 Sep 2022 06:54:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=apABlBOm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233027AbiIANXe (ORCPT + 99 others); Thu, 1 Sep 2022 09:23:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232827AbiIANXO (ORCPT ); Thu, 1 Sep 2022 09:23:14 -0400 Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B9536248 for ; Thu, 1 Sep 2022 06:23:13 -0700 (PDT) Received: by mail-lj1-x236.google.com with SMTP id y10so14731995ljq.0 for ; Thu, 01 Sep 2022 06:23:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc; bh=e3HK9US0WO1UkRfGxEbaELQy+bTEUcDkkmiL6uVF2yg=; b=apABlBOmkqX/8VxFa8RkHKfD/jGKjSInOUQVO3GA0XBauhwsYuN4Bjqpuec1v6lpRb tmnSA/mqI8roMEX7RNg61TfDRIOQf+VZAu6fENRP956E0uEngle5V9ERnLhP9JrKdcFk MlaJy5hLI0ypXk+/Ylq9OWaoJq6tyMmBg+lKBTJ+cC4Uzc0QYi50pZGHWsa/J7SPoZBg UADNq4Fud3V+i0ww/Fablu1SjqrOKLVk0T9pW8E/yWLUckWI8lwgn3WggDQClYcFFK3s qr6b0J53BAtT1V1kxttnBFBt/rQTFUDMw3CedEdHju1hPiHvhSNmRbZWR/dhOjKuLX7B ClfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc; bh=e3HK9US0WO1UkRfGxEbaELQy+bTEUcDkkmiL6uVF2yg=; b=lpnra57+l/XSAgOGYrXWA5HV5sxPsXJLYN7nx2hS1J46PF/58YoS1NDKHLhBfVzY/r Lw6Armoy7L35DW2m2sAdwFGmr70nAGQqq36KB1dJLL1lJQS9HQ4IxQTbortowuo9XNYY siHEkQT99xAQZY0B3/bsTkVteTQAmxblykfwl06osAOk2rXywVDyF8KHKP/s73i28Iks Q6u9aFAo7hZuLgGMkfxXct7bt988r8RJ4j2JGfW2XBECqEt/R1SpzsdnZnPGFDckjXtY 2E5R/MgCLFv7tAwiaKdidAFJ5D3OS909hCMhs7UgD0ZWRZeTYurEAmLtHDPgjcaZnPAw IFWQ== X-Gm-Message-State: ACgBeo1UsN1wvf792hGoRQ1gzohJiFSc7VYmp3I1i3EseC90Vv+uAO7P L8PAyWnJAyS9O8PjujSoSEzveyW1LDyt4AEC X-Received: by 2002:a05:651c:1542:b0:249:a87f:8a34 with SMTP id y2-20020a05651c154200b00249a87f8a34mr9742725ljp.442.1662038591495; Thu, 01 Sep 2022 06:23:11 -0700 (PDT) Received: from [192.168.28.124] (balticom-73-99-134.balticom.lv. [109.73.99.134]) by smtp.gmail.com with ESMTPSA id u5-20020a2e8445000000b0025e4dcc48b1sm2499804ljh.19.2022.09.01.06.23.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Sep 2022 06:23:10 -0700 (PDT) Message-ID: <4067432b-b5a6-f3eb-a707-5fa298ba846b@linaro.org> Date: Thu, 1 Sep 2022 16:23:09 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 Subject: Re: [PATCH v2 4/5] drivers: iio: adc: LTC2499 support Content-Language: en-US To: Ciprian Regus , jic23@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20220901121700.1325733-1-ciprian.regus@analog.com> <20220901121700.1325733-4-ciprian.regus@analog.com> From: Krzysztof Kozlowski In-Reply-To: <20220901121700.1325733-4-ciprian.regus@analog.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/09/2022 15:16, Ciprian Regus wrote: > The LTC2499 is a 16-channel (eight differential), 24-bit, > ADC with Easy Drive technology and a 2-wire, I2C interface. > > Implement support for the LTC2499 ADC by extending the LTC2497 > driver. A new chip_info struct is added to differentiate between > chip types and resolutions when reading data from the device. > > Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/2499fe.pdf Missing blank line. Use standard Git tools for handling your patches or be sure you produce the same result when using some custom process. > Signed-off-by: Ciprian Regus (...) > +}; > + > static const struct i2c_device_id ltc2497_id[] = { > - { "ltc2497", 0 }, > + { "ltc2497", (kernel_ulong_t)<c2497_info[TYPE_LTC2497] }, > + { "ltc2499", (kernel_ulong_t)<c2497_info[TYPE_LTC2497] }, So they are the same, aren't they? > { } > }; > MODULE_DEVICE_TABLE(i2c, ltc2497_id); > > static const struct of_device_id ltc2497_of_match[] = { > - { .compatible = "lltc,ltc2497", }, > + { .compatible = "lltc,ltc2497", .data = <c2497_info[TYPE_LTC2497] }, > + { .compatible = "lltc,ltc2499", .data = <c2497_info[TYPE_LTC2499] }, I think this should be split into two patches for easier review - one working on driver data for existing variant and second for adding new variant 2499. > {}, > }; > MODULE_DEVICE_TABLE(of, ltc2497_of_match); > diff --git a/drivers/iio/adc/ltc2497.h b/drivers/iio/adc/ltc2497.h > index d0b42dd6b8ad..95f6a5f4d4a6 100644 > --- a/drivers/iio/adc/ltc2497.h > +++ b/drivers/iio/adc/ltc2497.h > @@ -4,9 +4,20 @@ > #define LTC2497_CONFIG_DEFAULT LTC2497_ENABLE > #define LTC2497_CONVERSION_TIME_MS 150ULL > > +enum ltc2497_chip_type { > + TYPE_LTC2496, Why having here 2496 and not using it? > + TYPE_LTC2497, > + TYPE_LTC2499, > +}; > + Krzysztof