From patchwork Mon Nov 12 16:00:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akinobu Mita X-Patchwork-Id: 10678901 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A04BE13BF for ; Mon, 12 Nov 2018 16:01:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 905D42A137 for ; Mon, 12 Nov 2018 16:01:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 84FCF2A1D3; Mon, 12 Nov 2018 16:01:15 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,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 23CD02A137 for ; Mon, 12 Nov 2018 16:01:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729499AbeKMBzE (ORCPT ); Mon, 12 Nov 2018 20:55:04 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:40681 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726221AbeKMBzE (ORCPT ); Mon, 12 Nov 2018 20:55:04 -0500 Received: by mail-pl1-f196.google.com with SMTP id q19-v6so4544508pll.7 for ; Mon, 12 Nov 2018 08:01:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=GWZBJTZaoA3d82xYlqSK4Qp3HIaDK1rzG0Mx8GIyqA0=; b=e4sD7yYJl1+h4a/VYQQson1Kf/OK05v8b7VeFvu2Hn6ok94hz+JBrx68qDbiI4bmE5 2AQjjJ+3IZCj5uE65sg6AKX1WQUwEGHh9UqefNVJjFlOnBo97gCI7WPuhCAkKqm1XX2R 4tiEApR2Aro1DCSqlG19byTiRsZlZinueRpFuDbNLye+K/lL5TFnQvj/+tvSBYjOYSgF aG1Oz6BnpSkahoZhyXTfxYsYRMlPYk5qo4MMhnzbMUF1D5AujYKoOfyNYsMbqeqiD6dn zWwvFbvhzAy7aGgtc+wKstlZj0Ssu0FlduZM1M7KddrwvYuD+tFs4QSi1D4Vac4RZ5Y5 pFPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=GWZBJTZaoA3d82xYlqSK4Qp3HIaDK1rzG0Mx8GIyqA0=; b=NP96REHrbEU8eh/M/QAQRYb52vL9tFr7REN/5vHiI5Uysv33LavqfGOj9szz48RWX0 dt/zdOPxFpn/0+UvaOyxqUBvPPVioIJybbyIZ4beCk3ts+qI6/dxkIjy/g81ysXi5PMF 31JObcplCEpBj9NtR56pFKSYHhqA9MjZ0llYxsfn/fQgLGMDvR0Az+4rg2glhLJ1Nen3 xTurSN5A8k8kBWB4jype8SnZeX/yHptN4+uvw0yR8u8+M/xfuUDA/G5zKku4GqXQF1rv TMu/Ng+yeAWMLaTNVwxIOm2lslVsmjuc2Z/HiLHynNyW11IQp5LvRMFmyI/8Y0bqCruf CMgw== X-Gm-Message-State: AGRZ1gIOGwu7u9878+7J+GQTnnZup/g5cBAVjP15kDHUBsVFHPbmspHA 58UK0x7ex9gF0vMp1zVWluMb6XMb X-Google-Smtp-Source: AJdET5c3qQrA+N7s+CacLOYMzByPdDER5VfPza2ltZOANw6r1VblOj9MMjYSqrkrL8SQQHa7X1gaZw== X-Received: by 2002:a17:902:7042:: with SMTP id h2mr1461363plt.341.1542038473484; Mon, 12 Nov 2018 08:01:13 -0800 (PST) Received: from mita-MS-7A45.lan ([240f:34:212d:1:4c9:76a6:795e:e9ef]) by smtp.gmail.com with ESMTPSA id v74-v6sm26777610pfk.12.2018.11.12.08.01.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 12 Nov 2018 08:01:13 -0800 (PST) From: Akinobu Mita To: linux-media@vger.kernel.org Cc: Akinobu Mita , Sakari Ailus , Mauro Carvalho Chehab Subject: [PATCH 1/7] media: mt9m111: support log_status ioctl and event interface Date: Tue, 13 Nov 2018 01:00:48 +0900 Message-Id: <1542038454-20066-2-git-send-email-akinobu.mita@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1542038454-20066-1-git-send-email-akinobu.mita@gmail.com> References: <1542038454-20066-1-git-send-email-akinobu.mita@gmail.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 This adds log_status ioctl and event interface for mt9m111's v4l2 controls. Cc: Sakari Ailus Cc: Mauro Carvalho Chehab Signed-off-by: Akinobu Mita --- drivers/media/i2c/mt9m111.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/mt9m111.c b/drivers/media/i2c/mt9m111.c index 1395986..f4fc459 100644 --- a/drivers/media/i2c/mt9m111.c +++ b/drivers/media/i2c/mt9m111.c @@ -21,6 +21,7 @@ #include #include #include +#include /* * MT9M111, MT9M112 and MT9M131: @@ -862,6 +863,9 @@ static const struct v4l2_ctrl_ops mt9m111_ctrl_ops = { static const struct v4l2_subdev_core_ops mt9m111_subdev_core_ops = { .s_power = mt9m111_s_power, + .log_status = v4l2_ctrl_subdev_log_status, + .subscribe_event = v4l2_ctrl_subdev_subscribe_event, + .unsubscribe_event = v4l2_event_subdev_unsubscribe, #ifdef CONFIG_VIDEO_ADV_DEBUG .g_register = mt9m111_g_register, .s_register = mt9m111_s_register, @@ -976,7 +980,8 @@ static int mt9m111_probe(struct i2c_client *client, mt9m111->ctx = &context_b; v4l2_i2c_subdev_init(&mt9m111->subdev, client, &mt9m111_subdev_ops); - mt9m111->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; + mt9m111->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | + V4L2_SUBDEV_FL_HAS_EVENTS; v4l2_ctrl_handler_init(&mt9m111->hdl, 5); v4l2_ctrl_new_std(&mt9m111->hdl, &mt9m111_ctrl_ops, From patchwork Mon Nov 12 16:00:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akinobu Mita X-Patchwork-Id: 10678903 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0F0A6139B for ; Mon, 12 Nov 2018 16:01:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F10AF2A1DA for ; Mon, 12 Nov 2018 16:01:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E5AA42A1E0; Mon, 12 Nov 2018 16:01:18 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,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 828BD2A1B3 for ; Mon, 12 Nov 2018 16:01:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729531AbeKMBzI (ORCPT ); Mon, 12 Nov 2018 20:55:08 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:45107 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726221AbeKMBzI (ORCPT ); Mon, 12 Nov 2018 20:55:08 -0500 Received: by mail-pl1-f193.google.com with SMTP id r3-v6so3810166pls.12 for ; Mon, 12 Nov 2018 08:01:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=yhUiDrEzvUj09wyq7BdC3fVDwb1/iNbP/fkqW+mPUAw=; b=DJWiQX9SjWbfum07RGyStqSH18axpmchtAs76+FApmKgiFnts5Fi99aKolMzw/I7CE guC7mxCYqq8C/o0EpKWH4wr+0sLD2lnnxr4iVWUYZCk7KFTyQVXx2kx9E8/BVrDsZ0uo +Ci9L11pNmH1WSHCDkfggVNY49es8kDwHOdvh2Dojg9CcGr9rku7G8gRo2mw8KychMo6 Bzfrh1BjueC78zRKgYE2OpCiWK0Asg0hyc17b159yXOcdIBDPOjLPhrKRUkLcq2VLB2e ccDzb1tgEnvfwDqx0+cbQuZGgmSUNe5Ggp8mkZF9MT7wiem0adMz9rkCfuPihhSJxDDt xjCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=yhUiDrEzvUj09wyq7BdC3fVDwb1/iNbP/fkqW+mPUAw=; b=BaBGCsjdgQ+2Zdec1gYd3icRTVBvpLmN0ydmOT5w4ZuWkF0dn/ex74KAlj0qszvO8X 2cKXC252TQwNuAtXV3KUES5RoRcLSY9qF8KTAkkty5wpYVrC7oRMs9tS00kmJk03uPDt ZqQkDJHEt2adKmfwptlylPQdo/GqExsvY/9h3+/8dVCmcgdnY3JMOuQRPc2BJbc5Tiz9 t5YkM3VO3CBERKw3p9YPkHtmuJi1F4gE8z5HQBaMfONJd/rASdfmVyNTRfGbQ/QW+mU2 DmDvejckD1ciBzbT4QtELgEdmlaizhKJiPdp9ebdTdNY4NiZfL0U0uekJ5gsDaOgaK1O 2iEQ== X-Gm-Message-State: AGRZ1gKSX2IMF6AaF9gbIPpIdkjN+xAX4q/XiT+7egdYHAHQ4uRZqxvU XCVPqAKhAWDQqQ/0XodPbb/ElboI X-Google-Smtp-Source: AJdET5f9Z8tL+lL01xhEU8m/48yRVGXEBi/IN8//ZtQb2ML2fSJq7M3QnMisaudXtQnaOHbjoX2KIg== X-Received: by 2002:a17:902:9a07:: with SMTP id v7-v6mr1428977plp.14.1542038476464; Mon, 12 Nov 2018 08:01:16 -0800 (PST) Received: from mita-MS-7A45.lan ([240f:34:212d:1:4c9:76a6:795e:e9ef]) by smtp.gmail.com with ESMTPSA id v74-v6sm26777610pfk.12.2018.11.12.08.01.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 12 Nov 2018 08:01:15 -0800 (PST) From: Akinobu Mita To: linux-media@vger.kernel.org Cc: Akinobu Mita , Sakari Ailus , Mauro Carvalho Chehab Subject: [PATCH 2/7] media: mt9m111: add V4L2_CID_COLORFX control Date: Tue, 13 Nov 2018 01:00:49 +0900 Message-Id: <1542038454-20066-3-git-send-email-akinobu.mita@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1542038454-20066-1-git-send-email-akinobu.mita@gmail.com> References: <1542038454-20066-1-git-send-email-akinobu.mita@gmail.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 The mt9m111 has special camera effects feature. This makes use of it through V4L2_CID_COLORFX control. Cc: Sakari Ailus Cc: Mauro Carvalho Chehab Signed-off-by: Akinobu Mita --- drivers/media/i2c/mt9m111.c | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/mt9m111.c b/drivers/media/i2c/mt9m111.c index f4fc459..58d134d 100644 --- a/drivers/media/i2c/mt9m111.c +++ b/drivers/media/i2c/mt9m111.c @@ -102,6 +102,7 @@ #define MT9M111_REDUCER_XSIZE_A 0x1a7 #define MT9M111_REDUCER_YZOOM_A 0x1a9 #define MT9M111_REDUCER_YSIZE_A 0x1aa +#define MT9M111_EFFECTS_MODE 0x1e2 #define MT9M111_OUTPUT_FORMAT_CTRL2_A 0x13a #define MT9M111_OUTPUT_FORMAT_CTRL2_B 0x19b @@ -127,6 +128,7 @@ #define MT9M111_OUTFMT_SWAP_YCbCr_C_Y_RGB_EVEN (1 << 1) #define MT9M111_OUTFMT_SWAP_YCbCr_Cb_Cr_RGB_R_B (1 << 0) #define MT9M111_TPG_SEL_MASK GENMASK(2, 0) +#define MT9M111_EFFECTS_MODE_MASK GENMASK(2, 0) /* * Camera control register addresses (0x200..0x2ff not implemented) @@ -727,6 +729,29 @@ static int mt9m111_set_test_pattern(struct mt9m111 *mt9m111, int val) MT9M111_TPG_SEL_MASK); } +static int mt9m111_set_colorfx(struct mt9m111 *mt9m111, int val) +{ + struct i2c_client *client = v4l2_get_subdevdata(&mt9m111->subdev); + static const struct v4l2_control colorfx[] = { + { V4L2_COLORFX_NONE, 0 }, + { V4L2_COLORFX_BW, 1 }, + { V4L2_COLORFX_SEPIA, 2 }, + { V4L2_COLORFX_NEGATIVE, 3 }, + { V4L2_COLORFX_SOLARIZATION, 4 }, + }; + int i; + + for (i = 0; i < ARRAY_SIZE(colorfx); i++) { + if (colorfx[i].id == val) { + return mt9m111_reg_mask(client, MT9M111_EFFECTS_MODE, + colorfx[i].value, + MT9M111_EFFECTS_MODE_MASK); + } + } + + return -EINVAL; +} + static int mt9m111_s_ctrl(struct v4l2_ctrl *ctrl) { struct mt9m111 *mt9m111 = container_of(ctrl->handler, @@ -747,6 +772,8 @@ static int mt9m111_s_ctrl(struct v4l2_ctrl *ctrl) return mt9m111_set_autowhitebalance(mt9m111, ctrl->val); case V4L2_CID_TEST_PATTERN: return mt9m111_set_test_pattern(mt9m111, ctrl->val); + case V4L2_CID_COLORFX: + return mt9m111_set_colorfx(mt9m111, ctrl->val); } return -EINVAL; @@ -983,7 +1010,7 @@ static int mt9m111_probe(struct i2c_client *client, mt9m111->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | V4L2_SUBDEV_FL_HAS_EVENTS; - v4l2_ctrl_handler_init(&mt9m111->hdl, 5); + v4l2_ctrl_handler_init(&mt9m111->hdl, 7); v4l2_ctrl_new_std(&mt9m111->hdl, &mt9m111_ctrl_ops, V4L2_CID_VFLIP, 0, 1, 1, 0); v4l2_ctrl_new_std(&mt9m111->hdl, &mt9m111_ctrl_ops, @@ -999,6 +1026,14 @@ static int mt9m111_probe(struct i2c_client *client, &mt9m111_ctrl_ops, V4L2_CID_TEST_PATTERN, ARRAY_SIZE(mt9m111_test_pattern_menu) - 1, 0, 0, mt9m111_test_pattern_menu); + v4l2_ctrl_new_std_menu(&mt9m111->hdl, &mt9m111_ctrl_ops, + V4L2_CID_COLORFX, V4L2_COLORFX_SOLARIZATION, + ~(BIT(V4L2_COLORFX_NONE) | + BIT(V4L2_COLORFX_BW) | + BIT(V4L2_COLORFX_SEPIA) | + BIT(V4L2_COLORFX_NEGATIVE) | + BIT(V4L2_COLORFX_SOLARIZATION)), + V4L2_COLORFX_NONE); mt9m111->subdev.ctrl_handler = &mt9m111->hdl; if (mt9m111->hdl.error) { ret = mt9m111->hdl.error; From patchwork Mon Nov 12 16:00:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akinobu Mita X-Patchwork-Id: 10678905 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F2AAD13BF for ; Mon, 12 Nov 2018 16:01:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E2B772A19B for ; Mon, 12 Nov 2018 16:01:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D73AB2A1AB; Mon, 12 Nov 2018 16:01:20 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,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 7722C2A1A5 for ; Mon, 12 Nov 2018 16:01:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729548AbeKMBzK (ORCPT ); Mon, 12 Nov 2018 20:55:10 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:40689 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726221AbeKMBzK (ORCPT ); Mon, 12 Nov 2018 20:55:10 -0500 Received: by mail-pl1-f195.google.com with SMTP id q19-v6so4544623pll.7 for ; Mon, 12 Nov 2018 08:01:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Plw2j8OS1X8iF/GyUkO2E6X190z3HVgcPI+AO3CQ5f0=; b=VnLvJd2+65R35do1xdx+xN6Wm+oqAtopFVOuiXvZy2JkQ11gNK2jPK2S8w1UhAJSCu s7V/UZrBUYNnTe31UKvufLQVDsOpTQ25wleyCF7E5VcfDIgVs3adEulxioqmX1h//05R vSuph4GQ6gnaKbrj8K+9wxe4GIULhrvVj3mRw7lGiD3cL5yol6c3oiAx1Cm3gLxqaw0Z 91G/ugjqSp4nCviMAwU3U33uML97ecSPwI+ita6xUzBywv9DkEMUmeEBCZXxEgMo6TzY RRl6I27fNR3j59ENGysG08DNHDzvdb6hB8lbRSFg9q696EiNxMufbtx2aXa2fgsnEqLy NBwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Plw2j8OS1X8iF/GyUkO2E6X190z3HVgcPI+AO3CQ5f0=; b=Yqa+pjZFTBbcjjH9/HVEYGnTevc+85Yj9IvcuUHb5ierIHeFTL+FgNhydZkb7/fINg qu27MqrFasHtFGWKnKkKoU0O9A8sExwpeepfRBlAA5LFEKAPt0LFM2c0TNciXeE7ffui mXBCyyMFG1WfF2We1cDsDhSu4C0mzuG7VYf1j2VDZlSlKe7r6csE719agwC2bwQVUytZ 4/4jdruRfDkbYfmVOTkVpVpJYd5AagiR0acp3d+KkVHIVM7eQMconB++VlagQji7J/4s jVkRy4o9TLZ389JrSb7BmZ4fh6Lw3LkIgdbcnvcKguVOjDJH8ccIFnKjSyZuyOSr0zpj efYw== X-Gm-Message-State: AGRZ1gL/32TnGLW9uLIah4JthsQUjzVhxM2vsnnJzgKzz9TXTIetWvNd pcZyAaJO8GiQg0JecabPQKZHHwvq X-Google-Smtp-Source: AJdET5c8+VtShaemsD2SNBvedJBoVQcpp9KSzM8Zq0A5xu3XyB7zFPrqxY5LwNW/qQ1t7casw2h+Ug== X-Received: by 2002:a17:902:124:: with SMTP id 33-v6mr1448249plb.287.1542038479007; Mon, 12 Nov 2018 08:01:19 -0800 (PST) Received: from mita-MS-7A45.lan ([240f:34:212d:1:4c9:76a6:795e:e9ef]) by smtp.gmail.com with ESMTPSA id v74-v6sm26777610pfk.12.2018.11.12.08.01.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 12 Nov 2018 08:01:18 -0800 (PST) From: Akinobu Mita To: linux-media@vger.kernel.org Cc: Akinobu Mita , Sakari Ailus , Mauro Carvalho Chehab Subject: [PATCH 3/7] media: ov2640: add V4L2_CID_TEST_PATTERN control Date: Tue, 13 Nov 2018 01:00:50 +0900 Message-Id: <1542038454-20066-4-git-send-email-akinobu.mita@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1542038454-20066-1-git-send-email-akinobu.mita@gmail.com> References: <1542038454-20066-1-git-send-email-akinobu.mita@gmail.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 The ov2640 has the test pattern generator features. This makes use of it through V4L2_CID_TEST_PATTERN control. Cc: Sakari Ailus Cc: Mauro Carvalho Chehab Signed-off-by: Akinobu Mita --- drivers/media/i2c/ov2640.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/ov2640.c b/drivers/media/i2c/ov2640.c index 20a8853..4992d77 100644 --- a/drivers/media/i2c/ov2640.c +++ b/drivers/media/i2c/ov2640.c @@ -705,6 +705,11 @@ static int ov2640_reset(struct i2c_client *client) return ret; } +static const char * const ov2640_test_pattern_menu[] = { + "Disabled", + "Color bar", +}; + /* * functions */ @@ -740,6 +745,9 @@ static int ov2640_s_ctrl(struct v4l2_ctrl *ctrl) case V4L2_CID_HFLIP: val = ctrl->val ? REG04_HFLIP_IMG : 0x00; return ov2640_mask_set(client, REG04, REG04_HFLIP_IMG, val); + case V4L2_CID_TEST_PATTERN: + val = ctrl->val ? COM7_COLOR_BAR_TEST : 0x00; + return ov2640_mask_set(client, COM7, COM7_COLOR_BAR_TEST, val); } return -EINVAL; @@ -1184,12 +1192,16 @@ static int ov2640_probe(struct i2c_client *client, v4l2_i2c_subdev_init(&priv->subdev, client, &ov2640_subdev_ops); priv->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; mutex_init(&priv->lock); - v4l2_ctrl_handler_init(&priv->hdl, 2); + v4l2_ctrl_handler_init(&priv->hdl, 3); priv->hdl.lock = &priv->lock; v4l2_ctrl_new_std(&priv->hdl, &ov2640_ctrl_ops, V4L2_CID_VFLIP, 0, 1, 1, 0); v4l2_ctrl_new_std(&priv->hdl, &ov2640_ctrl_ops, V4L2_CID_HFLIP, 0, 1, 1, 0); + v4l2_ctrl_new_std_menu_items(&priv->hdl, &ov2640_ctrl_ops, + V4L2_CID_TEST_PATTERN, + ARRAY_SIZE(ov2640_test_pattern_menu) - 1, 0, 0, + ov2640_test_pattern_menu); priv->subdev.ctrl_handler = &priv->hdl; if (priv->hdl.error) { ret = priv->hdl.error; From patchwork Mon Nov 12 16:00:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akinobu Mita X-Patchwork-Id: 10678907 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D003713BF for ; Mon, 12 Nov 2018 16:01:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C043C2A161 for ; Mon, 12 Nov 2018 16:01:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B4CF92A1F0; Mon, 12 Nov 2018 16:01:23 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,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 5DA812A1E4 for ; Mon, 12 Nov 2018 16:01:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729574AbeKMBzN (ORCPT ); Mon, 12 Nov 2018 20:55:13 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:42221 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726221AbeKMBzN (ORCPT ); Mon, 12 Nov 2018 20:55:13 -0500 Received: by mail-pf1-f196.google.com with SMTP id 64so54666pfr.9 for ; Mon, 12 Nov 2018 08:01:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=sm8Jso/p0wOmQCwPX0We73sgfZFKM26BV10d21ejhcg=; b=qeVqMUCHhF+pk4Z10ZlJr7eJBhm1i//lyGP/sfv8g9oR9FF/wGW3/1uUOgn38pYzEr ftl7TRRXwVHI73g0zcBgaQXBvP3OHqrwoYx7mmY1cznwdafuXoWTn9E/c3qyzXD92vPT H8ppNIh35Ebw7MP1ba1w5/+cv5jlcorPVrkmHmxt76p8hB1G9PcdFOQ5nLIYNehGvEjk E54AlXXdkD42qTno/zPMJj626APGfiBm0me49p/u9ZPW70lOZREeC0jDKYBhfcvFsRw3 CC0PupKtFicZF+Iti/xmXI4nNtBddT5/hLL4GI16lQjhSTNXctycmaSgM49Oa4CHqpKu XwTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=sm8Jso/p0wOmQCwPX0We73sgfZFKM26BV10d21ejhcg=; b=GxWuYoftFUhFDT3/9/v+sI2uznrYynkgZGkvK7y+0Zem+HF37DhT5xKwxf9xb6xkDS NTMHLrLU8FweHDt/9GeD5gMUiE1f7PYcUORfzLjMqmIoPgAcfKK6hoGUBejvWkkU5Qw5 WkQRQqXzjPFO6m6iu5777xfwvGvFc4K4RUMK0UndPxbkozy5zPjzU4bEOdbzfJll0c57 QR9MethF4CwyBeux56n2k3mEw+Mjh/EYnUaiU2UjqSmprv4GvMAFB3IGPOYD7+Qpkymi ZvaDYHtkx2Odjj9BZHGqdJBuCEISDFTmLRH02A0DUYXCDy+o9u9p0m5nALjrC0czlDkg ZDvw== X-Gm-Message-State: AGRZ1gJcGnAPhCffiP66yNIsfqU8YteJjwgfAuQc6PMmuntht0Uhxx6l 54mmA/jywNfVvazpG7kmpTwSlKwP X-Google-Smtp-Source: AJdET5eqwymf+WoffFouC8ZGiGdGo/4Gdfy2EnanQMEy9Lz1Dhp2ZX3P7MwwYZyRw734TV5JiXCJXQ== X-Received: by 2002:a63:bd01:: with SMTP id a1-v6mr1317105pgf.58.1542038481563; Mon, 12 Nov 2018 08:01:21 -0800 (PST) Received: from mita-MS-7A45.lan ([240f:34:212d:1:4c9:76a6:795e:e9ef]) by smtp.gmail.com with ESMTPSA id v74-v6sm26777610pfk.12.2018.11.12.08.01.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 12 Nov 2018 08:01:20 -0800 (PST) From: Akinobu Mita To: linux-media@vger.kernel.org Cc: Akinobu Mita , Sakari Ailus , Mauro Carvalho Chehab Subject: [PATCH 4/7] media: ov2640: support log_status ioctl and event interface Date: Tue, 13 Nov 2018 01:00:51 +0900 Message-Id: <1542038454-20066-5-git-send-email-akinobu.mita@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1542038454-20066-1-git-send-email-akinobu.mita@gmail.com> References: <1542038454-20066-1-git-send-email-akinobu.mita@gmail.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 This adds log_status ioctl and event interface for ov2640's v4l2 controls. Cc: Sakari Ailus Cc: Mauro Carvalho Chehab Signed-off-by: Akinobu Mita --- drivers/media/i2c/ov2640.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/ov2640.c b/drivers/media/i2c/ov2640.c index 4992d77..d8e91bc 100644 --- a/drivers/media/i2c/ov2640.c +++ b/drivers/media/i2c/ov2640.c @@ -26,6 +26,7 @@ #include #include +#include #include #include #include @@ -1096,6 +1097,9 @@ static const struct v4l2_ctrl_ops ov2640_ctrl_ops = { }; static const struct v4l2_subdev_core_ops ov2640_subdev_core_ops = { + .log_status = v4l2_ctrl_subdev_log_status, + .subscribe_event = v4l2_ctrl_subdev_subscribe_event, + .unsubscribe_event = v4l2_event_subdev_unsubscribe, #ifdef CONFIG_VIDEO_ADV_DEBUG .g_register = ov2640_g_register, .s_register = ov2640_s_register, @@ -1190,7 +1194,8 @@ static int ov2640_probe(struct i2c_client *client, goto err_clk; v4l2_i2c_subdev_init(&priv->subdev, client, &ov2640_subdev_ops); - priv->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; + priv->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | + V4L2_SUBDEV_FL_HAS_EVENTS; mutex_init(&priv->lock); v4l2_ctrl_handler_init(&priv->hdl, 3); priv->hdl.lock = &priv->lock; From patchwork Mon Nov 12 16:00:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akinobu Mita X-Patchwork-Id: 10678909 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 877B3139B for ; Mon, 12 Nov 2018 16:01:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 76DD62A19B for ; Mon, 12 Nov 2018 16:01:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6B3D22A1F7; Mon, 12 Nov 2018 16:01:26 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,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 1ABC62A1C0 for ; Mon, 12 Nov 2018 16:01:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729582AbeKMBzQ (ORCPT ); Mon, 12 Nov 2018 20:55:16 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:38354 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726221AbeKMBzP (ORCPT ); Mon, 12 Nov 2018 20:55:15 -0500 Received: by mail-pf1-f194.google.com with SMTP id v76-v6so1704349pfa.5 for ; Mon, 12 Nov 2018 08:01:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5Ydt5QJ8sWh77EvnYvkrFWjLMwTvWl9QkCrhDj25rC8=; b=pYLFJL3+mqn6qr3GYBwmP8Fy/DdYkheJsMM98xsDFwhHteWgIlLZX9+SSN1++l3hJh jqetD88u3NAzJDka+r50KjNp/UYKoCbwXi18j2UpzwrYd4bYgMdmlKTRq8pQO/g4AYkf CaZ+1A0zsheWpYesd9wFgHLDKFzFZnXFJQBE2JZW/zJl7EUu7lIVDN1KirWEfa2AIcRB k+BGyYtOJsrMEzxbSvkL7A/FSUdhkyGx/RE5qPa7dI9zkTG2rMDqB77dzFA3j+s5lkB0 U0omd2AThwA3jGTwhrLjW0rtD+ZaVKTcPuAn7tDRnsPuo/3BZAXgvoWYgHIPBTm3i7kn x5Og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=5Ydt5QJ8sWh77EvnYvkrFWjLMwTvWl9QkCrhDj25rC8=; b=dwmrwDQl8j8b9JU13ZH/Geh3SdzHFhzB85i69AhSmAiv47Y/m7O5pGxP/JlRZQ+TTa wldXhx3atww9dtgI6HJnf3o+8ggNcBQ+s3dy8WQ/CrOq7E6hdHwVnK+qMo9rkbriYv8/ NroIIF/w1spCwSJ++V1YbBimiLQwJIhfvXoYDC75ROLqJ6tgI4j1RDCAFKL6OiyO1N5r FnGGmuZBucfIHZrLOkTCDSA9L1qJPaseRqMhLfIPInt24ptn52JjQfzM75rbc8MLRQyJ 1KSQCTvLTF4tMcVz8VjCgIBgkZpjt2oMUxU9AJR9d87t+IS4oE95MgfyaMVIYJOoJD5i xzRA== X-Gm-Message-State: AGRZ1gI9Yn+BHLJgTHkzx5ErbJUWBf+SGYueOgJw5BnfRgP/58Jjjruv btWNr3wHT8bPOBsnCPM6a3p16NGw X-Google-Smtp-Source: AJdET5fJ8QxY4nTNjX1VrDin/4LOV8aY7vkOMw2AZyR3lDFzGHfz3Y35RH9vrP0byz5fp4GiJUY6iw== X-Received: by 2002:a63:4101:: with SMTP id o1mr1255386pga.447.1542038484269; Mon, 12 Nov 2018 08:01:24 -0800 (PST) Received: from mita-MS-7A45.lan ([240f:34:212d:1:4c9:76a6:795e:e9ef]) by smtp.gmail.com with ESMTPSA id v74-v6sm26777610pfk.12.2018.11.12.08.01.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 12 Nov 2018 08:01:23 -0800 (PST) From: Akinobu Mita To: linux-media@vger.kernel.org Cc: Akinobu Mita , Steve Longerbeam , Sakari Ailus , Mauro Carvalho Chehab Subject: [PATCH 5/7] media: ov5640: support log_status ioctl and event interface Date: Tue, 13 Nov 2018 01:00:52 +0900 Message-Id: <1542038454-20066-6-git-send-email-akinobu.mita@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1542038454-20066-1-git-send-email-akinobu.mita@gmail.com> References: <1542038454-20066-1-git-send-email-akinobu.mita@gmail.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 This adds log_status ioctl and event interface for ov5640's v4l2 controls. Cc: Steve Longerbeam Cc: Sakari Ailus Cc: Mauro Carvalho Chehab Signed-off-by: Akinobu Mita --- drivers/media/i2c/ov5640.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c index eaefdb5..a91d917 100644 --- a/drivers/media/i2c/ov5640.c +++ b/drivers/media/i2c/ov5640.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -2641,6 +2642,9 @@ static int ov5640_s_stream(struct v4l2_subdev *sd, int enable) static const struct v4l2_subdev_core_ops ov5640_core_ops = { .s_power = ov5640_s_power, + .log_status = v4l2_ctrl_subdev_log_status, + .subscribe_event = v4l2_ctrl_subdev_subscribe_event, + .unsubscribe_event = v4l2_event_subdev_unsubscribe, }; static const struct v4l2_subdev_video_ops ov5640_video_ops = { @@ -2795,7 +2799,8 @@ static int ov5640_probe(struct i2c_client *client, v4l2_i2c_subdev_init(&sensor->sd, client, &ov5640_subdev_ops); - sensor->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; + sensor->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | + V4L2_SUBDEV_FL_HAS_EVENTS; sensor->pad.flags = MEDIA_PAD_FL_SOURCE; sensor->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR; ret = media_entity_pads_init(&sensor->sd.entity, 1, &sensor->pad); From patchwork Mon Nov 12 16:00:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akinobu Mita X-Patchwork-Id: 10678911 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 53EFC139B for ; Mon, 12 Nov 2018 16:01:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 43C902A1F0 for ; Mon, 12 Nov 2018 16:01:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 386E42A1F8; Mon, 12 Nov 2018 16:01:29 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,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 DA2562A1F7 for ; Mon, 12 Nov 2018 16:01:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729616AbeKMBzS (ORCPT ); Mon, 12 Nov 2018 20:55:18 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:45448 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726221AbeKMBzS (ORCPT ); Mon, 12 Nov 2018 20:55:18 -0500 Received: by mail-pg1-f196.google.com with SMTP id y4so4244000pgc.12 for ; Mon, 12 Nov 2018 08:01:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=d+rEwTb/rEJN769GdNj0Ksmvy8IimyExDfy5XDhxFV0=; b=SktTakR/M+vDEjK/QHEcmhnABiUKcHxBf/C8AeiKGx5GQkZOSQJyKxni7GCpOCtHJV EOuwI/aau1yMrSjyZQM1eB4n7/jejD6W4posj5FmxlbfdWaJzyXDzT5BAQqN+bqnkXte U1WNjBD7NVspcFAzCtkpBGDn+uyx5Pi5ciBxWU2GRcTDUx0Zg1mAM1k89fmObevzYjwb Xb2O091UojIOcqOGUqGtPqjtu4t8mBVxoGwBo5WYjfJjfUph0Pvvh7EMto7EB8nXDp/R W6DN4/odLoMGVZpYOyGI0T2EhaPJ+hAa4pHF5VRfzMsW8lT6EeTe9/ZeatL20m9KJYBj OIYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=d+rEwTb/rEJN769GdNj0Ksmvy8IimyExDfy5XDhxFV0=; b=mZAUFbSONeMrxmD0r8/F0CEVoyhNIAme9gxDLMM7+bIHw0/wouu/SddsPPy4elnUlT cdrqK7gYkEhxyrBGvDA3KC/2y4svmbSvIqLBb6ALCwfx/MA2XjkqhS8/uLVl1M0w4hFu yUloMxOP2VdI3XrKJm4m2YwYPQYtvFzsKSUDpK7TkmKXhfFppvftLRSxK1iz2MO0ZyOO e3EJ6RU4JN5s22DE3qm34zjiev4nfCmkorHMxpe6DR7iQPL+bu0djPwOT+QdFZRiXUpX C5C8V/FR62qx3ueQzG/CbKmtTH+kbQ8JYapc91Hk2yC4UkR9EvpU1MqKEq2yVyAW4JkL TO2g== X-Gm-Message-State: AGRZ1gIlEvEFoNaW5+jSOuKZh+iRUh2i8anVtA8xTSnU7CFEZQ5sp/a1 Ub7AEd9t+H7PWvyUElaKEp5ljkbm X-Google-Smtp-Source: AJdET5fY54rI3DEUCKnJURh/a3Bj93Xx832dvPA/JYdt2gP36A8qkRHTmfsc0jH0YI4jRTzB7hCG4Q== X-Received: by 2002:aa7:87d0:: with SMTP id i16-v6mr1444582pfo.20.1542038487353; Mon, 12 Nov 2018 08:01:27 -0800 (PST) Received: from mita-MS-7A45.lan ([240f:34:212d:1:4c9:76a6:795e:e9ef]) by smtp.gmail.com with ESMTPSA id v74-v6sm26777610pfk.12.2018.11.12.08.01.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 12 Nov 2018 08:01:26 -0800 (PST) From: Akinobu Mita To: linux-media@vger.kernel.org Cc: Akinobu Mita , Jonathan Corbet , Sakari Ailus , Mauro Carvalho Chehab Subject: [PATCH 6/7] media: ov7670: support log_status ioctl and event interface Date: Tue, 13 Nov 2018 01:00:53 +0900 Message-Id: <1542038454-20066-7-git-send-email-akinobu.mita@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1542038454-20066-1-git-send-email-akinobu.mita@gmail.com> References: <1542038454-20066-1-git-send-email-akinobu.mita@gmail.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 This adds log_status ioctl and event interface for ov7670's v4l2 controls. Cc: Jonathan Corbet Cc: Sakari Ailus Cc: Mauro Carvalho Chehab Signed-off-by: Akinobu Mita --- drivers/media/i2c/ov7670.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/ov7670.c b/drivers/media/i2c/ov7670.c index bc68a3a..a70a6ff 100644 --- a/drivers/media/i2c/ov7670.c +++ b/drivers/media/i2c/ov7670.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -1651,6 +1652,9 @@ static int ov7670_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) static const struct v4l2_subdev_core_ops ov7670_core_ops = { .reset = ov7670_reset, .init = ov7670_init, + .log_status = v4l2_ctrl_subdev_log_status, + .subscribe_event = v4l2_ctrl_subdev_subscribe_event, + .unsubscribe_event = v4l2_event_subdev_unsubscribe, #ifdef CONFIG_VIDEO_ADV_DEBUG .g_register = ov7670_g_register, .s_register = ov7670_s_register, @@ -1773,7 +1777,7 @@ static int ov7670_probe(struct i2c_client *client, #ifdef CONFIG_VIDEO_V4L2_SUBDEV_API sd->internal_ops = &ov7670_subdev_internal_ops; - sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; + sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | V4L2_SUBDEV_FL_HAS_EVENTS; #endif info->clock_speed = 30; /* default: a guess */ From patchwork Mon Nov 12 16:00:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akinobu Mita X-Patchwork-Id: 10678913 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A5B8F139B for ; Mon, 12 Nov 2018 16:01:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 94D9D2A1FF for ; Mon, 12 Nov 2018 16:01:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 88A392A172; Mon, 12 Nov 2018 16:01:33 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,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 089D82A172 for ; Mon, 12 Nov 2018 16:01:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729713AbeKMBzW (ORCPT ); Mon, 12 Nov 2018 20:55:22 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:35808 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729601AbeKMBzV (ORCPT ); Mon, 12 Nov 2018 20:55:21 -0500 Received: by mail-pf1-f194.google.com with SMTP id v9-v6so4533008pff.2 for ; Mon, 12 Nov 2018 08:01:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rxDW/XXTbCDqN0DWr9EV/j7/K88xHbdaLdWaL3Nwlrg=; b=lLNHXcVTioFHumvefOFYOpN2QYNzW/rYcU/PoZOzHFQpm8ya09FosY7cowH+U3w4JJ TeWB4wBYAQ7wJ5mhdqrxS4sXIR5Ch69wTos1fXk0ML0qEp8jaVcV/9o3QcXxz/H2T+25 NXUiOx2Ks0DRZNKDrGknn0KGiqRztSyshY2zJFgECK3C18HXapWv5cG96xUdOa2Sz4JH C0d1FesqdBb/IkSZ5Ad3jGruQsYXVfcQcp+aLTr8O89vGh3miAsB83RcVnQfw/IVQN/+ ZlfQM8kf/9TjoacYuQ2yFhspunu6plNg9XNi+B8NtOTl10qIC99YSr3Bv4xYl9xZFEqI kAZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=rxDW/XXTbCDqN0DWr9EV/j7/K88xHbdaLdWaL3Nwlrg=; b=RK6+zG2qZEzbFuSt2wk5Mo/UbRWPVBKu8kj3rflnCeNCM+W1dJtM48sIASOvyxVOV9 0xZiJfaUoh/1XnuKesNeBvSCNShlvxZ4yBRrLOidjjAZfd2pLcc1sQKM1W4lcqeUoDWp 7wsxlN1oBCKoy8X0U3rH4ZFZyG9E0+U+Lk7sm8zSy5W5WXFD3CCfxa2ac8Ic0EbEpwlE DUQQ4Z0oEn9e1yAELCNbkgvYfmv8yTUkI04Z1VGPbFWQQrgFJVp7WTHP2BkMVCCfDars /u7qn5+TvdagxuZuARA9klYnqV7wzkIVZw37nCh8eq7DYvOT+g5MtlEPftqI7XrF/RWf p5vA== X-Gm-Message-State: AGRZ1gIrTM3ytlT6ntdJDmVAnLLOBFXHJgQtatK1Qfq7pgRj0TDPVIIy EidQbjVmzMzt9yMKi7KZIh/kkpKn X-Google-Smtp-Source: AJdET5dvCmGFLyc31RVE4hMMo30rC0LOeY0ANwu2fxUjzoAKSmCQHFUP7d7UtPBVIubnrHaVodrMRg== X-Received: by 2002:a63:a41:: with SMTP id z1mr1288808pgk.117.1542038489831; Mon, 12 Nov 2018 08:01:29 -0800 (PST) Received: from mita-MS-7A45.lan ([240f:34:212d:1:4c9:76a6:795e:e9ef]) by smtp.gmail.com with ESMTPSA id v74-v6sm26777610pfk.12.2018.11.12.08.01.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 12 Nov 2018 08:01:29 -0800 (PST) From: Akinobu Mita To: linux-media@vger.kernel.org Cc: Akinobu Mita , Jacopo Mondi , Sakari Ailus , Mauro Carvalho Chehab Subject: [PATCH 7/7] media: ov772x: support log_status ioctl and event interface Date: Tue, 13 Nov 2018 01:00:54 +0900 Message-Id: <1542038454-20066-8-git-send-email-akinobu.mita@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1542038454-20066-1-git-send-email-akinobu.mita@gmail.com> References: <1542038454-20066-1-git-send-email-akinobu.mita@gmail.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 This adds log_status ioctl and event interface for ov772x's v4l2 controls. Cc: Jacopo Mondi Cc: Sakari Ailus Cc: Mauro Carvalho Chehab Signed-off-by: Akinobu Mita --- drivers/media/i2c/ov772x.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/ov772x.c b/drivers/media/i2c/ov772x.c index fefff7f..2e9a758 100644 --- a/drivers/media/i2c/ov772x.c +++ b/drivers/media/i2c/ov772x.c @@ -30,6 +30,7 @@ #include #include +#include #include #include @@ -1287,6 +1288,9 @@ static const struct v4l2_ctrl_ops ov772x_ctrl_ops = { }; static const struct v4l2_subdev_core_ops ov772x_subdev_core_ops = { + .log_status = v4l2_ctrl_subdev_log_status, + .subscribe_event = v4l2_ctrl_subdev_subscribe_event, + .unsubscribe_event = v4l2_event_subdev_unsubscribe, #ifdef CONFIG_VIDEO_ADV_DEBUG .g_register = ov772x_g_register, .s_register = ov772x_s_register, @@ -1379,7 +1383,8 @@ static int ov772x_probe(struct i2c_client *client, mutex_init(&priv->lock); v4l2_i2c_subdev_init(&priv->subdev, client, &ov772x_subdev_ops); - priv->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; + priv->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | + V4L2_SUBDEV_FL_HAS_EVENTS; v4l2_ctrl_handler_init(&priv->hdl, 3); /* Use our mutex for the controls */ priv->hdl.lock = &priv->lock;