From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6C99C2BA1E for ; Mon, 6 Apr 2020 07:46:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9E15F20731 for ; Mon, 6 Apr 2020 07:46:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586159214; bh=y1V0y5qByl604OEH2YnRM/oaDhSWbRYnOBO3/Q8sV1g=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=i2W7woCel8C7ql2Akccf35qZB4lfm0xPtcvGWvHEc/M0MZgO52K7tzTAe6yGTeAlu xoiq/fYn/odkAYRd3Ibzqx66Evi+6kqu7ElB/3mvDB3xG2r4jpcgPj1xTKhCpGX2FS UQq8j2eRCA2OsO8dY9BTi+QL40oIVWiRyiAlEoi0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726591AbgDFHqx (ORCPT ); Mon, 6 Apr 2020 03:46:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:56310 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726475AbgDFHqx (ORCPT ); Mon, 6 Apr 2020 03:46:53 -0400 Received: from coco.lan (ip5f5ad4d8.dynamic.kabel-deutschland.de [95.90.212.216]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 26D85206F5; Mon, 6 Apr 2020 07:46:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586159212; bh=y1V0y5qByl604OEH2YnRM/oaDhSWbRYnOBO3/Q8sV1g=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=AkF8viHMnjwxIIQDLRi8bLfelyOx5KL02q8bMWh4XEhGRpSk8BtJMuDhz76aIvqix 12PQNXmLNtmvsDBto0D6NU7yWjEKTpRXkDbzOfebECj47JWsJzAjEbeZ90grjMzzq0 BxJY/i4R+hzAA6x9VeDTajqkhPMHa54InTzsNxw0= Date: Mon, 6 Apr 2020 09:46:45 +0200 From: Mauro Carvalho Chehab To: Andy Shevchenko Cc: Joe Perches , Rasmus Villemoes , Sakari Ailus , Petr Mladek , Andy Shevchenko , Linux Media Mailing List , Dave Stevenson , dri-devel , Linux Kernel Mailing List , Hans Verkuil , Laurent Pinchart , Sergey Senozhatsky , Steven Rostedt , Jani Nikula Subject: Re: [PATCH v2 1/1] lib/vsprintf: Add support for printing V4L2 and DRM fourccs Message-ID: <20200406094645.5f96457a@coco.lan> In-Reply-To: References: <20200403091156.7814-1-sakari.ailus@linux.intel.com> <1105bfe5-88f1-040e-db40-54d7761747d5@rasmusvillemoes.dk> <20200403193242.38611906@coco.lan> <2751400ae13b25d8259a8a9d7b36caf98ec2d367.camel@perches.com> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Fri, 3 Apr 2020 21:32:42 +0300 Andy Shevchenko escreveu: > On Fri, Apr 3, 2020 at 8:54 PM Joe Perches wrote: > > On Fri, 2020-04-03 at 19:32 +0200, Mauro Carvalho Chehab wrote: > > > Em Fri, 03 Apr 2020 09:56:42 -0700 > > > Joe Perches escreveu: > > > It _might_ be useful to use a CONFIG_MEDIA_SUPPORT guard > > in lib/vsprintf for this. > > No need. FourCC, if Sakari makes it more generic, can be used for > other purposes, e.g. printing component names from the chips (not > related to media at all). > Hmm... not 100% sure about what you're meaning with "component names". At media, some vendors use a cc-like code to allow identifying the name of the chip, retrieved on a common register via an I2C bus. Omnivision uses, for example, uses a 2 bytes code: OV5670_CHIP_ID 0x5670 OV5675_CHIP_ID 0x5675 OV2680_CHIP_ID 0x2680 OV5670_CHIP_ID 0x5670 OV5675_CHIP_ID 0x5675 We used this at the em28xx driver to detect a camera sensor, and give a name for the chip (see drivers/media/usb/em28xx/em28xx-camera.c): switch (id) { case 0x2642: name = "OV2640"; dev->em28xx_sensor = EM28XX_OV2640; break; case 0x7648: name = "OV7648"; break; case 0x7660: name = "OV7660"; break; Yet, this is not too reliable, as, for some products, they use something different: OV8856_CHIP_ID 0x885a OV13858_CHIP_ID 0xd855 OV9640 can either be 0x9648 or 0x9649, depending on its revision. If you're referring to this kind of code, I don't think we can have something generic. Thanks, Mauro