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: 9465047 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 DB44260459 for ; Wed, 7 Dec 2016 18:32:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D205127F99 for ; Wed, 7 Dec 2016 18:32:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C6770284FD; Wed, 7 Dec 2016 18:32:46 +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 1BFEE27F99 for ; Wed, 7 Dec 2016 18:32:46 +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 1cEgzv-0006RY-JN; Wed, 07 Dec 2016 18:31:19 +0000 Received: from mail-pg0-x236.google.com ([2607:f8b0:400e:c05::236]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cEgzS-00067O-Pv for linux-arm-kernel@lists.infradead.org; Wed, 07 Dec 2016 18:30:51 +0000 Received: by mail-pg0-x236.google.com with SMTP id f188so164076185pgc.3 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=IE7fMWfhTL1L9595wxgPo0vA+p79idSVlviwBfpXlpEFwfxPFCFspkZxT4r70usLqk 7AimDJwgb4Vo58/3xCxeJGH01w9oVWXl4+YcaKxw2CCmNDQ5uaMzXNJ/v4i8R2GuVJwC n47kZNdVyjZ1nSNNfz/SQUcy5djxhmjI3R0CZQKgcgG/rYw1ut25MOB2r3+69A2ziUE4 TVbuU+ij75O7VxcPIFRrZlGkpS7CCPDzd6OVXhC7xBstZF0lMeuJ00NVWNUDnQ7qnDon iQDZP4QBE4tf4xPOI4mT7cFAbfDqrIMWWj8mgZLbZS2Mh4vN8eITRHms2IPzJGRGeQnh yg6Q== X-Gm-Message-State: AKaTC032WcufW9RvGKCPt77ubmZ2lwgfzW/aqtV5kDm5wnK9ZluvOLOGe/QwfmqPSuDlp9qm 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161207_103050_961619_096E8701 X-CRM114-Status: GOOD ( 12.66 ) 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 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 */