Received: by 10.223.176.5 with SMTP id f5csp320429wra; Sat, 27 Jan 2018 00:19:15 -0800 (PST) X-Google-Smtp-Source: AH8x227zL2aQKNTiqtx+FrC1KgaVwbZ8DbHFGkeFymZUL+4fwH4/B0T3/fb8mcIaG+KezVrsDv09 X-Received: by 2002:a17:902:6006:: with SMTP id r6-v6mr425661plj.78.1517041155202; Sat, 27 Jan 2018 00:19:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517041155; cv=none; d=google.com; s=arc-20160816; b=Xw5y4I9G+gwHF0dLEXxLvt6D3t/Z8p2St8uIf9WDphf2qf+nhdP/VTYSeLv/q2CIij Ew9ZJsEdzoqhwZDDC0QHA8o5IxK757jMU0Zc5v5dRSNQGzUrMVUa2XGNFURG4SE6yi9e huX76IuWvtnDc9AxSs3hjD0ILrXpOSeOY7/WmZNO+0jE2r/ogEmOLj6hR6HcMWSlVW43 bNfFrxJXnswXDRtunfuM1mdk4dLLxCgG3ZpuSe7H9c9BSOEiLSHVqoGsdzm0WhTWFcMm 0TwT5vl33qmjx7vTG8MRYOquVojJcH8Lbv4Xo5AiZi0I0iqY0zR+jPuuKyxGdZSQ9rh8 2pjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=bsunHxTpnCk9JTUh4rD/GvMqYNExejSW7cjjXrPSMKM=; b=Kp0FSM1mJD+TyVopC5NfrvukQutUqKo/Wz340E0BYQBkczvQdTkKUIjFWoDZ+rCOX+ D4OPgQcTzV6qUY3Ps+d7MPu68u7wHlls/+QaIyGPZC6wqCxR+v9lc4iv3/OffRat1bFV W5pE0vDVzz8M2NDdSVjH14vfN8fy/elJp1FCyXNvEttxHGtS+YxhdJV3wpj6SZOum4XF r+TqjRRagMgxphnh1bzvmO4XAiDIA0dKhQHY12gC2hksvpgvYTxOUNeANqyP/eRaMMZF lkvOwuTCdQtSsw0eCpP46dgnSHIK8mJA7XOPBXO3lbVmKpFuOqPehyiJu56GinL7ebBv P+yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aIlIyYyN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s59-v6si4989343plb.699.2018.01.27.00.18.50; Sat, 27 Jan 2018 00:19:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aIlIyYyN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751932AbeA0ISN (ORCPT + 99 others); Sat, 27 Jan 2018 03:18:13 -0500 Received: from mail-wr0-f195.google.com ([209.85.128.195]:40129 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751506AbeA0ISL (ORCPT ); Sat, 27 Jan 2018 03:18:11 -0500 Received: by mail-wr0-f195.google.com with SMTP id i56so2369536wra.7; Sat, 27 Jan 2018 00:18:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=bsunHxTpnCk9JTUh4rD/GvMqYNExejSW7cjjXrPSMKM=; b=aIlIyYyNBLwJYstyQQ6P1Qi+DrSZf0kDIyI0NUgrPyPme7B483RpvleImktEzSzMYU aCFxrjUeOTzxtioscQt7T5XLApen28orllsLoa63abbs5R7UWRvTYGQ+XUp1n4cLkS/U 51JcV+aWj/jBmAMcGQGeCgnorKU4XwLhDFA0ePxpmG+yhh9tT/9NYOo9dEqpLZGxLR2x r53CK9pXw5rbO2mqb+fbJZ8YxqX89jjc8JXcIqg1RdiJtO5qSjb/hIiUDLxxAfW74XXn wS1FjhtzYoyTGdvZ1bmFada2F7eJTo/GG4vTZN/8i3SCCsDdUufQDLUrszEP8OP7sK1C OcjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=bsunHxTpnCk9JTUh4rD/GvMqYNExejSW7cjjXrPSMKM=; b=eBHg0qf4g0uAbJNcTUuPAHYXcB42RgUjPkTnIAi1X97+b1prsNuT/1ZCJlcpeFHgtH NIPlB5R5gUQU6u7HgS85lFmFirypziENV5fdjSO9pfCvY3r3ZsA69BPjR/rDHuXWqXXJ Ney9e/62xDhHbtvLkoE+RFJ6AptP0BAMFTFUPiKNKkQ7BLwyFiSyb1Uk8v0o+XR3oy82 nB0QDqjlqen2S7pKPpRm1+kyBWDr/gDJt9YyTkAmYFbS/9uv11fqT70QTNGfyNJPaXfv W8aYimtsGYUXmCjWCTVjNIRDhz7LSF5ukXqW3BepHy2LizpOeHL6vfQb8Ru18NDWgM2c q0Dw== X-Gm-Message-State: AKwxyte4sbJg1cyK3dBKMqzZqjTtCb0WhfTIgR+Hm38ZW7GRX6HOgA0f vYxfhy8B7lzz8R42mM3NqxU= X-Received: by 10.223.156.197 with SMTP id h5mr13247613wre.17.1517041089810; Sat, 27 Jan 2018 00:18:09 -0800 (PST) Received: from [192.168.102.129] (LFbn-1-8169-84.w90-112.abo.wanadoo.fr. [90.112.78.84]) by smtp.gmail.com with ESMTPSA id k125sm11029696wmd.48.2018.01.27.00.18.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 Jan 2018 00:18:08 -0800 (PST) Subject: Re: [PATCH v3 1/2] iio: adc: driver for ti adc081s/adc101s/adc121s To: Andy Shevchenko , Lars-Peter Clausen Cc: Jonathan Cameron , Michael Hennerich , Linux Kernel Mailing List , Hartmut Knaack , Peter Meerwald , linux-iio@vger.kernel.org, Philippe Ombredanne References: <1515961960-35157-1-git-send-email-milan.o.stevanovic@gmail.com> <783221ff-7366-5a50-f022-8b7b8a21e998@metafoo.de> From: Milan Stevanovic Message-ID: <7a92a7ae-159e-deba-5097-7aa21e024990@gmail.com> Date: Sat, 27 Jan 2018 09:17:49 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/26/2018 07:43 PM, Andy Shevchenko wrote: > On Fri, Jan 26, 2018 at 8:25 PM, Lars-Peter Clausen wrote: >> On 01/26/2018 07:19 PM, Andy Shevchenko wrote: >>> On Sun, Jan 14, 2018 at 10:32 PM, Milan Stevanovic >>> wrote: >>>> Add Linux device driver for TI single-channel CMOS >>>> 8/10/12-bit analog-to-digital converter with a >>>> high-speed serial interface. >>>> >>>> Signed-off-by: Milan Stevanovic >>>> + * Analog Devices AD7466/7/8 AD7476/5/7/8 (A) SPI ADC driver >>>> + * TI ADC081S/ADC101S/ADC121S 8/10/12-bit SPI ADC driver >>> Guys, I'm not sure I understood this mix. >> You often have the case where two or even more vendors produce parts that >> are (mostly) pin and register map compatible. This is typically to fulfill >> the second source requirement that some customers have. >> >> It is not uncommon to see drivers that support parts from different vendors. > Yep, though in this case we have, it seems, a counterpart (i2c > variant) in drivers/iio/adc/ti-adc081c.c > >>> We have like few TI drivers here: >>> >>> drivers/iio/adc/ti-adc0832.c:352:module_spi_driver(adc0832_driver); >>> drivers/iio/adc/ti-adc084s021.c:269:module_spi_driver(adc084s021_driver); >>> drivers/iio/adc/ti-adc108s102.c:343:module_spi_driver(adc108s102_driver); >>> drivers/iio/adc/ti-adc12138.c:547:module_spi_driver(adc12138_driver); >>> drivers/iio/adc/ti-adc128s052.c:211:module_spi_driver(adc128_driver); >>> drivers/iio/adc/ti-adc161s626.c:276:module_spi_driver(ti_adc_driver); >>> drivers/iio/adc/ti-ads7950.c:519:module_spi_driver(ti_ads7950_driver); >>> drivers/iio/adc/ti-ads8688.c:481:module_spi_driver(ads8688_driver); >>> drivers/iio/adc/ti-tlc4541.c:266:module_spi_driver(tlc4541_driver); >>> >>> What's wrong with them? >> They are probably not register map compatible with those other drivers. (Or >> nobody cared to check if they are register map compatible). > I would believe in the latter than former. > >>> Is it here code duplication between two vendors? > ...and instead of doing such mix I would really rather have a separate > glue driver to the same code. > I spoke about this with Jonathan. Generally we can share a few lines here and there but not enough to overcome the fact that the drivers just became a lot less readable. There are comments for that in patch/10132693