From patchwork Tue Oct 25 23:55:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 9395741 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BFA2A60233 for ; Tue, 25 Oct 2016 23:59:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7715E296A2 for ; Tue, 25 Oct 2016 23:59:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6AFFB29698; Tue, 25 Oct 2016 23:59:17 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 04F1529698 for ; Tue, 25 Oct 2016 23:59:17 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bzBb3-0002hR-Dj; Tue, 25 Oct 2016 23:57:33 +0000 Received: from mail-pf0-x234.google.com ([2607:f8b0:400e:c00::234]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bzBZX-0001k8-NK for linux-arm-kernel@lists.infradead.org; Tue, 25 Oct 2016 23:56:03 +0000 Received: by mail-pf0-x234.google.com with SMTP id e6so127444239pfk.3 for ; Tue, 25 Oct 2016 16:55:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sUwilCc33afBUyfQPyd0lrfNxS/vXZ5OjMXgCMWoEnM=; b=g4LnSFSPWfrT3leeverluS7+kKWwCVxC8PttZAEBwrUzKy1LCX360xozjwiuYAUYjR QMArCGSFBn9cK/xJQHGAJkKZxJWvwLgbFZgslRtiixH7JdzDlnM9WZSy+hfQVAluXxF8 SohLy62CORnyBjqtjrGVuVAmLuFjv96z/L9eLeLBgSc8ePYsO+r4GsErPPa9uJ1Ll4k4 Tt5kvV+WfT34X8jLjCFuLVaOsOEBoaDCxeu3BwOt45g9rl3DJNxfNszj3MJbKEk07+Dr mT0wCbt5pnA7DIqDg0lOy+QYOAsZIJwy2wUwfJcNhHzFO1Em1x8MIPCdUMy3qey/b24j hr0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=sUwilCc33afBUyfQPyd0lrfNxS/vXZ5OjMXgCMWoEnM=; b=CEW5O7UoyZDUhwrf87+Rt5JWaXV0fScDNOAbs/BFbsga6h+WwnD8h+5pyr9M/dO8be 2ymvMGmRd05BUuDRb+PfGT9KA/xeWtecUQzrnF977fm3dYEQzR9JKzYa2NWPtQz1k2dG HMTt7mc6syqjcOqdCeGeOl4kVZIF0OX7rFcSAOz3M/Xx6g7S1QDPaT77nSrjKx1G1m4H uYUxEMRZk0R7WcZ7wtvl3qJL9GqP46xTJF0u835HV4gQ3yGcd6EX87dQjgDqigkh6zPD S19Gk8smjzpQ1H0/Z3FeaM1CQX5H1xuxixbYYKDvlQYuONvfAuJmClluq9JMGuvdkjlr wrIg== X-Gm-Message-State: ABUngvdRSxPuV0dyIglfuwZyaOoMQqj7wzKWWfYuMrnNqX/WT/LIgl4IGVgNZrJfbskTQm0Q X-Received: by 10.98.75.152 with SMTP id d24mr43834088pfj.97.1477439738591; Tue, 25 Oct 2016 16:55:38 -0700 (PDT) Received: from localhost (c-98-203-232-209.hsd1.wa.comcast.net. [98.203.232.209]) by smtp.gmail.com with ESMTPSA id c62sm35898012pfe.42.2016.10.25.16.55.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Oct 2016 16:55:38 -0700 (PDT) From: Kevin Hilman To: Hans Verkuil , Laurent Pinchart , linux-media@vger.kernel.org Subject: [RFC PATCH 1/6] [media] davinci: add support for DT init Date: Tue, 25 Oct 2016 16:55:31 -0700 Message-Id: <20161025235536.7342-2-khilman@baylibre.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20161025235536.7342-1-khilman@baylibre.com> References: <20161025235536.7342-1-khilman@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161025_165559_927454_B0E15086 X-CRM114-Status: GOOD ( 13.16 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Lechner , Axel Haslam , Sekhar Nori , =?UTF-8?q?Bartosz=20Go=C5=82aszewski?= , Alexandre Bailon , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add basic support for initialization via DT. Signed-off-by: Kevin Hilman --- drivers/media/platform/davinci/vpif.c | 9 +++++++++ drivers/media/platform/davinci/vpif_capture.c | 14 ++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/drivers/media/platform/davinci/vpif.c b/drivers/media/platform/davinci/vpif.c index 0380cf2e5775..077e328e0281 100644 --- a/drivers/media/platform/davinci/vpif.c +++ b/drivers/media/platform/davinci/vpif.c @@ -464,8 +464,17 @@ static const struct dev_pm_ops vpif_pm = { #define vpif_pm_ops NULL #endif +#if IS_ENABLED(CONFIG_OF) +static const struct of_device_id vpif_of_match[] = { + { .compatible = "ti,vpif", }, + { /* sentinel */ }, +}; +MODULE_DEVICE_TABLE(of, vpif_of_match); +#endif + static struct platform_driver vpif_driver = { .driver = { + .of_match_table = of_match_ptr(vpif_of_match), .name = "vpif", .pm = vpif_pm_ops, }, diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c index 5104cc0ee40e..79cef74e164f 100644 --- a/drivers/media/platform/davinci/vpif_capture.c +++ b/drivers/media/platform/davinci/vpif_capture.c @@ -1435,6 +1435,11 @@ static __init int vpif_probe(struct platform_device *pdev) int res_idx = 0; int i, err; + if (!pdev->dev.platform_data) { + dev_warn(&pdev->dev, "Missing platform data. Giving up.\n"); + return -EINVAL; + } + vpif_dev = &pdev->dev; err = initialize_vpif(); @@ -1618,8 +1623,17 @@ static int vpif_resume(struct device *dev) static SIMPLE_DEV_PM_OPS(vpif_pm_ops, vpif_suspend, vpif_resume); +#if IS_ENABLED(CONFIG_OF) +static const struct of_device_id vpif_capture_of_match[] = { + { .compatible = "ti,vpif-capture", }, + { /* sentinel */ }, +}; +MODULE_DEVICE_TABLE(of, vpif_capture_of_match); +#endif + static __refdata struct platform_driver vpif_driver = { .driver = { + .of_match_table = of_match_ptr(vpif_capture_of_match), .name = VPIF_DRIVER_NAME, .pm = &vpif_pm_ops, },