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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E8E2C636CD for ; Fri, 10 Feb 2023 15:42:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232396AbjBJPmj (ORCPT ); Fri, 10 Feb 2023 10:42:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232083AbjBJPmc (ORCPT ); Fri, 10 Feb 2023 10:42:32 -0500 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D84F522002 for ; Fri, 10 Feb 2023 07:42:30 -0800 (PST) X-IronPort-AV: E=McAfee;i="6500,9779,10617"; a="329076296" X-IronPort-AV: E=Sophos;i="5.97,287,1669104000"; d="scan'208";a="329076296" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Feb 2023 07:42:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10617"; a="756822457" X-IronPort-AV: E=Sophos;i="5.97,287,1669104000"; d="scan'208";a="756822457" Received: from smile.fi.intel.com ([10.237.72.54]) by FMSMGA003.fm.intel.com with ESMTP; 10 Feb 2023 07:42:27 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1pQVXd-0056iu-1y; Fri, 10 Feb 2023 17:42:25 +0200 Date: Fri, 10 Feb 2023 17:42:25 +0200 From: Andy Shevchenko To: Sakari Ailus Cc: Laurent Pinchart , Hans de Goede , Mauro Carvalho Chehab , Tsuchiya Yuto , Yury Luneff , Nable , andrey.i.trufanov@gmail.com, Fabio Aiuto , linux-media@vger.kernel.org, linux-staging@lists.linux.dev Subject: Re: [PATCH 28/57] media: Add ovxxxx_16bit_addr_reg_helpers.h Message-ID: References: <20230123125205.622152-1-hdegoede@redhat.com> <20230123125205.622152-29-hdegoede@redhat.com> <026272d3-88d7-a67f-4942-5cba6c3eab86@redhat.com> <4e501e71-a226-a022-83e2-f53686ca07a7@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org On Fri, Feb 10, 2023 at 02:26:31PM +0200, Sakari Ailus wrote: > On Fri, Feb 10, 2023 at 01:45:10PM +0200, Laurent Pinchart wrote: > > Regarding the width-specific versions of the helpers, I really think > > encoding the size in the register macros is the best option. It makes > > life easier for driver authors (only one function to call, no need to > > think about the register width to pick the appropriate function in each > > call) and reviewers (same reason), without any drawback in my opinion. > > As I noted previously, this works well for drivers that need to access > registers with multiple widths, which indeed applies to the vast majority > of camera sensor drivers, but not to e.g. flash or lens VCM drivers. Fixed > width registers are better served with a width-specific function. But these > can be always added later on. Again, we can extend regmap to have something like int (*reg_width)(regmap *, offset) callback added that will tell the regmap bus underneath what size to use. In the driver one will define the respective method to return these widths. -- With Best Regards, Andy Shevchenko