From patchwork Wed Dec 7 05:08:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 9463929 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 4D62B6022E for ; Wed, 7 Dec 2016 05:08:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 42EB52847E for ; Wed, 7 Dec 2016 05:08:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 373FF2849D; Wed, 7 Dec 2016 05:08:48 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 D47C52847E for ; Wed, 7 Dec 2016 05:08:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752700AbcLGFIo (ORCPT ); Wed, 7 Dec 2016 00:08:44 -0500 Received: from mail-pg0-f51.google.com ([74.125.83.51]:33411 "EHLO mail-pg0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752724AbcLGFIn (ORCPT ); Wed, 7 Dec 2016 00:08:43 -0500 Received: by mail-pg0-f51.google.com with SMTP id 3so157602999pgd.0 for ; Tue, 06 Dec 2016 21:08:43 -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 :mime-version:content-transfer-encoding; bh=N4ekrdyVgDvn4SEiZBNsQZXXFOy8M5InZb/wYtD8/wo=; b=rdkRxXs9C+Xw73EuYn/9yUw8sTot9ivuYu0dIxfOB9S/W9617SlPtG3j/9VA3AAmtH AvFIBcZGfu6nlzzVPtKWvy8TEY87EzNsKbIGew5Pz+7m+cuFPwi6uGyUZe/tHZ56QF15 qMJrxxbtMtXxPLxJvuO3aQ5d9yBvR7aPiuciDYogDTDE2IvaMLnYVnxtjlZcS+1Eq99e BKvk+PtP68UWL8AucPSYR31hwgQvQFx/9443KGQ4Lx3q1sV1RpLciU/na73Pi7wYD6cy h6jA50DTa4qPTsq/OLYo+kc2ghbjb+LcQYjNnStAOWaT9fyR802d5VpIELbGomG/yaXE M2yQ== 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=N4ekrdyVgDvn4SEiZBNsQZXXFOy8M5InZb/wYtD8/wo=; b=DQrG0/1SvrlDGumpDTnVeJJPECtPp1N0XNZcCFmJqsrMQtqv2p7PHv3WTcSGX4gDYP EdbTlkhNe0LIGgY4L1l5ZQGXX3CmfKEjyeZ5Zl69jYmjAV1hok4f4u2ReFvMR+vgBd3a RY0sClDw17h3ZKmWSu4H/QwQT9wDTUATDo7EziFQLBM6+3rH/c97xCjVZ5YVP8IEj+E0 4o57q8DQ+O4+EZoZ2KnAbYb+favQAetVWmD3544xZHpdGPAKq+j8IfPy1yFKXFALgjQ2 dJdrvQ3l6P8nb6OpaygFG+HuTQYXGJ61CqSE/2TlvWVV8rVrljHRvGOQiQzJ0vaTr7ns Miqg== X-Gm-Message-State: AKaTC00gEmoss98SHOBBfBvre1mbgsKTQgDUetxIvzwgk/mF2fLElwqNBr5Wopj+W1eDW1XW X-Received: by 10.84.157.74 with SMTP id u10mr144014229plu.153.1481087322770; Tue, 06 Dec 2016 21:08:42 -0800 (PST) Received: from localhost (c-98-203-232-209.hsd1.wa.comcast.net. [98.203.232.209]) by smtp.gmail.com with ESMTPSA id s5sm38706167pgj.19.2016.12.06.21.08.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Dec 2016 21:08:42 -0800 (PST) From: Kevin Hilman To: Hans Verkuil , Laurent Pinchart , Sakari Ailus , linux-media@vger.kernel.org Cc: Sekhar Nori , Axel Haslam , =?UTF-8?q?Bartosz=20Go=C5=82aszewski?= , Alexandre Bailon , David Lechner , Patrick Titiano , linux-arm-kernel@lists.infradead.org Subject: [PATCH v5 2/5] [media] davinci: vpif_capture: remove hard-coded I2C adapter id Date: Tue, 6 Dec 2016 21:08:23 -0800 Message-Id: <20161207050826.23174-3-khilman@baylibre.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20161207050826.23174-1-khilman@baylibre.com> References: <20161207050826.23174-1-khilman@baylibre.com> MIME-Version: 1.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 Remove hard-coded I2C adapter in favor of getting the ID from platform_data. Signed-off-by: Kevin Hilman --- drivers/media/platform/davinci/vpif_capture.c | 5 ++++- include/media/davinci/vpif_types.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c index 20c4344ed118..c24049acd40a 100644 --- a/drivers/media/platform/davinci/vpif_capture.c +++ b/drivers/media/platform/davinci/vpif_capture.c @@ -1486,7 +1486,10 @@ static __init int vpif_probe(struct platform_device *pdev) } if (!vpif_obj.config->asd_sizes) { - i2c_adap = i2c_get_adapter(1); + int i2c_id = vpif_obj.config->i2c_adapter_id; + + i2c_adap = i2c_get_adapter(i2c_id); + WARN_ON(!i2c_adap); for (i = 0; i < subdev_count; i++) { subdevdata = &vpif_obj.config->subdev_info[i]; vpif_obj.sd[i] = diff --git a/include/media/davinci/vpif_types.h b/include/media/davinci/vpif_types.h index 3cb1704a0650..4282a7db99d4 100644 --- a/include/media/davinci/vpif_types.h +++ b/include/media/davinci/vpif_types.h @@ -82,6 +82,7 @@ struct vpif_capture_config { struct vpif_capture_chan_config chan_config[VPIF_CAPTURE_MAX_CHANNELS]; struct vpif_subdev_info *subdev_info; int subdev_count; + int i2c_adapter_id; const char *card_name; struct v4l2_async_subdev **asd; /* Flat array, arranged in groups */ int *asd_sizes; /* 0-terminated array of asd group sizes */