From patchwork Thu Sep 20 16:19:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda Delgado X-Patchwork-Id: 10608037 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 449246CB for ; Thu, 20 Sep 2018 16:19:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 34F632DFFD for ; Thu, 20 Sep 2018 16:19:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 28EC92DFFF; Thu, 20 Sep 2018 16:19:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CADF82DFFD for ; Thu, 20 Sep 2018 16:19:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731047AbeITWDc (ORCPT ); Thu, 20 Sep 2018 18:03:32 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:41622 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726193AbeITWDb (ORCPT ); Thu, 20 Sep 2018 18:03:31 -0400 Received: by mail-ed1-f67.google.com with SMTP id f38-v6so8344078edd.8; Thu, 20 Sep 2018 09:19:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=P/7Od3Bj2AH1Mmk63PhuUtdaCKTzQLyh+cixL8GilLY=; b=cOLsMziA9BAeUv5/iJXyQ4Lm7JUpn4XDuXm9uTAWsT2LJxuLCfBT2VxkLMYvEo6rkx WL54RTTlX6oDxfiv0r3EkpIgq/vSLQibnxDfIxyq6uQrSSVaszki+DOv8it7quL+ERZk olFC7QhrAhfmikdCm9knbZwcMM0Q4vG1KpZUjIY/jZa1tIHQm1XF/6PA1Q7781F5ZISy U9fOy8cBrSyYTQfxYMTprCZqjZm3CITAkIOyQVzsyvzzN7zMlS+8fz7Dzmz4gPaUVDq7 gisP0cDpZy6uZIhPoGhfMTwk0feoJzQhEOiE8k1PrTKjPoB3vichr0SCXgKFCU/KxW6t RBww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=P/7Od3Bj2AH1Mmk63PhuUtdaCKTzQLyh+cixL8GilLY=; b=iewBvevtwXOfr44+47EBVlvynd9hfXAGwaG/O1NbjSqCRDtL/tx4bN5MyHhNkitCiM Nx6fvT/bNz0U3J4Tx0CcG36G/Y/yMvlWI19ZaSNX6T9S0zlYe9CWUB/QwK/w8PWK5qH7 Zvvigcd2gmOWopu5pYeXUxRmcM3vl3A0FnAb9WY4CebZ2OhYGQVF25/FQXNGOM3UjX7K uYkJ5ywKm+u3kl/duXhATOnE55TCK55nxF7HJq4yJr8QDwTKj27jKmjKUBxxHa/CRHcE 90TlrWNfeA3F6lTYsYgivkiQ4HCyLNYZO5f4GQJR34q34bDuGEe4nzhY0xZN8G2Gxpvl HDWA== X-Gm-Message-State: APzg51DFyee+BitjTDehm0gK+vOlpwHAS19UxIA9AZT+3TUzzjVco6VY nQE/qq/RZN8YlQXRTw8/XIE= X-Google-Smtp-Source: ANB0VdbpPUXDbfFyoJw/6h/fGM+SP/mJCJ2KvJG1Aup2l0A664zmJJZCdCn7FvGpMKMtOJ8orjwbNA== X-Received: by 2002:a50:fc03:: with SMTP id i3-v6mr1752545edr.85.1537460355676; Thu, 20 Sep 2018 09:19:15 -0700 (PDT) Received: from piling.lan (80-71-134-83.u.parknet.dk. [80.71.134.83]) by smtp.gmail.com with ESMTPSA id h40-v6sm958144edh.88.2018.09.20.09.19.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Sep 2018 09:19:14 -0700 (PDT) From: Ricardo Ribalda Delgado To: Pavel Machek , Sakari Ailus , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Hans Verkuil , Laurent Pinchart Cc: Ricardo Ribalda Delgado Subject: [PATCH 1/4] [media] ad5820: Define entity function Date: Thu, 20 Sep 2018 18:19:09 +0200 Message-Id: <20180920161912.17063-1-ricardo.ribalda@gmail.com> X-Mailer: git-send-email 2.18.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Without this patch, media_device_register_entity throws a warning: dev_warn(mdev->dev, "Entity type for entity %s was not initialized!\n", entity->name); Signed-off-by: Ricardo Ribalda Delgado Reviewed-by: Laurent Pinchart --- drivers/media/i2c/ad5820.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/i2c/ad5820.c b/drivers/media/i2c/ad5820.c index 907323f0ca3b..22759aaa2dba 100644 --- a/drivers/media/i2c/ad5820.c +++ b/drivers/media/i2c/ad5820.c @@ -317,6 +317,7 @@ static int ad5820_probe(struct i2c_client *client, v4l2_i2c_subdev_init(&coil->subdev, client, &ad5820_ops); coil->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; coil->subdev.internal_ops = &ad5820_internal_ops; + coil->subdev.entity.function = MEDIA_ENT_F_LENS; strscpy(coil->subdev.name, "ad5820 focus", sizeof(coil->subdev.name)); ret = media_entity_pads_init(&coil->subdev.entity, 0, NULL); From patchwork Thu Sep 20 16:19:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda Delgado X-Patchwork-Id: 10608043 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 021506CB for ; Thu, 20 Sep 2018 16:19:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E3CA02DFA9 for ; Thu, 20 Sep 2018 16:19:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D623E2DFFE; Thu, 20 Sep 2018 16:19:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 793A12DFA9 for ; Thu, 20 Sep 2018 16:19:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731136AbeITWDe (ORCPT ); Thu, 20 Sep 2018 18:03:34 -0400 Received: from mail-ed1-f65.google.com ([209.85.208.65]:42927 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730149AbeITWDd (ORCPT ); Thu, 20 Sep 2018 18:03:33 -0400 Received: by mail-ed1-f65.google.com with SMTP id l5so8334277edw.9; Thu, 20 Sep 2018 09:19:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=17p35fcEomFEHCE0Bwjf+jK4FTdDkqZHbOftL8d9eKs=; b=ECaMEUxN+bjmdq6vFeR1QhHNjswTYctVpgRSu6eg4UwzmX1/SpI3MbF3l6tXVf86Sa JpscXZqoUSnDpnN988xChgtNrDB7NU9AKkjBZIPl/JQMcL6wPTkrY82h+iDAxJNJCl8h CIBr1waHFyxDpCOpex2vI9TwHhLEB8FTMGBEMSbxkgyONqDm1/9TNh0h8OoK2Qht+Ih4 +8n6/0AtjF2iNcepuCCBxx/Z7q+McSopFOSYA0tpR967PHisVHnlA+Wf4PI184+765Ci TY1jdX8hQGp8+U3lB5q5lSe5JVW4Ug1oIxa+Ek3czBb5MarGh5kGemKspJVtHvAezTtl i23Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=17p35fcEomFEHCE0Bwjf+jK4FTdDkqZHbOftL8d9eKs=; b=fwYf0Q6RbAKfQmcFuTOn7LCJZVpYNh7hiAWCmtcMTdh7Uf9dKXXmIOdBfLFo0OycYj uTfC1Cbk25kWXyzf1Vpc1CcYTr3VEM5jKvIAi6PPJaQ7LZiTD5W4F2bOxD1MUKwe1IjU DVXv74hl4DF5GRvPXhR4lGqssKQ8HcB+enDlP1kp8X1Rc+svbcg692lTrLTWGHj9o2M2 JLel9eNHm2GFEILeGstGYcMd07bdiuSjDOsL969MzNGCyjyvwMcxV8HZBM7s8ml7YEBg dIfMDXaUK5m6fs7exNKyenDrf70box2cmp5pYpXQTmyZoT+YMfOBheeqbg87ty7T4VTG am3w== X-Gm-Message-State: APzg51Afky+J8NWVBb/cT7czlf7MvVUiHMmaAN2tF/rlWC7Cpa3jRzF8 ShNNu4XNs7Luijt2VbTucnT2IrWu X-Google-Smtp-Source: ANB0VdZxP8sZzqP2HRvTnrCPVlkHtfCYtsCYq3KMgBGJ1pqG3374qYJe5gQeappy4/bW0vxCZSGzBg== X-Received: by 2002:a50:9817:: with SMTP id g23-v6mr5076773edb.277.1537460357900; Thu, 20 Sep 2018 09:19:17 -0700 (PDT) Received: from piling.lan (80-71-134-83.u.parknet.dk. [80.71.134.83]) by smtp.gmail.com with ESMTPSA id h40-v6sm958144edh.88.2018.09.20.09.19.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Sep 2018 09:19:16 -0700 (PDT) From: Ricardo Ribalda Delgado To: Pavel Machek , Sakari Ailus , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Hans Verkuil , Laurent Pinchart Cc: Ricardo Ribalda Delgado Subject: [PATCH 2/4] [media] ad5820: Add support for enable pin Date: Thu, 20 Sep 2018 18:19:10 +0200 Message-Id: <20180920161912.17063-2-ricardo.ribalda@gmail.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180920161912.17063-1-ricardo.ribalda@gmail.com> References: <20180920161912.17063-1-ricardo.ribalda@gmail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds support for a programmable enable pin. It can be used in situations where the ANA-vcc is not configurable (dummy-regulator), or just to have a more fine control of the power saving. The use of the enable pin is optional Signed-off-by: Ricardo Ribalda Delgado --- drivers/media/i2c/Kconfig | 2 +- drivers/media/i2c/ad5820.c | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig index bfdb494686bf..1ba6eaaf58fb 100644 --- a/drivers/media/i2c/Kconfig +++ b/drivers/media/i2c/Kconfig @@ -321,7 +321,7 @@ config VIDEO_ML86V7667 config VIDEO_AD5820 tristate "AD5820 lens voice coil support" - depends on I2C && VIDEO_V4L2 && MEDIA_CONTROLLER + depends on GPIOLIB && I2C && VIDEO_V4L2 && MEDIA_CONTROLLER ---help--- This is a driver for the AD5820 camera lens voice coil. It is used for example in Nokia N900 (RX-51). diff --git a/drivers/media/i2c/ad5820.c b/drivers/media/i2c/ad5820.c index 22759aaa2dba..20931217e3b1 100644 --- a/drivers/media/i2c/ad5820.c +++ b/drivers/media/i2c/ad5820.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -55,6 +56,8 @@ struct ad5820_device { u32 focus_ramp_time; u32 focus_ramp_mode; + struct gpio_desc *enable_gpio; + struct mutex power_lock; int power_count; @@ -122,6 +125,9 @@ static int ad5820_power_off(struct ad5820_device *coil, bool standby) ret = ad5820_update_hw(coil); } + if (coil->enable_gpio) + gpiod_set_value_cansleep(coil->enable_gpio, 0); + ret2 = regulator_disable(coil->vana); if (ret) return ret; @@ -136,6 +142,9 @@ static int ad5820_power_on(struct ad5820_device *coil, bool restore) if (ret < 0) return ret; + if (coil->enable_gpio) + gpiod_set_value_cansleep(coil->enable_gpio, 1); + if (restore) { /* Restore the hardware settings. */ coil->standby = false; @@ -146,6 +155,8 @@ static int ad5820_power_on(struct ad5820_device *coil, bool restore) return 0; fail: + if (coil->enable_gpio) + gpiod_set_value_cansleep(coil->enable_gpio, 0); coil->standby = true; regulator_disable(coil->vana); @@ -312,6 +323,15 @@ static int ad5820_probe(struct i2c_client *client, return ret; } + coil->enable_gpio = devm_gpiod_get_optional(&client->dev, "enable", + GPIOD_OUT_LOW); + if (IS_ERR(coil->enable_gpio)) { + ret = PTR_ERR(coil->enable_gpio); + if (ret == -EPROBE_DEFER) + dev_err(&client->dev, "could not get enable gpio\n"); + return ret; + } + mutex_init(&coil->power_lock); v4l2_i2c_subdev_init(&coil->subdev, client, &ad5820_ops); From patchwork Thu Sep 20 16:19:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda Delgado X-Patchwork-Id: 10608041 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 21723161F for ; Thu, 20 Sep 2018 16:19:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 116772DFA9 for ; Thu, 20 Sep 2018 16:19:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 057972DFFE; Thu, 20 Sep 2018 16:19:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AAD992DFA9 for ; Thu, 20 Sep 2018 16:19:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731463AbeITWDg (ORCPT ); Thu, 20 Sep 2018 18:03:36 -0400 Received: from mail-ed1-f65.google.com ([209.85.208.65]:39114 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726193AbeITWDf (ORCPT ); Thu, 20 Sep 2018 18:03:35 -0400 Received: by mail-ed1-f65.google.com with SMTP id h4-v6so8353435edi.6; Thu, 20 Sep 2018 09:19:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ss5zDbLVVTieLcNOaPlahFyyALIdwzonzBdsnOHzuL4=; b=uDTpu5M3khv84mZ9i/0+iUa0iLQIStswIeuYmSJdv1KLDXrABsLNPjM8SmnMUZ4R70 uOktf47tKmT8TxSiLBMioCuN/qaFpOjTKUZ/MDRQ6IhP/k8qM4GzIl5TttEaWuFLvqSh nw5TVNtX0dj3iw/zjQstD/FmvTWE09quBh5lrJHWP1xoOf0N3REEFmRln+AotDEUX8kF 7sKpijA47l05akqsFApj0N1gTQJJ/87hDjJIFi/Ccqo7pJyPLv6G66zIggL57bip5IAS eF2dDFMqsHhJDtTCpe3PLDsixHn5H79gjqw598TgQafhhFvQ50k0Q+w0rIWR66vKqYJ/ 5zlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ss5zDbLVVTieLcNOaPlahFyyALIdwzonzBdsnOHzuL4=; b=ZnuIynbcXVbdQeqIZP4+mv8bOgIqinn7gZeZMG0EnVIhjkJYGHGANjMtbeatGa6tlc RMv2aw5HSQSXBye6XUY6wm92e546EcobJaaAlexuMCjiz0ExiLDTxK79k4F8LCc5Ab8v kLeGbJ1Q62dYjGTowA6cjzQieUwBLv3PB7nKr9I7iswzK7pe8RzjaRe/pFMPLEDXGea/ lnk12IU0+iffjdnxVaoUeKdxzjmCYUyHiMMgWDgTzPaBCp6+UUHt73rAy6Bras9TvJ07 IX1S0ZMH3ypJF8k7tvlrJxQEUVm4wcRPsGXfPhll2GOsrMLq7kVnPTtERkbGG0jvpXYs MfPQ== X-Gm-Message-State: APzg51Ck8SrH1VK1x3ho6cCYR+3QX5Sgvwlt/5bgpB3zsZBktuTaS389 LER3mtIUzIVBVsB4mJQ2xVw= X-Google-Smtp-Source: ANB0VdYNpPtb3R9tC0IbiOhQFNC6xXSV5UIMD9O9nboizYNCGvfblIULjF58+oGAFjLRUfxP/LnrGQ== X-Received: by 2002:aa7:d141:: with SMTP id r1-v6mr5509240edo.83.1537460360179; Thu, 20 Sep 2018 09:19:20 -0700 (PDT) Received: from piling.lan (80-71-134-83.u.parknet.dk. [80.71.134.83]) by smtp.gmail.com with ESMTPSA id h40-v6sm958144edh.88.2018.09.20.09.19.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Sep 2018 09:19:18 -0700 (PDT) From: Ricardo Ribalda Delgado To: Pavel Machek , Sakari Ailus , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Hans Verkuil , Laurent Pinchart Cc: Ricardo Ribalda Delgado , devicetree@vger.kernel.org Subject: [PATCH 3/4] [media] ad5820: DT new optional field enable-gpios Date: Thu, 20 Sep 2018 18:19:11 +0200 Message-Id: <20180920161912.17063-3-ricardo.ribalda@gmail.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180920161912.17063-1-ricardo.ribalda@gmail.com> References: <20180920161912.17063-1-ricardo.ribalda@gmail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Document new enable-gpio field. It can be used to disable the part without turning down its regulator. Cc: devicetree@vger.kernel.org Signed-off-by: Ricardo Ribalda Delgado --- Documentation/devicetree/bindings/media/i2c/ad5820.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/media/i2c/ad5820.txt b/Documentation/devicetree/bindings/media/i2c/ad5820.txt index 5940ca11c021..07d577bb37f7 100644 --- a/Documentation/devicetree/bindings/media/i2c/ad5820.txt +++ b/Documentation/devicetree/bindings/media/i2c/ad5820.txt @@ -8,6 +8,11 @@ Required Properties: - VANA-supply: supply of voltage for VANA pin +Optional properties: + + - enable-gpios : GPIO spec for the XSHUTDOWN pin. If specified, it will be + asserted when VANA-supply is enabled. + Example: ad5820: coil@c { @@ -15,5 +20,6 @@ Example: reg = <0x0c>; VANA-supply = <&vaux4>; + enable-gpios = <&msmgpio 26 GPIO_ACTIVE_HIGH>; }; From patchwork Thu Sep 20 16:19:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda Delgado X-Patchwork-Id: 10608039 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 74E4B14BD for ; Thu, 20 Sep 2018 16:19:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 63E3F2DFA9 for ; Thu, 20 Sep 2018 16:19:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 587282DFFE; Thu, 20 Sep 2018 16:19:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 10BA42DFA9 for ; Thu, 20 Sep 2018 16:19:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731757AbeITWDi (ORCPT ); Thu, 20 Sep 2018 18:03:38 -0400 Received: from mail-ed1-f65.google.com ([209.85.208.65]:39116 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730149AbeITWDh (ORCPT ); Thu, 20 Sep 2018 18:03:37 -0400 Received: by mail-ed1-f65.google.com with SMTP id h4-v6so8353487edi.6; Thu, 20 Sep 2018 09:19:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=XR0yI+aW4ISKO6OurX+u0MtdwuSJkccbzRW5ErEx2Yg=; b=AE3bBROsPqHaTGBTbVFuLfw7/bd19gM2mpGyaLn+fwre7y7Jtn+cluX/0oepmG/Qia BeXJp+JuDXLAEmYf0OLE/oxFAXu4/l9NsJtyTfqStYYQu7MJroE0U/y0i36V3ENaT05C 9h6pkHYEuKzBPuBLKn4Chd3Dd5yJaqugo2AmoHTW+YtPB86mKRjz4KgHaqwOR4CB2VnH nOC3RezkOCQdR0wurOPIpBTzaKqD8qycrOPK1fJ+QZva89ZQzbsnDQm5MGu4g8wI9RWv b5/nBMYwQ2s3aLpQF3GcIZVZ2ScrzG5T3RsO8BbL04NpiKJpdEPrZKzxHPMPMugz9avA s3Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=XR0yI+aW4ISKO6OurX+u0MtdwuSJkccbzRW5ErEx2Yg=; b=olD1BroVupvegdWJInNQIugaO6XAoGFy/V0PI7wCRJn+iIL58oyMIRC51x5RXIvg88 HJCYMH7xWXZclXWW6V9dTEVdS7HFktv33RWd/Bw03DUEPnNjfM9Z4mXklFdltx0R3m0m Mr2Nkl0nypAW9bpJCqIEJR28mGKR4Klsv/rXEGg/ohDjlySQyYkJnxLcwQcpAcEZje4E RNpV6xlgs4j1o5SLhMoqNpuVCvW2Kf94Icp3+1z2Iz2L2WpjmoeCOsdzA+7pSg4QDj5F iy5tRLVfL3ql/aCFHfyIh4TTHPGggVYjdB+YdvmkNamU7aJ6tHCfDoG6poZQmJ2YSjEe aI7A== X-Gm-Message-State: APzg51DKqQwkNk0BdpGH8Q4VzXwKOVTEz/54BMpbJQUar8bokeoAPERf N3/kXcvwbMVAuZ+5ss2D+9A= X-Google-Smtp-Source: ANB0VdYNZx5EUa2YY5PNF3Viy40/EnCVOo6lWgL96g9nsW631z8KddbtCRfuIl72CjxgRkFV4saDrA== X-Received: by 2002:a50:c40e:: with SMTP id v14-v6mr641350edf.232.1537460361732; Thu, 20 Sep 2018 09:19:21 -0700 (PDT) Received: from piling.lan (80-71-134-83.u.parknet.dk. [80.71.134.83]) by smtp.gmail.com with ESMTPSA id h40-v6sm958144edh.88.2018.09.20.09.19.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Sep 2018 09:19:20 -0700 (PDT) From: Ricardo Ribalda Delgado To: Pavel Machek , Sakari Ailus , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Hans Verkuil , Laurent Pinchart Cc: Ricardo Ribalda Delgado Subject: [PATCH 4/4] [media] ad5820: Add support for of-autoload Date: Thu, 20 Sep 2018 18:19:12 +0200 Message-Id: <20180920161912.17063-4-ricardo.ribalda@gmail.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180920161912.17063-1-ricardo.ribalda@gmail.com> References: <20180920161912.17063-1-ricardo.ribalda@gmail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since kernel 4.16, i2c devices with DT compatible tag are modprobed using their DT modalias. Without this patch, if this driver is build as module it would never be autoprobed. Signed-off-by: Ricardo Ribalda Delgado --- drivers/media/i2c/ad5820.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/media/i2c/ad5820.c b/drivers/media/i2c/ad5820.c index 20931217e3b1..d352bc6b6adf 100644 --- a/drivers/media/i2c/ad5820.c +++ b/drivers/media/i2c/ad5820.c @@ -375,12 +375,19 @@ static const struct i2c_device_id ad5820_id_table[] = { }; MODULE_DEVICE_TABLE(i2c, ad5820_id_table); +static const struct of_device_id ad5820_of_table[] = { + { .compatible = "adi"AD5820_NAME }, + { } +}; +MODULE_DEVICE_TABLE(of, ad5820_of_table); + static SIMPLE_DEV_PM_OPS(ad5820_pm, ad5820_suspend, ad5820_resume); static struct i2c_driver ad5820_i2c_driver = { .driver = { .name = AD5820_NAME, .pm = &ad5820_pm, + .of_match_table = ad5820_of_table, }, .probe = ad5820_probe, .remove = ad5820_remove,