Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1667689ybt; Mon, 15 Jun 2020 06:31:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYfhvObLU6g8cPXT7mWelSAw9Rx4LojDEWGvgQkF295f0NrufHqMxmj1gImcZNEjSJ3zEg X-Received: by 2002:a17:906:cc85:: with SMTP id oq5mr24850417ejb.142.1592227873475; Mon, 15 Jun 2020 06:31:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592227873; cv=none; d=google.com; s=arc-20160816; b=UeG3qDZotS5H2S4ieVTeAURvj8WkF4iIAwnBdmYX3eLJbbnU2x92N3EEbqPuCfCy9V BVgzE5rQZGqDqVwIAEZPMXMW9j0b5Q171vS6qYiI05RHIP1C1vrPIYmzxsciPtAVv0lv 1ba5FBUaYoCLBl4IB34SvcKsWg6STkz6BUWohvgzFy4cUnuLL96NVUf+sdcDGuVgYzlF FDfuYs0aFDDQOXAHTDP0UuuVcmYa5N3MYgWkOOh4jnPtLz2z/rETtQxmKFCzCLl7dYoJ UYCfMa3IVkza75Fw/ZSa0PP8hwDPgU/E9wUSvglWF4Q46isvARbrCvAWtEGqRBZRVnVw TCXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=F3gh+biXmLChUUhUr54hFPhkNiV8jCkNdqX/xUL6w04=; b=soYDti4J9XVPrBbVxGXEhQcz2fCSQH9qKDh/kiOE4F0fehgvLpUZ4ddwsQls7cUl4H cz11sRrLp0rYs6N2AEu8uTl+9pJIHL+DQaBN1Bud0YJ2U4R+UA/FK987vdsi1gYPsfXo 3ra1dWZzNiMXj7VETGvkKgBIN+LNrc/lR0BjIFN3w74O4z45bMbY4T4gZC7sboTq4c1N aza9Rcu9Wpd4oVZ13YOnNvn2qGFgsqHB0kIZ9SYKsHJ15Ub7kj5FPzGftGys2e5jWOiZ +3cPvcDVgxOEWvo98fAnmasrnuPAeW6qQn3l2vMKobzNH83nSmZlw0X2pLRwyeuJTppK 0fMg== 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 r15si8475769ejs.733.2020.06.15.06.30.50; Mon, 15 Jun 2020 06:31:13 -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 S1730335AbgFON0y (ORCPT + 99 others); Mon, 15 Jun 2020 09:26:54 -0400 Received: from smtp1.de.adit-jv.com ([93.241.18.167]:56480 "EHLO smtp1.de.adit-jv.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730058AbgFON0y (ORCPT ); Mon, 15 Jun 2020 09:26:54 -0400 Received: from localhost (smtp1.de.adit-jv.com [127.0.0.1]) by smtp1.de.adit-jv.com (Postfix) with ESMTP id 2DE613C04C1; Mon, 15 Jun 2020 15:26:52 +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 09bRN0gTcdFX; Mon, 15 Jun 2020 15:26:47 +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 408223C00BA; Mon, 15 Jun 2020 15:26:47 +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; Mon, 15 Jun 2020 15:26:46 +0200 From: Ramzi BEN MEFTAH To: Kieran Bingham , Mauro Carvalho Chehab , , CC: Michael Rodin , , Subject: [PATCH] media: i2c: adv748x: add enuminput control to adv748x hdmi subdev Date: Mon, 15 Jun 2020 15:26:39 +0200 Message-ID: <1592227599-88545-1-git-send-email-rbmeftah@de.adit-jv.com> X-Mailer: git-send-email 2.7.4 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