From patchwork Wed Dec 7 18:30:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 9465033 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 3486460459 for ; Wed, 7 Dec 2016 18:30:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2D6CE28558 for ; Wed, 7 Dec 2016 18:30:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 225432855C; Wed, 7 Dec 2016 18:30:36 +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 16BB82855A for ; Wed, 7 Dec 2016 18:30:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932547AbcLGSac (ORCPT ); Wed, 7 Dec 2016 13:30:32 -0500 Received: from mail-pg0-f44.google.com ([74.125.83.44]:35685 "EHLO mail-pg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932192AbcLGSaa (ORCPT ); Wed, 7 Dec 2016 13:30:30 -0500 Received: by mail-pg0-f44.google.com with SMTP id p66so164614557pga.2 for ; Wed, 07 Dec 2016 10:30:30 -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=tPVlWyMMmAwASS+yCk1HJVc+r/+/2DrR/LN381LwNwNOB+GsPTuasif6V5xY4nBpGc xlEehCk1aK5ONn0mbsR1oaAuQ+hyya4u3rDRNWYOanHk5sF/3qT/vT+KU+nfQwQa8OKC BmRfRIJwmtlb1NtO9wemx/1mGtmAabcl98Gq+UaJ0Am6X31b3SOSa2apajUBb1RJ0ldh umUs6kmPSToXpqst9xJQ5UAZR7kWqBFbGe5O65PWTVdei+Tcf0jp5WDin2k8HtuXt+hQ jbQAHlHkaS8PZ5n/BQYrLsqCOnF92loH8QwzC96JMxymJKk6kWOmpw28uprucRTZEmQC uv9A== 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=QVXQePdirGJzub2PjsQwG094vl8//pOwx3UmLSRtXoX5bUBSJeAp5P6gIB/IwQCTXH UOBWUigVbjWjYfLMYJ5HH/Zc2GiH9/kHk2bhrhysDAt9BpfIYzAVTMgYnIQm9H7ehRhM l0hTMtR5wgPBIUKgIbYScjiPmlBeE6f2ydGfy4V3vIpM8vZDlqaiflSQtxxl8P/96aDf F5AYJ634nmjxb4nQ/UBFp6W3mrqkasbAb8HoCwVA7upAmo17DiIXUPNJ6nsFVIeiHA8H lMGIpx/zVGKT4CG/UD5fXkHPTp7sAI+hY/s/RUK2pbdYKigOClRSlDtUA5zfisLSfILd c0Kw== X-Gm-Message-State: AKaTC01aUDeIhfkDjqxjSSAFH82PsTIRfNXtomOUFwmJjk0/SgwW/98gzCFrulw8062Kx2S2 X-Received: by 10.99.135.200 with SMTP id i191mr122933855pge.18.1481135429876; Wed, 07 Dec 2016 10:30:29 -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 186sm44248923pfv.61.2016.12.07.10.30.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Dec 2016 10:30:29 -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 v6 2/5] [media] davinci: vpif_capture: remove hard-coded I2C adapter id Date: Wed, 7 Dec 2016 10:30:22 -0800 Message-Id: <20161207183025.20684-3-khilman@baylibre.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20161207183025.20684-1-khilman@baylibre.com> References: <20161207183025.20684-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 Acked-by: Sakari Ailus --- 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 */