Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751323AbdH2IbY (ORCPT ); Tue, 29 Aug 2017 04:31:24 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:41070 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751219AbdH2IbU (ORCPT ); Tue, 29 Aug 2017 04:31:20 -0400 X-IronPort-AV: E=Sophos;i="5.41,444,1498489200"; d="scan'208";a="256162310" From: Ramesh Shanmugasundaram To: Hans Verkuil , Mauro Carvalho Chehab CC: Linux Doc Mailing List , "Linux Media Mailing List" , Mauro Carvalho Chehab , "linux-kernel@vger.kernel.org" , Jonathan Corbet , "Hans Verkuil" , Chris Paterson Subject: RE: [PATCH v4 7/7] media: open.rst: add a notice about subdev-API on vdev-centric Thread-Topic: [PATCH v4 7/7] media: open.rst: add a notice about subdev-API on vdev-centric Thread-Index: AQHTHmIk7onPWBSDqUGaVBLi62kIzKKZjXoAgAAHAICAAAb8gIABWjEA Date: Tue, 29 Aug 2017 08:31:15 +0000 Message-ID: References: <20170828073009.3762b293@vento.lan> <31b0ab20-3079-9c4a-e0f7-d9173b865db5@xs4all.nl> In-Reply-To: <31b0ab20-3079-9c4a-e0f7-d9173b865db5@xs4all.nl> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [193.141.220.21] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;KL1PR0601MB1320;20:LsnPcI3FJ6INsMsvCa/k+dYhKN6GThIdNR1BpFk43QVNeOe9b/klQagQpHU5b1W73sfqQfdvus9roOMC9/LhPKkDNGawESBMfiRfAzJq6d4zEh0gplF3aHbAsLRpQRjasVn5I/axqy8gm+55Fbk/hWQGh6av60jyOdciSRijUT4= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 25f7b9ed-4ab7-4aa9-d47b-08d4eeb85054 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(48565401081)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:KL1PR0601MB1320; x-ms-traffictypediagnostic: KL1PR0601MB1320: x-exchange-antispam-report-test: UriScan:(278428928389397)(788757137089)(17755550239193); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(100000703101)(100105400095)(6055026)(6041248)(20161123564025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123562025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:KL1PR0601MB1320;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:KL1PR0601MB1320; x-forefront-prvs: 0414DF926F x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(39860400002)(24454002)(189002)(45074003)(199003)(2950100002)(7696004)(53546010)(66066001)(15650500001)(5660300001)(4326008)(305945005)(3660700001)(74316002)(101416001)(86362001)(105586002)(33656002)(2900100001)(7736002)(3280700002)(106356001)(25786009)(2906002)(478600001)(54356999)(76176999)(107886003)(50986999)(68736007)(9686003)(55016002)(99286003)(14454004)(6246003)(53936002)(102836003)(6116002)(3846002)(42882006)(54906002)(93886005)(81166006)(97736004)(8936002)(81156014)(6436002)(5250100002)(8676002)(229853002)(6506006)(189998001);DIR:OUT;SFP:1102;SCL:1;SRVR:KL1PR0601MB1320;H:KL1PR0601MB2038.apcprd06.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:0;LANG:en; authentication-results: spf=none (sender IP is ) smtp.mailfrom=ramesh.shanmugasundaram@bp.renesas.com; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: bp.renesas.com X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Aug 2017 08:31:15.3806 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR0601MB1320 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id v7T8VSJp031925 Content-Length: 4648 Lines: 93 Hi Hans, > On 28/08/17 12:30, Mauro Carvalho Chehab wrote: > > Em Mon, 28 Aug 2017 12:05:06 +0200 > > Hans Verkuil escreveu: > > > >> On 26/08/17 13:53, Mauro Carvalho Chehab wrote: > >>> The documentation doesn't mention if vdev-centric hardware control > >>> would have subdev API or not. > >>> > >>> Add a notice about that, reflecting the current status, where three > >>> drivers use it, in order to support some subdev-specific controls. > >> > >> I posted a patch removing v4l-subdevX support for cobalt. It's only > >> used within Cisco, so this is safe to do and won't break any userspace > support. > > > > OK. > > > >> atmel-isc is another driver that creates subdev nodes. Like cobalt, > >> this is unnecessary. There are no sensors that use private controls. > > > > The question is not if the driver has private controls. Private > > controls can be V4L2 device node oriented. > > > > The real question is if userspace applications use subdevs or not in > > order to set something specific to a subdev, on a pipeline where > > multiple subdevs could use the same control. > > > > E. g. even on a simple case where the driver would have something like: > > > > sensor -> processing -> DMA > > > > both "sensor" and "processing" could provide the same control (bright, > > contrast, gain, or whatever). Only by exposing such control via subdev > > is possible to pinpoint what part of the hardware pipeline would be > > affected when such control is changed. > > In theory, yes. In practice this does not happen for any of the V4L2- > centric drivers. Including for the three drivers under discussion. > > > > >> This driver is not referenced anywhere (dts or board file) in the > kernel. > >> It is highly unlikely anyone would use v4l-subdevX nodes when there > >> is no need to do so. My suggestion is to add a kernel option for this > >> driver to enable v4l-subdevX support, but set it to 'default n'. > >> Perhaps with a note in the Kconfig description and a message in the > >> kernel log that this will be removed in the future. > >> > >> The final driver is rcar_drif that uses this to set the "I2S Enable" > >> private control of the max2175 driver. > >> > >> I remember that there was a long discussion over this control. I > >> still think that there is no need to mark this private. > > > > The problem with I2S is that a device may have multiple places where > > I2S could be used. I don't know how the rcar-drif driver uses it, but > > there are several vdev-centric boards that use I2S for audio. > > > > On several of the devices I worked with, the I2S can be enabled, in > > runtime, if the audio signal would be directed to some digital output, > > or it can be disabled if the audio signal would be directed to some > > analog output. Thankfully, on those devices, I2S can be indirectly > > controlled via either an ALSA mixer or via VIDIOC A/V routing ioctls. > > Also, there's just one I2S bus on them. > > > > However, on a device that have multiple I2S bus, userspace should be > > able to control each of them individually, as some parts of the > > pipeline may require it enabled while others may require it disabled. > > So, I strongly believe that this should be a subdev control on such > > hardware. > > > > That's said, I don't know how rcar_drif uses it. If it has just one > > I2S bus and it is used only for audio, then VIDIOC A/V routing ioctls > > and/or an ALSA mixer could replace it. If not, then it should be kept > > as-is and the driver would need to add support for MC, in order for > > applications to identify the right sub-devices that are associated > > with the pipelines where I2S will be controlled. > > Ramesh, do applications using rcar_drif + max2175 have to manually enable > the i2s? Shouldn't this be part of the device tree description instead? > Yes, applications have to control this explicitly. It is not only enable but also disable control is used at run time and hence DT is not applicable. rcar_drif has two registers to write to enable rx on two data pins. It expects a sequence where the master stops output (in this max2175 i2s output - disable) - enable rcar_drif rx and then the master starts output (max2175 i2s output - enable). The application ensures this sequence today. It is one I2S bus and it is not used for audio but raw I/Q samples from max2175 tuner. The v4l2_subdev_tuner_ops does not have .s_stream api as in v4l2_subdev_video_ops and v4l2_subdev_audio_ops. If we plan to have one this functionality may be hidden inside it and no need for an explicit control. I too do not like a private control option. Thanks, Ramesh