From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751982AbeA0ISN (ORCPT ); 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 X-Google-Smtp-Source: AH8x225ns7joFjxdG+r/MwshiDCillKohKqhHlf35YHncnPEuMkxne0TNRY2F6lPu8VvxDi2rjgi4A== 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 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