Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2646754pxu; Mon, 14 Dec 2020 07:38:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJyUrtVLDI9yj4oMYzE/tNLFg7W/e+vC031VMiQ7LyzCmqgQFqC9C6Yfp1akjkvtVDqBs74Z X-Received: by 2002:a17:906:ceca:: with SMTP id si10mr22759626ejb.547.1607960298502; Mon, 14 Dec 2020 07:38:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607960298; cv=none; d=google.com; s=arc-20160816; b=p7t+OeJpFXDn3DgUUBhbWLqq3Um0EMsO2P70DjK8vafm0Pn2kCtc/dJcG6Sf+ykfP9 CxHIR101nNM/kLHg/XNwCi9u5BRSIJ56QbyEwCC6GRGr7nvaaaW18cXr67j0zEVrrEgh 09PERhFaSwN19feZCnN5VyoUJ6nBOeTQGd/Ss4AO3VlfbFQRd4IGgjBv34DRofZJi0Gi x9ydHc/AtTr5zHoS/uQQPIWkwSi6rT6ZGkiU4a1TPAsDaDA4Qiff320baZYqcF8ahoxq WVQXidI5++riy2MKXj9MeH6tHF5+0DyFcSMw2MElHN8nsJPepzeuFxR4Aof5yWTehkOL sxNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=OnKzcsF3+pcPhl3eX+6zAwX2c5+tZZVyRMjVGVAQ4Tc=; b=wPP5WXpp69Y/8wI73auvTmSgImTkG5krJHP7ycRRT4JbUGQB3agMkMlFhvBRYpBjk9 Fll0QJAqvwfyaUNutk9mD06mQCRk5H4XSEWtjT6MfhTVwQLSvdg+kKC3LOgrhJXbLSZk ZvusclLpx1cBWP/FsjPqMblyyJ4LoBI/bzBZqaW92Ck+SesfxEqXtHVXHG+VeL7ve5gx 0q3fWoYEi4qVgZgBHb5TOgeIEOK98eCyMfnmUH1hefV9vyEyNpwi+KoDX4XxC3DL5fWs qgvXXrbIVOBcBYUQeQcJDakbsb04SZbwt9g65TtdnCpwGHpqjgJEcmNCsukndJ53d0Gd vWpg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q19si7334616ejx.617.2020.12.14.07.37.55; Mon, 14 Dec 2020 07:38:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729851AbgLNPeL (ORCPT + 99 others); Mon, 14 Dec 2020 10:34:11 -0500 Received: from mga04.intel.com ([192.55.52.120]:30982 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393522AbgLNPeA (ORCPT ); Mon, 14 Dec 2020 10:34:00 -0500 IronPort-SDR: gVNBJJXkFZzNdbQbxUzAs5ewxYV324hQS7eyIwpMU1yulLOdGXV4i3Af+fiZWJ33tR1WudOkgX vpVaJZoFUK/g== X-IronPort-AV: E=McAfee;i="6000,8403,9834"; a="172158481" X-IronPort-AV: E=Sophos;i="5.78,420,1599548400"; d="scan'208";a="172158481" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Dec 2020 07:32:14 -0800 IronPort-SDR: /HG8w61mTEl4KCXsgO03xHjFiK4b90Og4EnBaLT5jruDhCYt3dgNTnMCqVWOM3o59KCNoNzbR4 8HLWPKW8qunQ== X-IronPort-AV: E=Sophos;i="5.78,420,1599548400"; d="scan'208";a="411288740" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Dec 2020 07:32:05 -0800 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1kopqU-00EIeN-LK; Mon, 14 Dec 2020 17:33:06 +0200 Date: Mon, 14 Dec 2020 17:33:06 +0200 From: Andy Shevchenko To: Daniel Scally Cc: Laurent Pinchart , linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-gpio@vger.kernel.org, linux-i2c@vger.kernel.org, linux-media@vger.kernel.org, devel@acpica.org, rjw@rjwysocki.net, lenb@kernel.org, gregkh@linuxfoundation.org, mika.westerberg@linux.intel.com, linus.walleij@linaro.org, bgolaszewski@baylibre.com, wsa@kernel.org, yong.zhi@intel.com, sakari.ailus@linux.intel.com, bingbu.cao@intel.com, tian.shu.qiu@intel.com, mchehab@kernel.org, robert.moore@intel.com, erik.kaneda@intel.com, pmladek@suse.com, rostedt@goodmis.org, sergey.senozhatsky@gmail.com, linux@rasmusvillemoes.dk, kieran.bingham+renesas@ideasonboard.com, jacopo+renesas@jmondi.org, laurent.pinchart+renesas@ideasonboard.com, jorhand@linux.microsoft.com, kitakar@gmail.com, heikki.krogerus@linux.intel.com Subject: Re: [PATCH 18/18] ipu3: Add driver for dummy INT3472 ACPI device Message-ID: <20201214153306.GI4077@smile.fi.intel.com> References: <20201130133129.1024662-1-djrscally@gmail.com> <20201130133129.1024662-19-djrscally@gmail.com> <20201130200719.GB4077@smile.fi.intel.com> <20201130233232.GD25713@pendragon.ideasonboard.com> <20201201184925.GJ4077@smile.fi.intel.com> <6f3b0d7b-1ce7-aaf1-63c6-08a22dc77791@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6f3b0d7b-1ce7-aaf1-63c6-08a22dc77791@gmail.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Dec 13, 2020 at 10:48:39PM +0000, Daniel Scally wrote: > On 01/12/2020 18:49, Andy Shevchenko wrote: > >>>> + table_entry = (struct gpiod_lookup)GPIO_LOOKUP_IDX(acpi_dev_name(adev), > >>>> + ares->data.gpio.pin_table[0], > >>>> + func, 0, GPIO_ACTIVE_HIGH); > >>> > >>> You won't need this if you have regular INT3472 platform driver. > >>> Simple call there _DSM to map resources to the type and use devm_gpiod_get on > >>> consumer behalf. Thus, previous patch is not needed. > >> > >> How does the consumer (the camera sensor) retrieve the GPIO though ? The > >> _DSM is in the PMIC device object, while the real consumer is the camera > >> sensor. > > > > 1. A GPIO proxy > > 2. A custom GPIO lookup tables > > 3. An fwnode passing to the sensor (via swnodes graph) > > > > First may issue deferred probe, while second needs some ordering tricks I guess. > > Third one should also provide an ACPI GPIO mapping table or so to make the > > consumer rely on names rather than custom numbers. > > > > Perhaps someone may propose other solutions. > > Hi Andy > > Sorry; some more clarification here if you have time please: No problem, thanks for discussing this. > 1. Do you mean here, register a new gpio_chip providing GPIOs to the > sensors, and just have the .set() callback for that function set the > corresponding line against the INT3472 device? Yes. On one hand it should be a consumer (*gpiod_get*() family of APIs), on the other it should be provider of known (artificial) GPIO chip. > 2. I thought custom GPIO lookup tables was what I was doing, are you > referring to something else? I think so, i.e. nothing else from high point of view. > 3. I guess you mean something like of_find_gpio() and acpi_find_gpio() > here? As far as I can see there isn't currently a swnodes > equivalent...we could just pass it via reference of course but it would > mean the sensor drivers would all need to account for that. Theoretically we may provide GPIOs as swnodes. In that case the consumer will get them as usual But I think it may be too complicated / over engineered. -- With Best Regards, Andy Shevchenko