From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966798AbcAZQvx (ORCPT ); Tue, 26 Jan 2016 11:51:53 -0500 Received: from mout.kundenserver.de ([212.227.126.134]:57179 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966688AbcAZQvt (ORCPT ); Tue, 26 Jan 2016 11:51:49 -0500 From: Arnd Bergmann To: Mauro Carvalho Chehab Cc: linux-arm-kernel@lists.infradead.org, Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 6/7] [media] em28xx: add MEDIA_TUNER dependency Date: Tue, 26 Jan 2016 17:51:11 +0100 Message-ID: <5775609.WPlM7VCgVr@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <20160126143644.1d104040@recife.lan> References: <1453817424-3080054-1-git-send-email-arnd@arndb.de> <6929423.KuNZKsBgHV@wuerfel> <20160126143644.1d104040@recife.lan> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:wzpUgsu/93NPgPBZz+I/YSUe2jR1FemSRj/jlTpJSBfmftXirmM e+lvyFyyLs2huRvpi/ABJDKSp0aKYZhLVKXkKWO+yUa/1NBbX+B9bSF3rk+rrcSCKv9yYpB HzB6zQRRwL4u1YeJ47W/WkWHTsWZdTxD3rRbJydGrgCZcmYQ4izJabSziYtg8af3R9ZN1us Vuc+oF0MvNuSF+b3Vmuug== X-UI-Out-Filterresults: notjunk:1;V01:K0:P2DDwV6MR4U=:/ectl5SKlIDvrjCswq5kmy hKnwViGzv/+jGzmrujDfTHS+nGg+gwIOEknmwIu4EJi78HN6TKrCsS/pahYz5kE/c2NZa4tsI 7miQEMrYk/YmaO+HUS1sMwl5mlFgl/EEPEr/AW+73a2jg53UtrBixHAaZOrLCqhOQXV0qa73l yWNOabRiWrQyMdIREd2k43nF+h0WoZKJL4dN7X7KBXQpgwk/4iO68EcvJwWCw87qWh5rrNYPq Dwgl+te1eWc0VWd+GGRBP6vyjvspFKycGRDtLbB23rU4+7r9KDZ2XZX3nd9kxvIwDvKUjd/ru gAuABv1clvAfk2DOEmSkYGkCxep7Zn4CR8zDclMttGEfJZ/WhmxDIB64BVkXYV0zYdNTonuyE dtamnbRaZVV8sboRNtAsvWwpjtmVsCHlV0GyCBFcBcm8DVJUG4rc3ehoF8HemLMkbCH00XtWF MVQ5X2KqP5rMdIojehbtZxCUIAnR8CP6sZZZLroq8t4Ut3DnQ06kTh/MK9QYCdtz34uO7+PSK XgDCgfU3GEyAdoeVoEkULr3b+W7hotgGIAeCkB7qvbCzYBvOuPk1NwIth49WRIFN+OATT/Ud6 T31Cci168fCgRVmbOWxcmt3FPdXW1ZV2lMPItDANPWpXU3/4gt98VHjUB+gUxGSDyvnrjpkfn Ar+fSuFa3viv7QzgFradIYlQAV43zARJ6HyHZsx4EJtk1pvepSVVzl/t+Up0HqKX3Jjp74we4 v+ezsbpBQ1wRo4c4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday 26 January 2016 14:36:44 Mauro Carvalho Chehab wrote: > Em Tue, 26 Jan 2016 16:53:38 +0100 > Arnd Bergmann escreveu: > > On Tuesday 26 January 2016 12:33:08 Mauro Carvalho Chehab wrote: > > > Em Tue, 26 Jan 2016 15:10:00 +0100 > > > Advanced users may, instead, manually select the media tuner that his > > > hardware needs. In such case, it doesn't matter if MEDIA_TUNER > > > is enabled or not. > > > > > > As this is due to a Kconfig limitation, I've no idea how to fix or get > > > hid of it, but making em28xx dependent of MEDIA_TUNER is wrong. > > > > I don't understand what limitation you see here. > > Before MEDIA_TUNER, what we had was something like: > > config MEDIA_driver_foo > select VIDEO_tuner_bar if MEDIA_SUBDRV_AUTOSELECT > select MEDIA_frontend_foobar if MEDIA_SUBDRV_AUTOSELECT > ... > > However, as different I2C drivers had different dependencies, this > used to cause lots of troubles. So, one of the Kbuild maintainers > came out with the idea of converting from select into depends on. > The MEDIA_TUNER is just an ancillary invisible option to make it > work at the tuner's side, as usually what we want is to have all > tuners selected, as we don't have a one to one mapping about what > driver supports what tuner (nor we wanted to do it, as this would > mean lots of work for not much gain). Ok > > The definition > > of the VIDEO_TUNER symbol is an empty 'tristate' symbol with a > > dependency on MEDIA_TUNER to ensure we get a warning if MEDIA_TUNER > > is not enabled, and to ensure it is set to 'm' if MEDIA_TUNER=m and > > a "bool" driver selects VIDEO_TUNER. > > No, VIDEO_TUNER is there because we wanted to be able to use select > to enable V4L2 tuner core support and let people to manually select > the needed I2C devices with MEDIA_SUBDRV_AUTOSELECT unselected. I meant what the dependency is there for, not the symbol itself. It's clear what the symbol does. > > diff --git a/drivers/media/v4l2-core/Kconfig b/drivers/media/v4l2-core/Kconfig > > index 9beece00869b..1050bdf1848f 100644 > > --- a/drivers/media/v4l2-core/Kconfig > > +++ b/drivers/media/v4l2-core/Kconfig > > @@ -37,7 +37,11 @@ config VIDEO_PCI_SKELETON > > # Used by drivers that need tuner.ko > > config VIDEO_TUNER > > tristate > > - depends on MEDIA_TUNER > > + > > +config VIDEO_TUNER_MODULE > > + tristate # must not be built-in if MEDIA_TUNER=m because of I2C > > + default y if VIDEO_TUNER=y || MEDIA_TUNER=y > > + default m if VIDEO_TUNER=m > > Doesn't need to worry about that, because all drivers that select VIDEO_TUNER > depend on I2C: > Ok, then the dependency does not do anything other than generate a warning. > diff --git a/drivers/media/v4l2-core/Kconfig b/drivers/media/v4l2-core/Kconfig > index 9beece00869b..b30e1c879a57 100644 > --- a/drivers/media/v4l2-core/Kconfig > +++ b/drivers/media/v4l2-core/Kconfig > @@ -37,7 +37,7 @@ config VIDEO_PCI_SKELETON > # Used by drivers that need tuner.ko > config VIDEO_TUNER > tristate > - depends on MEDIA_TUNER > + default MEDIA_TUNER > > # Used by drivers that need v4l2-mem2mem.ko > config V4L2_MEM2MEM_DEV So this means it's now enabled if MEDIA_TUNER is enabled, whereas before it was only enabled when explicitly selected. That sounds like a useful change, but it also seems unrelated to the warning fix, and should probably be a separate change, while for now we can simply remove the 'depends on' line without any replacement. > Ok, if we'll have platform drivers for analog TV using the I2C bus > at directly in SoC, then your solution is better, but the tuner core > driver may not be the best way of doing it. So, for now, I would use > the simpler version. Ok. Do you want me to submit a new version or do you prefer to write one yourself? With or without the 'default'? Arnd