From patchwork Mon Nov 25 09:58:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacek Anaszewski X-Patchwork-Id: 3228971 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 25599C045B for ; Mon, 25 Nov 2013 09:59:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1ADB52018B for ; Mon, 25 Nov 2013 09:59:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EAF842022F for ; Mon, 25 Nov 2013 09:59:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751852Ab3KYJ67 (ORCPT ); Mon, 25 Nov 2013 04:58:59 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:56536 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751305Ab3KYJ66 (ORCPT ); Mon, 25 Nov 2013 04:58:58 -0500 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MWT00ANVD29VE20@mailout1.samsung.com> for linux-media@vger.kernel.org; Mon, 25 Nov 2013 18:58:57 +0900 (KST) X-AuditID: cbfee61b-b7f166d000007a34-d0-52931f619be3 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 25.64.31284.16F13925; Mon, 25 Nov 2013 18:58:57 +0900 (KST) Received: from AMDC2362.DIGITAL.local ([106.120.53.23]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MWT004BMD1ERF40@mmp2.samsung.com>; Mon, 25 Nov 2013 18:58:57 +0900 (KST) From: Jacek Anaszewski To: linux-media@vger.kernel.org Cc: sw0312.kim@samsung.com, andrzej.p@samsung.com, s.nawrocki@samsung.com, Jacek Anaszewski , Kyungmin Park Subject: [PATCH v2 08/16] s5p-jpeg: Synchronize cached controls with V4L2 core Date: Mon, 25 Nov 2013 10:58:15 +0100 Message-id: <1385373503-1657-9-git-send-email-j.anaszewski@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1385373503-1657-1-git-send-email-j.anaszewski@samsung.com> References: <1385373503-1657-1-git-send-email-j.anaszewski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrHJMWRmVeSWpSXmKPExsVy+t9jQd1E+clBBneeSlrMetnOYtF79Tmj xdmmN+wWPRu2slocftPOajFj8ks2BzaPvi2rGD0+b5ILYIrisklJzcksSy3St0vgymjfMp2p YB1PxaT/wQ2Mi7m6GDk5JARMJLatvcsKYYtJXLi3nq2LkYtDSGA6o8SHv1OYIZx2Jokfa86y gVSxCRhK/HzxmgnEFhGQl3jSewOsg1lgKaPExUlH2EESwgJ+Ep+ajzOD2CwCqhK3zi4Hs3kF 3CXaVzcD1XAArVOQmDPJBsTkFPCQmD8J7AghoIolPzayT2DkXcDIsIpRNLUguaA4KT3XSK84 Mbe4NC9dLzk/dxMjOFSeSe9gXNVgcYhRgINRiYd3YvWkICHWxLLiytxDjBIczEoivKclJwcJ 8aYkVlalFuXHF5XmpBYfYpTmYFES5z3Yah0oJJCeWJKanZpakFoEk2Xi4JRqYCxp2nlcKeOa uLWtcemNZZOFdHLypFe+n5f3iu/e9ph1yqe+MdfukT2yzaeE6YOOrVXUlglXnqXYnOHiq2+K 3/a8+uDXNw3/znfUTb+d11juVDvhd2d7uZTCEnUm2/DC8Mqtq6+KTXVcfDDsgNflU/0LJqiH HrbzKOd6lHxSuWKtmvVS45MzGJVYijMSDbWYi4oTAZSKZbERAgAA Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds proper initialization of the in-driver cached state of JPEG controls with V4L2 core. Signed-off-by: Jacek Anaszewski Signed-off-by: Kyungmin Park --- drivers/media/platform/s5p-jpeg/jpeg-core.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c b/drivers/media/platform/s5p-jpeg/jpeg-core.c index 628fde8..e907738 100644 --- a/drivers/media/platform/s5p-jpeg/jpeg-core.c +++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c @@ -865,6 +865,7 @@ static int s5p_jpeg_controls_create(struct s5p_jpeg_ctx *ctx) { unsigned int mask = ~0x27; /* 444, 422, 420, GRAY */ struct v4l2_ctrl *ctrl; + int ret; v4l2_ctrl_handler_init(&ctx->ctrl_handler, 3); @@ -884,13 +885,24 @@ static int s5p_jpeg_controls_create(struct s5p_jpeg_ctx *ctx) V4L2_JPEG_CHROMA_SUBSAMPLING_GRAY, mask, V4L2_JPEG_CHROMA_SUBSAMPLING_422); - if (ctx->ctrl_handler.error) - return ctx->ctrl_handler.error; + if (ctx->ctrl_handler.error) { + ret = ctx->ctrl_handler.error; + goto error_free; + } if (ctx->mode == S5P_JPEG_DECODE) ctrl->flags |= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_READ_ONLY; - return 0; + + ret = v4l2_ctrl_handler_setup(&ctx->ctrl_handler); + if (ret < 0) + goto error_free; + + return ret; + +error_free: + v4l2_ctrl_handler_free(&ctx->ctrl_handler); + return ret; } static const struct v4l2_ioctl_ops s5p_jpeg_ioctl_ops = {