From patchwork Thu Feb 16 18:08:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 9577967 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 1FF8260244 for ; Thu, 16 Feb 2017 18:08:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 150AD28653 for ; Thu, 16 Feb 2017 18:08:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 09AFD28659; Thu, 16 Feb 2017 18:08:29 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI 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 9693C28653 for ; Thu, 16 Feb 2017 18:08:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933301AbdBPSIS (ORCPT ); Thu, 16 Feb 2017 13:08:18 -0500 Received: from mail-wm0-f54.google.com ([74.125.82.54]:37021 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933050AbdBPSIP (ORCPT ); Thu, 16 Feb 2017 13:08:15 -0500 Received: by mail-wm0-f54.google.com with SMTP id v77so21629357wmv.0 for ; Thu, 16 Feb 2017 10:08:15 -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; bh=t+wDXpgeSmdkMJo1VGmQP8LR5NLuHggXnSLaGLqphag=; b=X1YPvr2NBtf8AWkDbZ0Bh3x7R21y7bSsWbUJLa0KkEnQCt1F7vRC+/JPSSGvUvOLsl YJHdO5lOUWEZT1y+1TPcmeV38e6OpcaJNIeZlQYMMz0j5Ol1q6pzfnbL+kfEPZ0R1rtk E8IEQK/E0dz1VdLXyd7kHW8j//amvfrDerjlJldsmg4Rt+Lt5GRPH2nzu2fbVbjqJSTh MkUrwmiPTgWFX3SFu6iTXvfq7LsXnbu7ErtGrhJatHECTvmEQ25zvuwRtVtd4EyI1kRh wjdjpK6hu89PiaSoyvTh/KeZ4TIi3G/VC7w2jMfLSdtwekUtn5OTxiKlWnJRACvD9bPs FuMQ== 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=t+wDXpgeSmdkMJo1VGmQP8LR5NLuHggXnSLaGLqphag=; b=Z3ez1cewt1RAjU9cUBcPbW2n1/fANa2fkuQWmZDcmR1dIBLojmPPV16Qi5m0AB733U x/zTW5xWJp81vaThQLJRmZKjYtJmukVbI1pQfX2t0jQO5n7Zwlyn23dgl85Hx0pVi8Uy kXnp2gcvd06EkglirFcsuRSeYYDV5p5g0HTkLq2hx0bp0Z67lgpZn4iq/Yf/tCGAVoOl xrj01KtprOGwsxRizbtJZG2ZejC9z49pq81gdwu3bYfRcNbqlUTijjjfsNAhGRb1YLNe rewbzpSs3zqOXNS2mnj2+drsoFCnwdwACgc8kXMaDAQj01vpAOAOCN/k7NHhYFjK6uZH 5vsQ== X-Gm-Message-State: AMke39nB/f79XQDOR6yJ25sQ+3Q3s14DOc6sbvZULJmAXsAlX1fP4R8MeRz3itMePrntMSU2 X-Received: by 10.28.214.137 with SMTP id n131mr3353518wmg.120.1487268494432; Thu, 16 Feb 2017 10:08:14 -0800 (PST) Received: from localhost.localdomain ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id k195sm1132459wmd.7.2017.02.16.10.08.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 16 Feb 2017 10:08:13 -0800 (PST) From: Bartosz Golaszewski To: Sekhar Nori , Kevin Hilman , Michael Turquette , Patrick Titiano , Laurent Pinchart , Russell King , Prabhakar Lad , Mauro Carvalho Chehab Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH] media: vpif: use a configurable i2c_adapter_id for vpif display Date: Thu, 16 Feb 2017 19:08:01 +0100 Message-Id: <1487268481-6127-1-git-send-email-bgolaszewski@baylibre.com> X-Mailer: git-send-email 2.1.4 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 Acked-by: Lad, Prabhakar --- 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 df3ca38..6f1e129 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 */