From patchwork Mon Nov 28 16:22:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Stevenson X-Patchwork-Id: 13057787 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1CCFEC433FE for ; Mon, 28 Nov 2022 16:23:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232719AbiK1QXY (ORCPT ); Mon, 28 Nov 2022 11:23:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232779AbiK1QXG (ORCPT ); Mon, 28 Nov 2022 11:23:06 -0500 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B29CBDD6 for ; Mon, 28 Nov 2022 08:23:05 -0800 (PST) Received: by mail-wm1-x32b.google.com with SMTP id m7-20020a05600c090700b003cf8a105d9eso8751997wmp.5 for ; Mon, 28 Nov 2022 08:23:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=V87pvfKhrv5gIkXbg/DXD1PcrOJHnwhO9GAYmRp4+zA=; b=E/jhnUSzBKmINQ4pedMBsGRtiF5y0NrqpStQ8SZjFD2m1NlxkLbufPVhY24YmrgW0i ep1EiWXoq3W1GNfRybuc260Vak8elUkPMZE13xHWzlJ8DHfGTGnrcH6mThmR/MdnXLph RPsfxleNJ8kNBNDKm8ebhAX32L6ltGdVsTkw4povHSGtJLVt019jVyHykz82qtSV4XkH VmaLGgJ/Znj2wY64imH5Bjg8uADf5ayEYD7ltSScKzTdsgoNBFxD573piR7zgfCn99bG yDJNuswoxN2cIbce7P/jTY/LdXiLSrlL6MRDL4LaaM9dfVwcQeflvCi5g4Nl54EZ3Y4i YilA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=V87pvfKhrv5gIkXbg/DXD1PcrOJHnwhO9GAYmRp4+zA=; b=rVMk0e9YBgFeeZ7cf6sJZ8dkKbD6y4cE2dCof2ZWSjfsmEtVDsBtTbLu/tvYVFq0jB DJ8RyzysdFTW+H0f2dE8byhmNGici+0+R0tqZ09Qi8yZSLmmtsONzGKHEmgc/xW7h1Wj za80d2tByoPErn/ygG2fy0LWs/rcPOH9PUSUO2ycXUl+lSWQU+RCVGDY0Go6071XVuik 9CUiGeTYrO0bgCng5ipYViP7w2NyHino2P+67ar1k3snobYtbFhzJf7Bu6Ga1QFivV9g 6Q6OTuyi07D/DO83vg/raZdEe8w6iffJb3xQ0c7NW1TFv73fFmBVHh/oQxUsGeeIUZUN fW+A== X-Gm-Message-State: ANoB5pnPJE2io4Ca/OtwmceEs6QbfmVcHcu+7+MRMeaOyIQOwcsCgDmY siDS+FanVf8oh0xfE/RMEekU1g== X-Google-Smtp-Source: AA0mqf7KE+NjUPJMbYl0HWjIn+iUTPOmkOTdQynF+faqgZEzj03jcg4FUHKTimlyoMOG5qSylrSZRA== X-Received: by 2002:a05:600c:2057:b0:3c4:5c4:1df1 with SMTP id p23-20020a05600c205700b003c405c41df1mr40145913wmg.103.1669652584344; Mon, 28 Nov 2022 08:23:04 -0800 (PST) Received: from dave-Ubuntu2204.pitowers.org ([93.93.133.154]) by smtp.googlemail.com with ESMTPSA id o15-20020a5d474f000000b002421a8f4fa6sm2353530wrs.92.2022.11.28.08.23.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Nov 2022 08:23:03 -0800 (PST) From: Dave Stevenson To: "Paul J. Murphy" , Daniele Alessandrelli , Sakari Ailus , linux-media@vger.kernel.org Cc: Dave Stevenson Subject: [PATCH 1/3] media: i2c: ov9282: Fix missing documentation in structures Date: Mon, 28 Nov 2022 16:22:47 +0000 Message-Id: <20221128162249.536455-2-dave.stevenson@raspberrypi.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221128162249.536455-1-dave.stevenson@raspberrypi.com> References: <20221128162249.536455-1-dave.stevenson@raspberrypi.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Fix missing documentation entries for members of structures, as flagged by smatch. Signed-off-by: Dave Stevenson --- drivers/media/i2c/ov9282.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/media/i2c/ov9282.c b/drivers/media/i2c/ov9282.c index 4ee93daa23c6..a8ab523b6a40 100644 --- a/drivers/media/i2c/ov9282.c +++ b/drivers/media/i2c/ov9282.c @@ -130,6 +130,7 @@ struct ov9282_reg_list { * @vblank_min: Minimum vertical blanking in lines * @vblank_max: Maximum vertical blanking in lines * @link_freq_idx: Link frequency index + * @crop: on-sensor cropping for this mode * @reg_list: Register list for sensor mode */ struct ov9282_mode { @@ -152,13 +153,16 @@ struct ov9282_mode { * @pad: Media pad. Only one pad supported * @reset_gpio: Sensor reset gpio * @inclk: Sensor input clock + * @supplies: Regulator supplies for the sensor * @ctrl_handler: V4L2 control handler * @link_freq_ctrl: Pointer to link frequency control * @hblank_ctrl: Pointer to horizontal blanking control * @vblank_ctrl: Pointer to vertical blanking control * @exp_ctrl: Pointer to exposure control * @again_ctrl: Pointer to analog gain control + * @pixel_rate: Pointer to pixel rate control * @vblank: Vertical blanking in lines + * @noncontinuous_clock: Selection of CSI2 noncontinuous clock mode * @cur_mode: Pointer to current selected sensor mode * @code: Mbus code currently selected * @mutex: Mutex for serializing sensor controls From patchwork Mon Nov 28 16:22:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Stevenson X-Patchwork-Id: 13057788 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4ECFFC4332F for ; Mon, 28 Nov 2022 16:23:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232710AbiK1QX0 (ORCPT ); Mon, 28 Nov 2022 11:23:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232784AbiK1QXI (ORCPT ); Mon, 28 Nov 2022 11:23:08 -0500 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B231F24BE0 for ; Mon, 28 Nov 2022 08:23:07 -0800 (PST) Received: by mail-wr1-x42b.google.com with SMTP id w15so4507316wrl.9 for ; Mon, 28 Nov 2022 08:23:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=749XWNr6EDOp8iDC5ndqhi3eCGvYPunM7bPdHtc3/hU=; b=j3nbDv0oaOu0nVyXHNwU2cKcw+aKBEVxavDRHfoXAIXM22ynze4kgey+RQTq9mluiT i2oZOCgWEBkT5duT9VBXkN5HoV+fjZhsJFtM17vTMUDM+0REuiNbysMJLWAmy/bU/7Cm JY+zD1IrLvoUDbkIu8i7XB2ZTRw0CDu/vW7u80lIRo82unOt9B9tk1YhCmZxaQ567Igm NPVJ6OlpaElj3Ir0eKYEPsz09RUyUZdL9TBTYMnOyheS+cFJMfzmxa8cL29a+nJjzt3c 7sW7Ow6RA3dSKZfzgmtfRlzkO2VFbBjYGV3wYA3sIS0OwA/9nRLLbkhtAcllp5Pl+FDR 5T1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=749XWNr6EDOp8iDC5ndqhi3eCGvYPunM7bPdHtc3/hU=; b=cMUrANtNiNNJAsutl5o9xcJCiXyUCFnDUuDg6+gADGiOmtDvxZNrDt0+o3sxjBQYA1 YVxflF0aizTLiBylVVa6oS/ifj3+hEmLq3yrLsAaUMOlFWf/6bn9eqclJvxFd6QG8DMj FzdZYWLkiWFQ/0Cn1tnHQKlHaZ+JpqjZuZNFEdlu0k/6Ud2ksFM+9u0kYBgMUIKsEqS7 G2xg8qn5R1ABWFoFKCqYnHCTAFAfdu/jRBl2xgjjdp8kN6H+WAX0ErTTYMgJAiD+Q7V4 OjwuqHzQLCsfdFQrBT7YE+sTIJRs8d0xFuO7W+X37tp4rrMtAArTBqEnIfGADuwZOGcR +EbA== X-Gm-Message-State: ANoB5pmbtcjGl1EMQpiJ7gjRo2wO3QttQCGbEe1canrk8EV2nxeuXfSn 0MZQEyT1AWh1EOg8euPUAUk6IA== X-Google-Smtp-Source: AA0mqf6C/cYQwkOTHhd7pGLOj9Ezzh+nLgzjIuAlomI2/vDtwtmwJYb3xkZAqNQeD1tNoYfpmmckHg== X-Received: by 2002:a05:6000:12cb:b0:236:62e3:6202 with SMTP id l11-20020a05600012cb00b0023662e36202mr31893963wrx.47.1669652586278; Mon, 28 Nov 2022 08:23:06 -0800 (PST) Received: from dave-Ubuntu2204.pitowers.org ([93.93.133.154]) by smtp.googlemail.com with ESMTPSA id o15-20020a5d474f000000b002421a8f4fa6sm2353530wrs.92.2022.11.28.08.23.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Nov 2022 08:23:05 -0800 (PST) From: Dave Stevenson To: "Paul J. Murphy" , Daniele Alessandrelli , Sakari Ailus , linux-media@vger.kernel.org Cc: Dave Stevenson Subject: [PATCH 2/3] media: i2c: ov9282: Make common_regs_list static Date: Mon, 28 Nov 2022 16:22:48 +0000 Message-Id: <20221128162249.536455-3-dave.stevenson@raspberrypi.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221128162249.536455-1-dave.stevenson@raspberrypi.com> References: <20221128162249.536455-1-dave.stevenson@raspberrypi.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org common_regs_list is only used within this file, so should be static. Make it so. Fixes: 7195aabf8f8b ("media: i2c: ov9282: Split registers into common and mode specific") Signed-off-by: Dave Stevenson --- drivers/media/i2c/ov9282.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/ov9282.c b/drivers/media/i2c/ov9282.c index a8ab523b6a40..94e18da55a05 100644 --- a/drivers/media/i2c/ov9282.c +++ b/drivers/media/i2c/ov9282.c @@ -268,7 +268,7 @@ static const struct ov9282_reg common_regs[] = { {0x5a08, 0x84}, }; -struct ov9282_reg_list common_regs_list = { +static struct ov9282_reg_list common_regs_list = { .num_of_regs = ARRAY_SIZE(common_regs), .regs = common_regs, }; From patchwork Mon Nov 28 16:22:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Stevenson X-Patchwork-Id: 13057789 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 376F4C4332F for ; Mon, 28 Nov 2022 16:23:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232740AbiK1QX3 (ORCPT ); Mon, 28 Nov 2022 11:23:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232711AbiK1QXK (ORCPT ); Mon, 28 Nov 2022 11:23:10 -0500 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 528E024BF1 for ; Mon, 28 Nov 2022 08:23:09 -0800 (PST) Received: by mail-wr1-x42b.google.com with SMTP id q7so16816903wrr.8 for ; Mon, 28 Nov 2022 08:23:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=K9Tv/pFhgevsl9Hu0zmbLfmBjTOF9KQSurh2+NHp5DA=; b=ADOctLLB3qfGtoFM1BsNGENK9Ly6U59mumtdiZ02DMG29xoJvxKqlN+ScwX5+0e3VL byk1QpmBeKrn4UmbzFbr2CL7+wWPTFkb4JLjFX8BNkfGrhaJq6eHEqMfkHYw1/fkRkSj An2ejdawPoflAUonkRhqXOwoqqYQfXt/DwdntM4ll4GBN6WHFr1zW4RBLAoGos2GyPaA wdue8sTpNNP8nsHFOiTEk7OqiK5518HAbRpoisZH0UJElnI4H3P2GcygYfhv26pfY0Qd sVOubjbjgym92WuwHlQ/8sTbSu7tP5Fndo8UzBw13SQKAPLQwjWmZ59yt03f7RXt+mIc WiJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=K9Tv/pFhgevsl9Hu0zmbLfmBjTOF9KQSurh2+NHp5DA=; b=ISxBccxyKTyaGfXve+PfviPRljoVEu2ThBBgcx60PDGF1TbOK6tf2SnUVcsRueFvnp 6ip91KbmGKuvPbQMKmctXD2SYSbYKHNk+E419pCuwEod/GKZERhuxIRkAnvINZlyY/VJ ieQtiPYOHKXnWs/zSDeewhRzMSNDKMLB7Z0E5TNvZk4EK1EV1BSWnGSENlwLbLzjqkLZ dqhQakMcmjLCpX/EwfPk09FXmXbC7TotsTjECIn0OigritXCbu4Q4nTsAlKb+rtVWd3Q wlbpuaYQ1FKdkG6C6zj04tW2m4ZLwnw6WUSAaFosfRJFS+Um6mokqXAvM9PC1MsXtxTJ hh2A== X-Gm-Message-State: ANoB5pnE+akbDQP+YoTSCgTO5YTWMGngZEJb8pRaaI5VN6ByZTL0pmKz Bb4MaKB1LtdGSlnjhtVAaKoXEw== X-Google-Smtp-Source: AA0mqf7Caw79R6fuhS0qnP0ccrEdqzES2mHAOZ8dHT6+bfLnEsYtMIGEct43HJAVA0NKtbZP3jwR7A== X-Received: by 2002:a5d:4946:0:b0:241:f7b9:7c05 with SMTP id r6-20020a5d4946000000b00241f7b97c05mr14792231wrs.528.1669652587893; Mon, 28 Nov 2022 08:23:07 -0800 (PST) Received: from dave-Ubuntu2204.pitowers.org ([93.93.133.154]) by smtp.googlemail.com with ESMTPSA id o15-20020a5d474f000000b002421a8f4fa6sm2353530wrs.92.2022.11.28.08.23.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Nov 2022 08:23:07 -0800 (PST) From: Dave Stevenson To: "Paul J. Murphy" , Daniele Alessandrelli , Sakari Ailus , linux-media@vger.kernel.org Cc: Dave Stevenson Subject: [PATCH 3/3] media: i2c: ov9282: Add missing clk_disable_unprepare to error path Date: Mon, 28 Nov 2022 16:22:49 +0000 Message-Id: <20221128162249.536455-4-dave.stevenson@raspberrypi.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221128162249.536455-1-dave.stevenson@raspberrypi.com> References: <20221128162249.536455-1-dave.stevenson@raspberrypi.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org If ov9282_power_on failed the I2C write, it returned without releasing clocks or regulators. Fix this. Fixes: 6f7def3d8a65 ("media: i2c: ov9282: Add selection for CSI2 clock mode") Signed-off-by: Dave Stevenson --- drivers/media/i2c/ov9282.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/ov9282.c b/drivers/media/i2c/ov9282.c index 94e18da55a05..38b8d33799d5 100644 --- a/drivers/media/i2c/ov9282.c +++ b/drivers/media/i2c/ov9282.c @@ -1253,11 +1253,13 @@ static int ov9282_power_on(struct device *dev) OV9282_GATED_CLOCK : 0); if (ret) { dev_err(ov9282->dev, "fail to write MIPI_CTRL00"); - return ret; + goto error_clk; } return 0; +error_clk: + clk_disable_unprepare(ov9282->inclk); error_reset: gpiod_set_value_cansleep(ov9282->reset_gpio, 0);