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: 9463939 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 991A66022E for ; Wed, 7 Dec 2016 05:12:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8DB9E2849D for ; Wed, 7 Dec 2016 05:12:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 82847284AE; Wed, 7 Dec 2016 05:12:32 +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=ham 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 3B3012849D for ; Wed, 7 Dec 2016 05:12:32 +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 1cEUU6-00012O-8l; Wed, 07 Dec 2016 05:09:38 +0000 Received: from mail-pg0-x22e.google.com ([2607:f8b0:400e:c05::22e]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cEUTX-0000e6-Kw for linux-arm-kernel@lists.infradead.org; Wed, 07 Dec 2016 05:09:06 +0000 Received: by mail-pg0-x22e.google.com with SMTP id x23so157571023pgx.1 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=F2b9iSk/YzTTPhhXbWWKmCVRr1NDP9mPheEdrFnkVwepJnFfgpyNiiQPUZxFaz95u2 8IiC8HIfUTNjCwmcg94PZBUjxPCLhIe2Ki58esgQkyav3PYKLPdjsuLgvFCbuCbqmmtj tXvBJz0bCx4xuzJY+Uw23AY5noDA+oV26cn7nxtdQHuRStEeUKFKmdTq1s38wDCvaz4j WU1mADtoiUTVS35A69hoUSOzdf4R85tjgauiKpnxeeBtI5BMNT5KUMdDtTe835EXANF6 yhg3hVLRcfu3hX7THdQan2c4ndWVLKpy6dh+GlUxDrJMkWs9klDfACquvqN9sMMv6mDH Lkcw== X-Gm-Message-State: AKaTC03Fx731yhbgjhC1nSeJvAFspKpo/L1QpR8llXGeAv0yAiW0NbVXjFZreSwAGl0QC085 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161206_210903_960765_066561E4 X-CRM114-Status: GOOD ( 12.90 ) 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 , Patrick Titiano , 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 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 */