From patchwork Tue Jul 18 19:04:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 9849309 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 535D860393 for ; Tue, 18 Jul 2017 19:04:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3A7A1284B5 for ; Tue, 18 Jul 2017 19:04:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2F5EE28571; Tue, 18 Jul 2017 19:04:13 +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,RCVD_IN_DNSWL_HI 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 D5D5428593 for ; Tue, 18 Jul 2017 19:04:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752025AbdGRTEL (ORCPT ); Tue, 18 Jul 2017 15:04:11 -0400 Received: from nblzone-211-213.nblnetworks.fi ([83.145.211.213]:60040 "EHLO hillosipuli.retiisi.org.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752022AbdGRTEJ (ORCPT ); Tue, 18 Jul 2017 15:04:09 -0400 Received: from lanttu.localdomain (lanttu-e.localdomain [192.168.1.64]) by hillosipuli.retiisi.org.uk (Postfix) with ESMTP id 3E974600D4; Tue, 18 Jul 2017 22:04:03 +0300 (EEST) From: Sakari Ailus To: linux-media@vger.kernel.org Cc: linux-leds@vger.kernel.org, laurent.pinchart@ideasonboard.com, niklas.soderlund@ragnatech.se, hverkuil@xs4all.nl Subject: [RFC 19/19] smiapp: Add support for flash and lens devices Date: Tue, 18 Jul 2017 22:04:01 +0300 Message-Id: <20170718190401.14797-20-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170718190401.14797-1-sakari.ailus@linux.intel.com> References: <20170718190401.14797-1-sakari.ailus@linux.intel.com> 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 Parse async sub-devices by using v4l2_subdev_fwnode_reference_parse_sensor_common(). These types devices aren't directly related to the sensor, but are nevertheless handled by the smiapp driver due to the relationship of these component to the main part of the camera module --- the sensor. This does not yet address providing the user space with information on how to associate the sensor or lens devices but the kernel now has the necessary information to do that. Signed-off-by: Sakari Ailus --- drivers/media/i2c/smiapp/smiapp-core.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c index e0b0c032c4ac..ae93d81d179c 100644 --- a/drivers/media/i2c/smiapp/smiapp-core.c +++ b/drivers/media/i2c/smiapp/smiapp-core.c @@ -2879,6 +2879,11 @@ static int smiapp_probe(struct i2c_client *client, v4l2_i2c_subdev_init(&sensor->src->sd, client, &smiapp_ops); sensor->src->sd.internal_ops = &smiapp_internal_src_ops; + rval = v4l2_subdev_fwnode_reference_parse_sensor_common( + &sensor->src->sd); + if (rval < 0 && rval != -ENOENT) + return rval; + sensor->vana = devm_regulator_get(&client->dev, "vana"); if (IS_ERR(sensor->vana)) { dev_err(&client->dev, "could not get regulator for vana\n");