From patchwork Thu Sep 20 18:31:51 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: 10608439 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 71D80112B for ; Thu, 20 Sep 2018 18:32:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6A4182E660 for ; Thu, 20 Sep 2018 18:32:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5D6032E69A; Thu, 20 Sep 2018 18:32:00 +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 0CE4F2E660 for ; Thu, 20 Sep 2018 18:31:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731592AbeIUAQq (ORCPT ); Thu, 20 Sep 2018 20:16:46 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:41446 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727252AbeIUAQq (ORCPT ); Thu, 20 Sep 2018 20:16:46 -0400 Received: by mail-lj1-f194.google.com with SMTP id y17-v6so9306346ljy.8; Thu, 20 Sep 2018 11:31:57 -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=M1KM9ge37DjiekXeHM0ecmdPDTzHX6M2Us9BCK0LUEE=; b=EeQgnzmkVG2Y3ZFQkfZ464yzlipGJjiLsKGfN+HM0uqkepXknnSf/rtIogS3VRSOT3 IXHBUcvwvPs5XotYJmog3e8s0sKugG2MXtIjuWb9RWpLnsYMkdfkDYYdgzWJNS+QdEu2 RVR8QC7RB7a4yAoK9RWuwCdzTsRIwxg8AL74a0LrGOlpGGDE7PlQ7U9mb8Ga2CHAVi4d 1PWghPK4yhT3UkiJ26bdtYiYllQJTMt5lGLF6sTb9PIwRYj2cZungsNNB1kHMw/N7lQE znwlV9T8YHhOe8InP0VUijJVedRRi8jBlwlD0r0chK+qJCAmZ3H+RtUt+pwWxBM8HJ19 kIOQ== 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=M1KM9ge37DjiekXeHM0ecmdPDTzHX6M2Us9BCK0LUEE=; b=iV1h4qFconeCSlcn7xTQs48IlUmRaHU76UFbAN+LRxA5p8+JgZXECkq6Z/VbVGhI3h vFei2QdfvnIXApgNa7Fj/djlzmdFf74S07KdQjaYAXYHmoIgJezs2v5pGEB0ErLW7M/5 evm4+jasGGYV6oEkULk8C2SKWK1SJkphKtoi9ph/7ZzieS/K1rgnAgPQQ4yb2wtofLb/ HOGlJHvT3UAdAtUZqhxg9Ce9LtnBVn9hSltgGzMG7Jh0NoJWQaNJW0OxOnaRj5hSisUz Q4muH0ZgPT74WXPvgKHYu8fb9ojImaESJcuJFJnKUtuljgBs+Ur+sOx6kUh05t9KSJ85 N6lA== X-Gm-Message-State: APzg51Dnp7WnOBjul0XFYu9JpZjarSPNO4bXrfRI8/SeH48DV4VKp4WS DA7tyyI5hoOpAq4yr0uSx9I= X-Google-Smtp-Source: ANB0VdZEiTBXW8Kb1epw3i3g42B5tjlHzZOcfqEkvfSCVK2xBAjecF247j+XpHaDZW4kkqwGDA1dCQ== X-Received: by 2002:a2e:1b4a:: with SMTP id b71-v6mr26592937ljb.104.1537468316513; Thu, 20 Sep 2018 11:31:56 -0700 (PDT) Received: from piling.lan (80-71-134-83.u.parknet.dk. [80.71.134.83]) by smtp.gmail.com with ESMTPSA id q21-v6sm1030434lfj.80.2018.09.20.11.31.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Sep 2018 11:31:54 -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 v2 4/4] [media] ad5820: Add support for of-autoload Date: Thu, 20 Sep 2018 20:31:51 +0200 Message-Id: <20180920183151.2933-1-ricardo.ribalda@gmail.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180920161912.17063-4-ricardo.ribalda@gmail.com> References: <20180920161912.17063-4-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..75b9b8aa5533 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,