Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp614312imm; Fri, 12 Oct 2018 04:00:37 -0700 (PDT) X-Google-Smtp-Source: ACcGV627W2hz3PJXOH/8mYVgBRqglEncwOoLqKscP2Pi5D6kCrkUh9OK+q5WseUdOq84fD5IRi+t X-Received: by 2002:a63:4614:: with SMTP id t20-v6mr5223757pga.438.1539342036857; Fri, 12 Oct 2018 04:00:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539342036; cv=none; d=google.com; s=arc-20160816; b=ldQWgsLCVYDYDNPZQt4aoAonX13DvvatACbzJlDZ5XhbQVHt54TrqCwM4B68SOr8ys J5U1azatMeDcVPqem2oCCKo5CkYNEOR5NWPbqFqkDYiwa03BeaNN3zCObOIdSSIx8aCY m4fbn8f2yr+p3PrXh4hFoD0TVDIROm2Hw5lwOGrPYG20MsZLbEN0YJUFsMOf0Y8dk6ag vgCWOMHL2FUYFhhB2P8DvpiLaIwQ/MXVWvX+VMiYbOF3nb1MzcTEF33UOvQWEvRwzZgc pX2KuszvY5CNFrqJ2nLGvuN668NVDAlmG0H5cn7UB9BML+b6l+nC0lD9KLyHy9lC9gXB Jx8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=RNXqLXyLELl/XfENo8ltwRenTXKMnAOE4gjdGJupadc=; b=PiWPSMM0lrjZ9rayyhr9mR5QMLIDff1Z455WDhH1Hs1JelMQGIT5Nuy6kYsBTU063A OdYRZyEBMCz2bieBH4IJQooGVvKb9wXYt2Ko6Gh9tJpKfzuluPh0T194cuPEeVXOy4xU PD/lXFMbu8/zTbfngVG7/WInsNw2ODmqk7bt9Iy7H3rGbCpFqdG9IsaoQSFWHDnKQCgQ 7JAkqOR4Csq+Nxu8VjlN0qVMwiIp3+lddTAzN98bc58rZCFiJq0KDsD8BuWGfM3WDKET VOY6rgerzL1HyjFTbyqTd/P/nWS9m+F/qBKxf/sbm6sUdkdlZRSEEXbefJZwZz3CawjL uckQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 136-v6si991216pfw.278.2018.10.12.04.00.20; Fri, 12 Oct 2018 04:00:36 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728258AbeJLSae (ORCPT + 99 others); Fri, 12 Oct 2018 14:30:34 -0400 Received: from relay1.mentorg.com ([192.94.38.131]:50451 "EHLO relay1.mentorg.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726917AbeJLSad (ORCPT ); Fri, 12 Oct 2018 14:30:33 -0400 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-MBX-04.mgc.mentorg.com) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1gAv9A-0000E7-IO from Vladimir_Zapolskiy@mentor.com ; Fri, 12 Oct 2018 03:58:20 -0700 Received: from [137.202.108.125] (137.202.0.90) by SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Fri, 12 Oct 2018 11:58:15 +0100 Subject: Re: [PATCH 4/7] mfd: ds90ux9xx: add TI DS90Ux9xx de-/serializer MFD driver To: , Lee Jones , Laurent Pinchart References: <20181008211205.2900-1-vz@mleia.com> <20181008211205.2900-5-vz@mleia.com> <20181012060314.GU4939@dell> <63733d2e-f95e-8894-f2b0-0b551b5cfeeb@mentor.com> <20181012083924.GW4939@dell> CC: Vladimir Zapolskiy , Linus Walleij , Rob Herring , Marek Vasut , Wolfram Sang , , , , From: Vladimir Zapolskiy Message-ID: <506c03d7-7986-44dd-3290-92d16a8106ad@mentor.com> Date: Fri, 12 Oct 2018 13:58:15 +0300 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Icedove/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: SVR-IES-MBX-09.mgc.mentorg.com (139.181.222.9) To SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Kieran, On 10/12/2018 12:20 PM, Kieran Bingham wrote: > Hi Vladimir, > > On 12/10/18 09:39, Lee Jones wrote: >> On Fri, 12 Oct 2018, Vladimir Zapolskiy wrote: >>> On 10/12/2018 09:03 AM, Lee Jones wrote: >>>> On Tue, 09 Oct 2018, Vladimir Zapolskiy wrote: >>>> >>>>> From: Vladimir Zapolskiy >>>>> >>>>> The change adds I2C device driver for TI DS90Ux9xx de-/serializers, >>>>> support of subdevice controllers is done in separate drivers, because >>>>> not all IC functionality may be needed in particular situations, and >>>>> this can be fine grained controlled in device tree. >>>>> >>>>> The development of the driver was a collaborative work, the >>>>> contribution done by Balasubramani Vivekanandan includes: >>>>> * original implementation of the driver based on a reference driver, >>>>> * regmap powered interrupt controller support on serializers, >>>>> * support of implicitly or improperly specified in device tree ICs, >>>>> * support of device properties and attributes: backward compatible >>>>> mode, low frequency operation mode, spread spectrum clock generator. >>>>> >>>>> Contribution by Steve Longerbeam: >>>>> * added ds90ux9xx_read_indirect() function, >>>>> * moved number of links property and added ds90ux9xx_num_fpd_links(), >>>>> * moved and updated ds90ux9xx_get_link_status() function to core driver, >>>>> * added fpd_link_show device attribute. >>>>> >>>>> Sandeep Jain added support of pixel clock edge configuration. >>>>> >>>>> Signed-off-by: Vladimir Zapolskiy >>>>> --- >>>>> drivers/mfd/Kconfig | 14 + >>>>> drivers/mfd/Makefile | 1 + >>>>> drivers/mfd/ds90ux9xx-core.c | 879 ++++++++++++++++++++++++++++++++++ >>>>> include/linux/mfd/ds90ux9xx.h | 42 ++ >>>>> 4 files changed, 936 insertions(+) >>>>> create mode 100644 drivers/mfd/ds90ux9xx-core.c >>>>> create mode 100644 include/linux/mfd/ds90ux9xx.h >>>>> >>>>> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig >>>>> index 8c5dfdce4326..a969fa123f64 100644 >>>>> --- a/drivers/mfd/Kconfig >>>>> +++ b/drivers/mfd/Kconfig >>>>> @@ -1280,6 +1280,20 @@ config MFD_DM355EVM_MSP >>>>> boards. MSP430 firmware manages resets and power sequencing, >>>>> inputs from buttons and the IR remote, LEDs, an RTC, and more. >>>>> >>>>> +config MFD_DS90UX9XX >>>>> + tristate "TI DS90Ux9xx FPD-Link de-/serializer driver" >>>>> + depends on I2C && OF >>>>> + select MFD_CORE >>>>> + select REGMAP_I2C >>>>> + help >>>>> + Say yes here to enable support for TI DS90UX9XX de-/serializer ICs. >>>>> + >>>>> + This driver provides basic support for setting up the de-/serializer >>>>> + chips. Additional functionalities like connection handling to >>>>> + remote de-/serializers, I2C bridging, pin multiplexing, GPIO >>>>> + controller and so on are provided by separate drivers and should >>>>> + enabled individually. >>>> >>>> This is not an MFD driver. >>> >>> Why do you think so? The representation of the ICs into device tree format >>> of hardware description shows that this is a truly MFD driver with multiple >>> IP subcomponents naturally mapped into MFD cells. >> >> This driver does too much real work ('stuff') to be an MFD driver. >> MFD drivers should not need to care of; links, gates, modes, pixels, >> frequencies maps or properties. Nor should they contain elaborate >> sysfs structures to control the aforementioned 'stuff'. >> >> Granted, there may be some code in there which could be appropriate >> for an MFD driver. However most of it needs moving out into a >> function driver (or two). >> >>> Basically it is possible to replace explicit of_platform_populate() by >>> adding a "simple-mfd" compatible, if it is desired. >>> >>>> After a 30 second Google of what this device actually does, perhaps >>>> drivers/media might be a better fit? >>> >>> I assume it would be quite unusual to add a driver with NO media functions >>> and controls into drivers/media. >> >> drivers/media may very well not be the correct place for this. In my >> 30 second Google, I saw that this device has a lot to do with cameras, >> hence my media association. >> >> If *all* else fails, there is always drivers/misc, but this should be >> avoided if at all possible. > > The device as a whole is FPD Link for camera devices I believe, but it I still don't understand (I could be biased though) why there is such a strong emphasis on cameras and media stuff in the discussion. No, "the device as a whole is FPD Link for camera devices" is a wrong statement. On hand I have a number of boards with serializers/deserializers from the TI DS90Ux9xx IC series and sensors are NOT connected to them. > certainly has different functions which are broken out in this > implementation. No, there is absolutely nothing broken out from the presented MFD drivers, the drivers are completely integral and basically I don't expect any. If you are concerned about media functionality, the correspondent MFD *cell* drivers will be added into drivers/media, drivers/gpu/drm or whatever is to be a proper place. > I think it might be quite awkward having the i2c components in > drivers/i2c and the media components in drivers/media/i2c, so what about > creating drivers/media/i2c/fpd-link (or such) as a container? I open drivers/media/i2c/Kconfig and all entries with no exception are under from 'if VIDEO_V4L2'. The MFD drivers do NOT require on depend on VIDEO_V4L2 or any other multimedia frameworks, nor the MFD drivers export any multimedia controls. > Our GMSL implementation is also a complex camera(s) device - but does > not yet use the MFD framework, perhaps that's something to add to my > todo list. > Okay, but the TI DS90Ux9xx is NOT a camera device, and it is NOT a multimedia device, but it is a pure MFD device so the argument is not applicable. > We currently keep all of the complexity within the max9286.c driver, but > I could foresee that being split further if more devices add to the > complexity of managing the bus. At which point we might want an > equivalent drivers/media/i2c/gmsl/ perhaps? > -- Best wishes, Vladimir >>> Laurent, can you please share your opinion? >