Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2323860ybt; Tue, 16 Jun 2020 03:05:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCtiZFzJr6aysLGq3DfpzoMKtY3xmDV0X9BvdkpQiiGQebK88CQKNxY9nXGi9BwslRVKKf X-Received: by 2002:a50:ee8f:: with SMTP id f15mr1865060edr.168.1592301959243; Tue, 16 Jun 2020 03:05:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592301959; cv=none; d=google.com; s=arc-20160816; b=BsQabD7H8q2prDh+E1JauFMbFACRN2cK0CU5GOsW0HiOxoif3guLrwJfhrj7rGf0cy qFtLX6cbLgDzaSHfhHE3fn29GFz2xxuf3qeZ0DSTikMklJ5VxMpAflYdL7h+pYEdETmK sC/Aox+jbEzgpw8DJ6W7/jeqmRGKsNchg7Y2cWlu6CfF/yqdg17xyTDrmT/P/orBPSUO bxVWz0rq0n7dzKds7TYH741//+Qf/zF+dr9vtai6fydaHSRMIBRXaxcD1O7oL7NbddOK gYh8y2/xawV9RIVQuxMRkiAFEM5+gjVL2Wo4xoKraq159cMmjlkyL81bdLWTxQXyV65L CF3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=p2Os6yGapgbsB5WhQDyMtD1q01jMEvcljZEf4VmNKqg=; b=ld0pJgy/PwTlSgMdLS5Se4KtHOcFhbwS4PQ0cYichPykNWDPZlDFjPLZwRed8q7cWE hKjuh0A56QbkqdwQGIZzbJ52jMUR9HzhoAgVu6gM6SSGHp4q2QnY5q8lxYOZnoI7j/XR 6yjP/RyVwo0iBJSLqfHM6ckYkCmjqpMnZGxvhB0p3Ns/myU2b5UCkRBjLR9blE6224Ys 81jp9dRB/jzXzDNXcGGRwypObLdX2GAOsBrNShQWI2dB16hP1lQ18GBJpdgBD3/EeK8e sPPPLy43/pkK/0QUAFQ0Jk7lVtj3w1OirLr+P3PoM+76rrJnFD6qzCgkM6t//UB0NX4U 3Tbw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m3si10532665edv.247.2020.06.16.03.05.36; Tue, 16 Jun 2020 03:05:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728235AbgFPKAq (ORCPT + 99 others); Tue, 16 Jun 2020 06:00:46 -0400 Received: from smtp1.de.adit-jv.com ([93.241.18.167]:36135 "EHLO smtp1.de.adit-jv.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728170AbgFPKAn (ORCPT ); Tue, 16 Jun 2020 06:00:43 -0400 Received: from localhost (smtp1.de.adit-jv.com [127.0.0.1]) by smtp1.de.adit-jv.com (Postfix) with ESMTP id 0BB363C0588; Tue, 16 Jun 2020 12:00:42 +0200 (CEST) Received: from smtp1.de.adit-jv.com ([127.0.0.1]) by localhost (smtp1.de.adit-jv.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id S-vVknBfQk2h; Tue, 16 Jun 2020 12:00:36 +0200 (CEST) Received: from HI2EXCH01.adit-jv.com (hi2exch01.adit-jv.com [10.72.92.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by smtp1.de.adit-jv.com (Postfix) with ESMTPS id E147D3C00BA; Tue, 16 Jun 2020 12:00:36 +0200 (CEST) Received: from vmlxhi-110.adit-jv.com (10.72.93.196) by HI2EXCH01.adit-jv.com (10.72.92.24) with Microsoft SMTP Server (TLS) id 14.3.487.0; Tue, 16 Jun 2020 12:00:36 +0200 From: Ramzi BEN MEFTAH To: Kieran Bingham , Mauro Carvalho Chehab , Hans Verkuil , Sakari Ailus , Janusz Krzysztofik , Jacopo Mondi , Steve Longerbeam , Ezequiel Garcia , Arnd Bergmann , , CC: Michael Rodin , , , Ramzi BEN MEFTAH Subject: [PATCH 3/3] media: i2c: adv748x: add enuminput control to adv748x hdmi subdev Date: Tue, 16 Jun 2020 12:00:17 +0200 Message-ID: <1592301619-17631-3-git-send-email-rbmeftah@de.adit-jv.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1592301619-17631-1-git-send-email-rbmeftah@de.adit-jv.com> References: <1592301619-17631-1-git-send-email-rbmeftah@de.adit-jv.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.72.93.196] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch adds support for enuminput control to the adv748x hdmi subdev. This will allow userspace for example to query input hdmi signal status. Signed-off-by: Ramzi BEN MEFTAH --- drivers/media/i2c/adv748x/adv748x-hdmi.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/media/i2c/adv748x/adv748x-hdmi.c b/drivers/media/i2c/adv748x/adv748x-hdmi.c index c557f8f..2d748b2 100644 --- a/drivers/media/i2c/adv748x/adv748x-hdmi.c +++ b/drivers/media/i2c/adv748x/adv748x-hdmi.c @@ -350,6 +350,22 @@ static int adv748x_hdmi_g_input_status(struct v4l2_subdev *sd, u32 *status) return 0; } +static int adv748x_hdmi_enuminput(struct v4l2_subdev *sd, + struct v4l2_input *input) +{ + if (input->index != 0) + return -EINVAL; + + input->type = V4L2_INPUT_TYPE_CAMERA; + input->capabilities = V4L2_IN_CAP_DV_TIMINGS; + input->status = V4L2_IN_ST_NO_SIGNAL; + input->std = V4L2_STD_UNKNOWN; + + snprintf(input->name, sizeof(input->name), "%s", sd->name); + + return adv748x_hdmi_g_input_status(sd, &input->status); +} + static int adv748x_hdmi_s_stream(struct v4l2_subdev *sd, int enable) { struct adv748x_hdmi *hdmi = adv748x_sd_to_hdmi(sd); @@ -386,6 +402,7 @@ static const struct v4l2_subdev_video_ops adv748x_video_ops_hdmi = { .g_dv_timings = adv748x_hdmi_g_dv_timings, .query_dv_timings = adv748x_hdmi_query_dv_timings, .g_input_status = adv748x_hdmi_g_input_status, + .enuminput = adv748x_hdmi_enuminput, .s_stream = adv748x_hdmi_s_stream, .g_pixelaspect = adv748x_hdmi_g_pixelaspect, }; -- 2.7.4