From patchwork Tue Feb 7 16:41:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 9560599 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 888F960434 for ; Tue, 7 Feb 2017 16:42:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7AB2628404 for ; Tue, 7 Feb 2017 16:42:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6F5692841D; Tue, 7 Feb 2017 16:42:57 +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=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=unavailable 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 4683C28404 for ; Tue, 7 Feb 2017 16:42:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755389AbdBGQmB (ORCPT ); Tue, 7 Feb 2017 11:42:01 -0500 Received: from mail-wr0-f180.google.com ([209.85.128.180]:36437 "EHLO mail-wr0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755315AbdBGQl5 (ORCPT ); Tue, 7 Feb 2017 11:41:57 -0500 Received: by mail-wr0-f180.google.com with SMTP id k90so41813493wrc.3 for ; Tue, 07 Feb 2017 08:41:57 -0800 (PST) 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; bh=LIx90PyH3Aicn6N/yKZFmjyMZ+zS+KpS+lAZAeMPl+w=; b=1Pkm/FWJrMhkwe8P35pb+amophYrKBb5hd1eZ7Vv+Y+m2r+bsh+LmHTjQytEMkOMdu 5Y0nuWnXoLPIjqr1B/7kedFz9xERCoxBMndH0ISGJMEK1DB5o2Mg89D6n/EjHej3mn4U F6CiGBSw9R31QIz1ErZ1GOIIwR0ImzdNbBovSRoWENLWGfEGFIWGeruhwQjVnyUNbIKE /EiL0R5tn49IkjQCDpjxntghvoOvs57fDNIiHvZhcZko3MlkmDxE57JMUygyT0lROPsu fdug3EXw6kA5gVO3JbgCUTqnhY26hECE3zoZC2KqjIdTPwiOjFl+AdG79OZRaI1tvpjJ OtFw== 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=LIx90PyH3Aicn6N/yKZFmjyMZ+zS+KpS+lAZAeMPl+w=; b=nhxWQho11TOQwlKgPaqlvVSxdhsEZRSe1gP4O8+lql88NVnv9Y7kJbqnmdprhzJSe/ l28RAlmCXq8+Lr7k7fYRPi4BztvwL+WRMwMA76+Mpi6PRYipbWPWEqtFtunDFZFi1EwC kEs/EWQmW2bO0Qc3KuPEF+cA/MZW7xLZEUnmbXvBK1oVlUZI9NmGRXVQhMvWtNwzG5Nr zaIqmIKAhkFet4h60XduaZBD4520/xi2hrrffUqnYJ4uvRDG21QB/EasrHxZmy2XTrFu X+n5xkXvr3hXKJeV7mFFRCc8YFfjtn1JfOMWTaQYpnyEwf6fcKqwIqq+wUREkdMfNqXx G/6A== X-Gm-Message-State: AIkVDXLBMJGvkYbGXRDNT9l2Zdi5J6EmSKnQ58ru5IjaBwaTmxDMmPARjwvFbBodVSH+fUdS X-Received: by 10.223.162.205 with SMTP id t13mr6875294wra.155.1486485716464; Tue, 07 Feb 2017 08:41:56 -0800 (PST) Received: from localhost.localdomain ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id 8sm3958185wmg.1.2017.02.07.08.41.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 07 Feb 2017 08:41:55 -0800 (PST) From: Bartosz Golaszewski To: Kevin Hilman , Sekhar Nori , Patrick Titiano , Michael Turquette , Rob Herring , Mark Rutland , Russell King , Alexandre Bailon , David Lechner , Laurent Pinchart , Mauro Carvalho Chehab , Lad Prabhakar Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 09/10] media: vpif: use a configurable i2c_adapter_id for vpif display Date: Tue, 7 Feb 2017 17:41:22 +0100 Message-Id: <1486485683-11427-10-git-send-email-bgolaszewski@baylibre.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1486485683-11427-1-git-send-email-bgolaszewski@baylibre.com> References: <1486485683-11427-1-git-send-email-bgolaszewski@baylibre.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 The vpif display driver uses a static i2c adapter ID of 1 but on the da850-evm board in DT boot mode the i2c adapter ID is actually 0. Make the adapter ID configurable like it already is for vpif capture. Signed-off-by: Bartosz Golaszewski Acked-by: Kevin Hilman --- arch/arm/mach-davinci/board-da850-evm.c | 1 + drivers/media/platform/davinci/vpif_display.c | 2 +- include/media/davinci/vpif_types.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index e5d4ded..fe0bfa7 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c @@ -1290,6 +1290,7 @@ static struct vpif_display_config da850_vpif_display_config = { .output_count = ARRAY_SIZE(da850_ch0_outputs), }, .card_name = "DA850/OMAP-L138 Video Display", + .i2c_adapter_id = 1, }; static __init void da850_vpif_init(void) diff --git a/drivers/media/platform/davinci/vpif_display.c b/drivers/media/platform/davinci/vpif_display.c index 50c3073..7e5cf99 100644 --- a/drivers/media/platform/davinci/vpif_display.c +++ b/drivers/media/platform/davinci/vpif_display.c @@ -1287,7 +1287,7 @@ static __init int vpif_probe(struct platform_device *pdev) } if (!vpif_obj.config->asd_sizes) { - i2c_adap = i2c_get_adapter(1); + i2c_adap = i2c_get_adapter(vpif_obj.config->i2c_adapter_id); for (i = 0; i < subdev_count; i++) { vpif_obj.sd[i] = v4l2_i2c_new_subdev_board(&vpif_obj.v4l2_dev, diff --git a/include/media/davinci/vpif_types.h b/include/media/davinci/vpif_types.h index 4282a7d..0c72b46 100644 --- a/include/media/davinci/vpif_types.h +++ b/include/media/davinci/vpif_types.h @@ -57,6 +57,7 @@ struct vpif_display_config { int (*set_clock)(int, int); struct vpif_subdev_info *subdevinfo; int subdev_count; + int i2c_adapter_id; struct vpif_display_chan_config chan_config[VPIF_DISPLAY_MAX_CHANNELS]; const char *card_name; struct v4l2_async_subdev **asd; /* Flat array, arranged in groups */