From patchwork Thu Aug 19 20:19:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 499822 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=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 A978BC4320A for ; Thu, 19 Aug 2021 20:26:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8B3F16108B for ; Thu, 19 Aug 2021 20:26:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234916AbhHSU1E (ORCPT ); Thu, 19 Aug 2021 16:27:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234942AbhHSU1D (ORCPT ); Thu, 19 Aug 2021 16:27:03 -0400 Received: from hillosipuli.retiisi.eu (hillosipuli.retiisi.eu [IPv6:2a01:4f9:c010:4572::81:2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8222C061756 for ; Thu, 19 Aug 2021 13:26:23 -0700 (PDT) Received: from lanttu.localdomain (unknown [192.168.2.193]) by hillosipuli.retiisi.eu (Postfix) with ESMTP id 3A684634C92; Thu, 19 Aug 2021 23:19:37 +0300 (EEST) From: Sakari Ailus To: linux-acpi@vger.kernel.org, linux-media@vger.kernel.org Cc: andriy.shevchenko@linux.intel.com, rafael@kernel.org Subject: [RFC 1/3] imx258: Defer probing on ident register read fail (on ACPI) Date: Thu, 19 Aug 2021 23:19:34 +0300 Message-Id: <20210819201936.7390-2-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210819201936.7390-1-sakari.ailus@linux.intel.com> References: <20210819201936.7390-1-sakari.ailus@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Return -EPROBE_DEFER if probing the device fails because of the I²C transaction (-EIO only). This generally happens when the power on sequence of the device has not been fully performed yet due to later probing of other drivers. Signed-off-by: Sakari Ailus --- drivers/media/i2c/imx258.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/media/i2c/imx258.c b/drivers/media/i2c/imx258.c index c249507aa2db..2751c12b6029 100644 --- a/drivers/media/i2c/imx258.c +++ b/drivers/media/i2c/imx258.c @@ -1109,6 +1109,14 @@ static int imx258_identify_module(struct imx258 *imx258) ret = imx258_read_reg(imx258, IMX258_REG_CHIP_ID, IMX258_REG_VALUE_16BIT, &val); + if (ret == -EIO && is_acpi_device_node(dev_fwnode(&client->dev))) { + /* + * If we get -EIO here and it's an ACPI device, there's a fair + * likelihood it's because the drivers required to power this + * device on have not probed yet. Thus return -EPROBE_DEFER. + */ + return -EPROBE_DEFER; + } if (ret) { dev_err(&client->dev, "failed to read chip id %x\n", IMX258_CHIP_ID); From patchwork Thu Aug 19 20:19:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 500448 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=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 82F69C4338F for ; Thu, 19 Aug 2021 20:26:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5FD2A60231 for ; Thu, 19 Aug 2021 20:26:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229660AbhHSU1E (ORCPT ); Thu, 19 Aug 2021 16:27:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234986AbhHSU1D (ORCPT ); Thu, 19 Aug 2021 16:27:03 -0400 X-Greylist: delayed 402 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 19 Aug 2021 13:26:23 PDT Received: from hillosipuli.retiisi.eu (hillosipuli.retiisi.eu [IPv6:2a01:4f9:c010:4572::81:2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E81AFC061575 for ; Thu, 19 Aug 2021 13:26:23 -0700 (PDT) Received: from lanttu.localdomain (unknown [192.168.2.193]) by hillosipuli.retiisi.eu (Postfix) with ESMTP id 50354634C93; Thu, 19 Aug 2021 23:19:37 +0300 (EEST) From: Sakari Ailus To: linux-acpi@vger.kernel.org, linux-media@vger.kernel.org Cc: andriy.shevchenko@linux.intel.com, rafael@kernel.org Subject: [RFC 2/3] gpio-tps68470: Allow building as module Date: Thu, 19 Aug 2021 23:19:35 +0300 Message-Id: <20210819201936.7390-3-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210819201936.7390-1-sakari.ailus@linux.intel.com> References: <20210819201936.7390-1-sakari.ailus@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Allow building gpio-tps68470 driver as a module. The intel_skl_int3472 is a module anyway, so making this a builtin does not really help setting up this one before a dependent module probes. Signed-off-by: Sakari Ailus Acked-by: Andy Shevchenko --- drivers/gpio/Kconfig | 2 +- drivers/gpio/gpio-tps68470.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index fab571016adf..8911c2df97d1 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -1378,7 +1378,7 @@ config GPIO_TPS65912 This driver supports TPS65912 gpio chip config GPIO_TPS68470 - bool "TPS68470 GPIO" + tristate "TPS68470 GPIO" depends on INTEL_SKL_INT3472 help Select this option to enable GPIO driver for the TPS68470 diff --git a/drivers/gpio/gpio-tps68470.c b/drivers/gpio/gpio-tps68470.c index 423b7bc30ae8..0ab88ef241de 100644 --- a/drivers/gpio/gpio-tps68470.c +++ b/drivers/gpio/gpio-tps68470.c @@ -155,4 +155,6 @@ static struct platform_driver tps68470_gpio_driver = { .probe = tps68470_gpio_probe, }; -builtin_platform_driver(tps68470_gpio_driver) +module_platform_driver(tps68470_gpio_driver); + +MODULE_LICENSE("GPL"); From patchwork Thu Aug 19 20:19:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 500447 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=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 317EAC4320E for ; Thu, 19 Aug 2021 20:26:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1669C6054E for ; Thu, 19 Aug 2021 20:26:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234986AbhHSU1F (ORCPT ); Thu, 19 Aug 2021 16:27:05 -0400 Received: from retiisi.eu ([95.216.213.190]:60258 "EHLO hillosipuli.retiisi.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234908AbhHSU1E (ORCPT ); Thu, 19 Aug 2021 16:27:04 -0400 X-Greylist: delayed 404 seconds by postgrey-1.27 at vger.kernel.org; Thu, 19 Aug 2021 16:27:03 EDT Received: from lanttu.localdomain (unknown [192.168.2.193]) by hillosipuli.retiisi.eu (Postfix) with ESMTP id 636CB634C94; Thu, 19 Aug 2021 23:19:37 +0300 (EEST) From: Sakari Ailus To: linux-acpi@vger.kernel.org, linux-media@vger.kernel.org Cc: andriy.shevchenko@linux.intel.com, rafael@kernel.org Subject: [RFC 3/3] gpio-tps68470: Add modalias Date: Thu, 19 Aug 2021 23:19:36 +0300 Message-Id: <20210819201936.7390-4-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210819201936.7390-1-sakari.ailus@linux.intel.com> References: <20210819201936.7390-1-sakari.ailus@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Add modalias for this driver, so that it is loaded automatically once the devices pop up. Signed-off-by: Sakari Ailus --- drivers/gpio/gpio-tps68470.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpio/gpio-tps68470.c b/drivers/gpio/gpio-tps68470.c index 0ab88ef241de..8afcd31f4ea3 100644 --- a/drivers/gpio/gpio-tps68470.c +++ b/drivers/gpio/gpio-tps68470.c @@ -158,3 +158,4 @@ static struct platform_driver tps68470_gpio_driver = { module_platform_driver(tps68470_gpio_driver); MODULE_LICENSE("GPL"); +MODULE_ALIAS("platform:tps68470-gpio");