From patchwork Mon Jun 27 15:04:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tommaso Merciai X-Patchwork-Id: 12896737 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 EB0E0C433EF for ; Mon, 27 Jun 2022 15:05:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237605AbiF0PFC (ORCPT ); Mon, 27 Jun 2022 11:05:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237475AbiF0PFB (ORCPT ); Mon, 27 Jun 2022 11:05:01 -0400 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 734EB17584 for ; Mon, 27 Jun 2022 08:04:59 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id e28so8322052wra.0 for ; Mon, 27 Jun 2022 08:04:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rpdfidpXpaazosoDOCbj0RBJV66iHVFwcJEcEN756BA=; b=HSNeFexte5YkNrSfmpa24bzpLSXiYVRqoRKgeLPFcCWAvFPnSgrKiQA4645Db6YcDV yKY2H+NIK0Yu7fS7aY00WqUc79oeuRg2g2YBRK3zu2E9cePfSRHr5FuecOL0EaoqwyQJ R38CdPHI63ndISKRhryCUirI/1ZO7jft5dQEg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rpdfidpXpaazosoDOCbj0RBJV66iHVFwcJEcEN756BA=; b=PMf9JKMAQXXWvPHwjB+GzgKyDWtvQxHcpliN2zn1zcIzzgkOtBCXgt51NpO2lqSbZ0 FTX9lkpZGuodMJkpIpNoEagf42zHnybGMQ9iohudGM/fBEoruaKI2UhgNDbkiYHIXv3y fo0AzphPg1hkoet80w1kKIUBMZ1gr0WeMrjneqNng+elR3emdE3+dTVM01d36kRhgLbg gBJaX0QtyUu16iIBwl8U0wtnUl1VAX7zUL5UCpbYhD6u5vM35QEtM8DjE5QIOIr3uaKa 6OsC9KARwqjfg7wCIOrix1Hiy340QrXZXV1g5lgDHL7O2FnTLrj5eXJ8bjfipF1++l2p YEAg== X-Gm-Message-State: AJIora8e9IasE1NKYkSf9yleIo/dew4PLBSt3ajUdSLG0thknCg4ugDh 8ihN7EoC84W2zfCkSYuhFREJsA== X-Google-Smtp-Source: AGRyM1ugjMfso+GuSpxwGlBX35ok7y0Cmr7FXEAySzs+qOBy37hvkpgpQ9Zblc9e7HrHHRK7lQqhvg== X-Received: by 2002:a05:6000:1689:b0:218:3fb1:fd30 with SMTP id y9-20020a056000168900b002183fb1fd30mr12607196wrd.302.1656342298051; Mon, 27 Jun 2022 08:04:58 -0700 (PDT) Received: from tom-ThinkPad-T14s-Gen-2i.station (net-188-217-58-216.cust.vodafonedsl.it. [188.217.58.216]) by smtp.gmail.com with ESMTPSA id d18-20020adfe852000000b0021ba3d1f2a0sm10581250wrn.48.2022.06.27.08.04.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jun 2022 08:04:57 -0700 (PDT) From: Tommaso Merciai Cc: linuxfancy@googlegroups.com, linux-amarula@amarulasolutions.com, quentin.schulz@theobroma-systems.com, Tommaso Merciai , Daniel Scally , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/7] media: ov5693: count num_supplies using array_size Date: Mon, 27 Jun 2022 17:04:47 +0200 Message-Id: <20220627150453.220292-2-tommaso.merciai@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220627150453.220292-1-tommaso.merciai@amarulasolutions.com> References: <20220627150453.220292-1-tommaso.merciai@amarulasolutions.com> MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Instead of hardcode OV5693_NUM_SUPPLIES in a define is better use ARRAY_SIZE function to count the number of supplies from ov5693_supply_names array Signed-off-by: Tommaso Merciai Reviewed-by: Jacopo Mondi --- drivers/media/i2c/ov5693.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/media/i2c/ov5693.c b/drivers/media/i2c/ov5693.c index 117ff5403312..f410333c4c67 100644 --- a/drivers/media/i2c/ov5693.c +++ b/drivers/media/i2c/ov5693.c @@ -127,11 +127,15 @@ #define OV5693_LINK_FREQ_419_2MHZ 419200000 #define OV5693_PIXEL_RATE 167680000 -/* Miscellaneous */ -#define OV5693_NUM_SUPPLIES 2 - #define to_ov5693_sensor(x) container_of(x, struct ov5693_device, sd) +static const char * const ov5693_supply_names[] = { + "avdd", /* Analog power */ + "dovdd", /* Digital I/O power */ +}; + +#define OV5693_NUM_SUPPLIES ARRAY_SIZE(ov5693_supply_names) + struct ov5693_reg { u32 reg; u8 val; @@ -352,11 +356,6 @@ static const s64 link_freq_menu_items[] = { OV5693_LINK_FREQ_419_2MHZ }; -static const char * const ov5693_supply_names[] = { - "avdd", - "dovdd", -}; - static const char * const ov5693_test_pattern_menu[] = { "Disabled", "Random Data", From patchwork Mon Jun 27 15:04:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tommaso Merciai X-Patchwork-Id: 12896738 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 A9B6AC433EF for ; Mon, 27 Jun 2022 15:05:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237626AbiF0PFG (ORCPT ); Mon, 27 Jun 2022 11:05:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236422AbiF0PFC (ORCPT ); Mon, 27 Jun 2022 11:05:02 -0400 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C3E917592 for ; Mon, 27 Jun 2022 08:05:01 -0700 (PDT) Received: by mail-wr1-x42e.google.com with SMTP id k22so13489369wrd.6 for ; Mon, 27 Jun 2022 08:05:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pGYlZSXrL+oaB0Q/zXs3LZ4NFxxmWuNHZP0D34FWGxY=; b=aVcPlY/e/m99y/qGbVvDjDSjv/2ydjwyEBwpEtzTxs+DDF8/2tInE4vWkkQs47wIkw Bp+GvBBrcJx8/tQaaHMaUaJpsQSQHNffH45vGnobt7SlC0tAfLVXCtmEUahLfiSTl91l ZnKd2OMdOSYA0L5ZWwedTNeQvtlZrkxFhz9Xc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pGYlZSXrL+oaB0Q/zXs3LZ4NFxxmWuNHZP0D34FWGxY=; b=RcrCSHpwNBNuCjMXGGymxqhB8+VKbDORONBYdjdoCpwmJlrypqOqO/+WoTHv1b+moz hYRkRyxZwcWAyR7VIPFbfhe4Yv17mbW5dB8Y+gb0eFdOr/A0nK00IQ+092cgcmVPRfGL /N8vIOtlkGBc+ayiAkcXrw2AZgRbkYR3OMhFyemzsynWkE/oSuEdYPBocvJhQb/v9GEd T+jya0HATQG7ydA0R8LoMDr51H/HUQK5uHpkR14chSW2l4KzUdVDvxm0M0WlHNvVRr/j 4EKv5Xy3xPnRL/fAyDgJ2he6EtUNsx7Dx0z4En1fS96+aCeF6sOSXvnQS96Ue1LgBGb8 Wmcg== X-Gm-Message-State: AJIora9k07WPceai4Fe24I7hODEfzdj7/6zhIeKP5KBreifZUM5HW7Kb ZX6u9ZZ21XUAV0k6hQLV05fWew== X-Google-Smtp-Source: AGRyM1td5t3N3MSQv0AhcCYUAv+rIMiCvLzazaY2pmGLkqXdPiWEzt+KjuCMWt7OvTaWIsVO1dteLg== X-Received: by 2002:a05:6000:186e:b0:21b:c44a:7ab9 with SMTP id d14-20020a056000186e00b0021bc44a7ab9mr9873638wri.336.1656342299749; Mon, 27 Jun 2022 08:04:59 -0700 (PDT) Received: from tom-ThinkPad-T14s-Gen-2i.station (net-188-217-58-216.cust.vodafonedsl.it. [188.217.58.216]) by smtp.gmail.com with ESMTPSA id d18-20020adfe852000000b0021ba3d1f2a0sm10581250wrn.48.2022.06.27.08.04.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jun 2022 08:04:59 -0700 (PDT) From: Tommaso Merciai Cc: linuxfancy@googlegroups.com, linux-amarula@amarulasolutions.com, quentin.schulz@theobroma-systems.com, Tommaso Merciai , Daniel Scally , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/7] media: ov5693: add dvdd into ov5693_supply_names array Date: Mon, 27 Jun 2022 17:04:48 +0200 Message-Id: <20220627150453.220292-3-tommaso.merciai@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220627150453.220292-1-tommaso.merciai@amarulasolutions.com> References: <20220627150453.220292-1-tommaso.merciai@amarulasolutions.com> MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Add missing "dvdd" (Digital circuit power) entry into ov5693_supply_names array Signed-off-by: Tommaso Merciai Reviewed-by: Jacopo Mondi --- drivers/media/i2c/ov5693.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/i2c/ov5693.c b/drivers/media/i2c/ov5693.c index f410333c4c67..9e84468d920e 100644 --- a/drivers/media/i2c/ov5693.c +++ b/drivers/media/i2c/ov5693.c @@ -132,6 +132,7 @@ static const char * const ov5693_supply_names[] = { "avdd", /* Analog power */ "dovdd", /* Digital I/O power */ + "dvdd", /* Digital circuit power */ }; #define OV5693_NUM_SUPPLIES ARRAY_SIZE(ov5693_supply_names) From patchwork Mon Jun 27 15:04:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tommaso Merciai X-Patchwork-Id: 12896740 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 784F9C43334 for ; Mon, 27 Jun 2022 15:05:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237667AbiF0PFL (ORCPT ); Mon, 27 Jun 2022 11:05:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237612AbiF0PFE (ORCPT ); Mon, 27 Jun 2022 11:05:04 -0400 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE1C117584 for ; Mon, 27 Jun 2022 08:05:02 -0700 (PDT) Received: by mail-wm1-x334.google.com with SMTP id o19-20020a05600c4fd300b003a0489f414cso2282277wmq.4 for ; Mon, 27 Jun 2022 08:05:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=l2qHBG28ZF/0BqgZtfUZ2wwyoD54f6fad9bi6YF6qP8=; b=KkiLJR+dI/sfPPQ2s1lOQsqvvaQpAmiK08gsGDaD57ph/EMv5+h9GmRBeL8UEl/18+ ou22mjauhcxTNohAl3306Hb6yBAONh50aZiBb1VyWgF89BO6v480wSJUML9ym+h4Q7LC y3wM9rytEgubnTsw8dXfS34e8QVJAGGhoIDBc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=l2qHBG28ZF/0BqgZtfUZ2wwyoD54f6fad9bi6YF6qP8=; b=GWrctB9DF52K50K7ZM9q1AHM3BR00M//4M1ixoURMmbxqP8qOcf0+sCXh7kDoc7w/h 8L2H5+/zLjoYGFDsjIMQpsZOlN6C7PvstenBMIa8xbIKPDpbpQ01b+4c7L2JEaOOagp1 izL9wT5HujZe9Qt35p/Aa6Z7eVm4xd5T5PmGeABoxZFqjtdjgCJ0s/BwLFVI/0Ul3vk/ NoVMB7wHUH6Y/e7k9/VCPwTYGqrT3vbARCpzr/KE8+PduHblzC+gpbSLYOwQ/WTkfO77 HsqLxUm155byHNACPWoLhxovLF5XmZ1jy2g/cwkP7VY+BSTnMicPJR6/7mF4kS6kTHCJ mzLA== X-Gm-Message-State: AJIora9MpEzWWt5WpP7ocA+rfL99H0kspad1N47JI8mUclid5hnrOsh+ l92NQoq6H18FQSAfEzz5gOA9fQ== X-Google-Smtp-Source: AGRyM1uwQ/ftXCRReEPvQMOgtnMF2kmKx/Ogtd60o8TWs0K0is1A9sFNDATuAMoABM9niMGGVZZ5/Q== X-Received: by 2002:a05:600c:a03:b0:39e:4f0c:938c with SMTP id z3-20020a05600c0a0300b0039e4f0c938cmr15384218wmp.145.1656342301269; Mon, 27 Jun 2022 08:05:01 -0700 (PDT) Received: from tom-ThinkPad-T14s-Gen-2i.station (net-188-217-58-216.cust.vodafonedsl.it. [188.217.58.216]) by smtp.gmail.com with ESMTPSA id d18-20020adfe852000000b0021ba3d1f2a0sm10581250wrn.48.2022.06.27.08.05.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jun 2022 08:05:00 -0700 (PDT) From: Tommaso Merciai Cc: linuxfancy@googlegroups.com, linux-amarula@amarulasolutions.com, quentin.schulz@theobroma-systems.com, Tommaso Merciai , Daniel Scally , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/7] media: ov5693: rename clk into xvclk Date: Mon, 27 Jun 2022 17:04:49 +0200 Message-Id: <20220627150453.220292-4-tommaso.merciai@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220627150453.220292-1-tommaso.merciai@amarulasolutions.com> References: <20220627150453.220292-1-tommaso.merciai@amarulasolutions.com> MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Rename clk pdata pointer into xvclk (system clock input). Same for clk_rate into xvclk_rate. This is more explicit Signed-off-by: Tommaso Merciai Reviewed-by: Jacopo Mondi --- drivers/media/i2c/ov5693.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/media/i2c/ov5693.c b/drivers/media/i2c/ov5693.c index 9e84468d920e..d2adc5513a21 100644 --- a/drivers/media/i2c/ov5693.c +++ b/drivers/media/i2c/ov5693.c @@ -157,7 +157,7 @@ struct ov5693_device { struct gpio_desc *reset; struct gpio_desc *powerdown; struct regulator_bulk_data supplies[OV5693_NUM_SUPPLIES]; - struct clk *clk; + struct clk *xvclk; struct ov5693_mode { struct v4l2_rect crop; @@ -794,7 +794,7 @@ static void ov5693_sensor_powerdown(struct ov5693_device *ov5693) regulator_bulk_disable(OV5693_NUM_SUPPLIES, ov5693->supplies); - clk_disable_unprepare(ov5693->clk); + clk_disable_unprepare(ov5693->xvclk); } static int ov5693_sensor_powerup(struct ov5693_device *ov5693) @@ -804,7 +804,7 @@ static int ov5693_sensor_powerup(struct ov5693_device *ov5693) gpiod_set_value_cansleep(ov5693->reset, 1); gpiod_set_value_cansleep(ov5693->powerdown, 1); - ret = clk_prepare_enable(ov5693->clk); + ret = clk_prepare_enable(ov5693->xvclk); if (ret) { dev_err(ov5693->dev, "Failed to enable clk\n"); goto fail_power; @@ -1390,7 +1390,7 @@ static int ov5693_check_hwcfg(struct ov5693_device *ov5693) static int ov5693_probe(struct i2c_client *client) { struct ov5693_device *ov5693; - u32 clk_rate; + u32 xvclk_rate; int ret = 0; ov5693 = devm_kzalloc(&client->dev, sizeof(*ov5693), GFP_KERNEL); @@ -1408,16 +1408,16 @@ static int ov5693_probe(struct i2c_client *client) v4l2_i2c_subdev_init(&ov5693->sd, client, &ov5693_ops); - ov5693->clk = devm_clk_get(&client->dev, "xvclk"); - if (IS_ERR(ov5693->clk)) { + ov5693->xvclk = devm_clk_get(&client->dev, "xvclk"); + if (IS_ERR(ov5693->xvclk)) { dev_err(&client->dev, "Error getting clock\n"); - return PTR_ERR(ov5693->clk); + return PTR_ERR(ov5693->xvclk); } - clk_rate = clk_get_rate(ov5693->clk); - if (clk_rate != OV5693_XVCLK_FREQ) + xvclk_rate = clk_get_rate(ov5693->xvclk); + if (xvclk_rate != OV5693_XVCLK_FREQ) dev_warn(&client->dev, "Found clk freq %u, expected %u\n", - clk_rate, OV5693_XVCLK_FREQ); + xvclk_rate, OV5693_XVCLK_FREQ); ret = ov5693_configure_gpios(ov5693); if (ret) From patchwork Mon Jun 27 15:04:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tommaso Merciai X-Patchwork-Id: 12896739 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 AE888C43334 for ; Mon, 27 Jun 2022 15:05:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237657AbiF0PFK (ORCPT ); Mon, 27 Jun 2022 11:05:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237622AbiF0PFG (ORCPT ); Mon, 27 Jun 2022 11:05:06 -0400 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48BB9175A8 for ; Mon, 27 Jun 2022 08:05:04 -0700 (PDT) Received: by mail-wm1-x330.google.com with SMTP id u12-20020a05600c210c00b003a02b16d2b8so5830402wml.2 for ; Mon, 27 Jun 2022 08:05:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AtZ/cIs6lq2eirM771Yk+JBARQCD5B0BoigyCmO2Az8=; b=cYYMdAf40LUhOh7aaAKdxOLc6v6PoFzaMIr+tICiSbNkwVafTgkoUcfaoSzLta9hmH rWYQYcRTFxjvADGbSecgiSpKYbzd7Nrkz4aYfCCVN6oDub9+Vg3QVJjsBeWUjSdu7agP bd+4EHj4NQqUPn45kXSfmUA32xlIEwvmq3Jds= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AtZ/cIs6lq2eirM771Yk+JBARQCD5B0BoigyCmO2Az8=; b=eKYSt6tSSsigTBdepiLnvA3FTzpU3fzuju7S1PtRaFZJDeO+I/IbwIIacV4QUjAQfv s7Cxl4PnjbBJPwcJPgMi/2aXCUwEOZJ907f3aZYMQAKK27pQy6PQP7AZpgxJti4yijJ0 NG1ZPCGHkxFOVJQ9+ipPVGWyBXaQFKioSbxKTAppD4Pou5OTKqfUI3fUD8BXbuH0jEqd 0Hdxph6S+izYp4xNgqvMRK2/noN8HLg6Ig8L96ux0/cDvOpYokXaRskSnFxJS6/kOfXq qiPjPbiJ/m4hNlJNBgYXMTcuDMGS43/LQ4IGF9kxgz/n9zHCVZ7azjuJgDUCyfRDlfQn h0IA== X-Gm-Message-State: AJIora/G0klxexMZwld8JRSY5n9pROGIXtDgtCmI9Ab8iD3Yk9cT/4O0 Sn+K43vGfFnROQvGqKPBgB+IKQ== X-Google-Smtp-Source: AGRyM1vJbFEzPVvR33i2qVveTyf/wUdKYArUHghQcAkmLddHCcDSR6go3aK+gcQnU374q+pmCYj+1w== X-Received: by 2002:a05:600c:4f54:b0:3a0:4a5b:2692 with SMTP id m20-20020a05600c4f5400b003a04a5b2692mr6413740wmq.109.1656342302744; Mon, 27 Jun 2022 08:05:02 -0700 (PDT) Received: from tom-ThinkPad-T14s-Gen-2i.station (net-188-217-58-216.cust.vodafonedsl.it. [188.217.58.216]) by smtp.gmail.com with ESMTPSA id d18-20020adfe852000000b0021ba3d1f2a0sm10581250wrn.48.2022.06.27.08.05.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jun 2022 08:05:02 -0700 (PDT) From: Tommaso Merciai Cc: linuxfancy@googlegroups.com, linux-amarula@amarulasolutions.com, quentin.schulz@theobroma-systems.com, Tommaso Merciai , Daniel Scally , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 4/7] media: ov5693: move hw cfg functions into ov5693_check_hwcfg Date: Mon, 27 Jun 2022 17:04:50 +0200 Message-Id: <20220627150453.220292-5-tommaso.merciai@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220627150453.220292-1-tommaso.merciai@amarulasolutions.com> References: <20220627150453.220292-1-tommaso.merciai@amarulasolutions.com> MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Move hw configuration functions into ov5693_check_hwcfg. This is done to separe the code that handle the hw cfg from probe in a clean way Signed-off-by: Tommaso Merciai --- drivers/media/i2c/ov5693.c | 53 +++++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 21 deletions(-) diff --git a/drivers/media/i2c/ov5693.c b/drivers/media/i2c/ov5693.c index d2adc5513a21..d5a934ace597 100644 --- a/drivers/media/i2c/ov5693.c +++ b/drivers/media/i2c/ov5693.c @@ -1348,6 +1348,38 @@ static int ov5693_check_hwcfg(struct ov5693_device *ov5693) struct fwnode_handle *endpoint; unsigned int i; int ret; + u32 xvclk_rate; + + ov5693->xvclk = devm_clk_get(ov5693->dev, "xvclk"); + if (IS_ERR(ov5693->xvclk)) + return dev_err_probe(ov5693->dev, PTR_ERR(ov5693->xvclk), + "failed to get xvclk: %ld\n", + PTR_ERR(ov5693->xvclk)); + + if (ov5693->xvclk) { + xvclk_rate = clk_get_rate(ov5693->xvclk); + } else { + ret = fwnode_property_read_u32(fwnode, "clock-frequency", + &xvclk_rate); + + if (ret) { + dev_err(ov5693->dev, "can't get clock frequency"); + return ret; + } + } + + if (xvclk_rate != OV5693_XVCLK_FREQ) + dev_warn(ov5693->dev, "Found clk freq %u, expected %u\n", + xvclk_rate, OV5693_XVCLK_FREQ); + + ret = ov5693_configure_gpios(ov5693); + if (ret) + return ret; + + ret = ov5693_get_regulators(ov5693); + if (ret) + return dev_err_probe(ov5693->dev, ret, + "Error fetching regulators\n"); endpoint = fwnode_graph_get_next_endpoint(fwnode, NULL); if (!endpoint) @@ -1390,7 +1422,6 @@ static int ov5693_check_hwcfg(struct ov5693_device *ov5693) static int ov5693_probe(struct i2c_client *client) { struct ov5693_device *ov5693; - u32 xvclk_rate; int ret = 0; ov5693 = devm_kzalloc(&client->dev, sizeof(*ov5693), GFP_KERNEL); @@ -1408,26 +1439,6 @@ static int ov5693_probe(struct i2c_client *client) v4l2_i2c_subdev_init(&ov5693->sd, client, &ov5693_ops); - ov5693->xvclk = devm_clk_get(&client->dev, "xvclk"); - if (IS_ERR(ov5693->xvclk)) { - dev_err(&client->dev, "Error getting clock\n"); - return PTR_ERR(ov5693->xvclk); - } - - xvclk_rate = clk_get_rate(ov5693->xvclk); - if (xvclk_rate != OV5693_XVCLK_FREQ) - dev_warn(&client->dev, "Found clk freq %u, expected %u\n", - xvclk_rate, OV5693_XVCLK_FREQ); - - ret = ov5693_configure_gpios(ov5693); - if (ret) - return ret; - - ret = ov5693_get_regulators(ov5693); - if (ret) - return dev_err_probe(&client->dev, ret, - "Error fetching regulators\n"); - ov5693->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; ov5693->pad.flags = MEDIA_PAD_FL_SOURCE; ov5693->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR; From patchwork Mon Jun 27 15:04:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tommaso Merciai X-Patchwork-Id: 12896741 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 3D720C433EF for ; Mon, 27 Jun 2022 15:05:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237623AbiF0PFP (ORCPT ); Mon, 27 Jun 2022 11:05:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237563AbiF0PFJ (ORCPT ); Mon, 27 Jun 2022 11:05:09 -0400 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF7F217A85 for ; Mon, 27 Jun 2022 08:05:05 -0700 (PDT) Received: by mail-wm1-x336.google.com with SMTP id r81-20020a1c4454000000b003a0297a61ddso6237271wma.2 for ; Mon, 27 Jun 2022 08:05:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mbhraybs4BrIz6d4796cwXXFW6lfNPQ37w8o2Zpee1o=; b=KupZZ+sarY3guqQXY2ptFD5NlYKfyYBs2ZTgqZ0qkyAc7wHfgowtz1NZmiJdEnK+wo n1x4HvtvDNXbDaaHIfajhHX2qAR/vhf5P44qF9fLXEjvmB2olv9CHMsGOToomOpgv6kS AyNKEk/UWWE1IkxXRE2nAUpJtMUklGWeZx35I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mbhraybs4BrIz6d4796cwXXFW6lfNPQ37w8o2Zpee1o=; b=l9mfk5WXngMH+fvI0GP5it51yke+m/Myqn2U5DifyRhz8BsZNY+FkXK3ghfS3cCADo /YjZ42gKaE61ouDtMRI66aUshhfOHitaGfIZTAk4gByxHBfN+QYZaXE989Q/D548RNw3 iuhY+aEMfhNsQaKmfFvTsAxhMq/JFmAq/BhYXKmZvHsLQEioHSXn4F3jPC0rc18u4GCq NbY3goc2Axi7BHcv+9N/B0Hwdp6fDhuOgl21S0ZeJVEZ+YOlJtsSNWukk+GVef2ISr3j 86jVmRdAYsiCskEtqg0YWxhwQFLthivJdisZlma6050OVI/3ng0SDM4nlmxwjRYuC25E eSWg== X-Gm-Message-State: AJIora8QyGBZ+eDex7Wl/bNICg3tPQiHP3eN5U70OnTECNIo2di/1WhB KJn7B19S+UtinVSLBkBvi5MBvQ== X-Google-Smtp-Source: AGRyM1v+UVG8BbbMwMvAW42KVwxZzoiPd+lqZKHuXK/Mx/9tVTy1Cb9XbuPSeO1lJZzpIbjguIVojw== X-Received: by 2002:a05:600c:228c:b0:3a0:43ee:d88b with SMTP id 12-20020a05600c228c00b003a043eed88bmr13081363wmf.135.1656342304223; Mon, 27 Jun 2022 08:05:04 -0700 (PDT) Received: from tom-ThinkPad-T14s-Gen-2i.station (net-188-217-58-216.cust.vodafonedsl.it. [188.217.58.216]) by smtp.gmail.com with ESMTPSA id d18-20020adfe852000000b0021ba3d1f2a0sm10581250wrn.48.2022.06.27.08.05.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jun 2022 08:05:03 -0700 (PDT) From: Tommaso Merciai Cc: linuxfancy@googlegroups.com, linux-amarula@amarulasolutions.com, quentin.schulz@theobroma-systems.com, Tommaso Merciai , Daniel Scally , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 5/7] media: ov5693: rename ov5693_check_hwcfg into ov5693_get_hwcfg Date: Mon, 27 Jun 2022 17:04:51 +0200 Message-Id: <20220627150453.220292-6-tommaso.merciai@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220627150453.220292-1-tommaso.merciai@amarulasolutions.com> References: <20220627150453.220292-1-tommaso.merciai@amarulasolutions.com> MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Function ov5693_check_hwcfg don't only check the hw configuration but also get the hw configuration. Is better better to rename this into ov5693_get_hwcfg Signed-off-by: Tommaso Merciai Reviewed-by: Jacopo Mondi --- drivers/media/i2c/ov5693.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/ov5693.c b/drivers/media/i2c/ov5693.c index d5a934ace597..273caef467fe 100644 --- a/drivers/media/i2c/ov5693.c +++ b/drivers/media/i2c/ov5693.c @@ -1339,7 +1339,7 @@ static int ov5693_get_regulators(struct ov5693_device *ov5693) ov5693->supplies); } -static int ov5693_check_hwcfg(struct ov5693_device *ov5693) +static int ov5693_get_hwcfg(struct ov5693_device *ov5693) { struct fwnode_handle *fwnode = dev_fwnode(ov5693->dev); struct v4l2_fwnode_endpoint bus_cfg = { @@ -1431,7 +1431,7 @@ static int ov5693_probe(struct i2c_client *client) ov5693->client = client; ov5693->dev = &client->dev; - ret = ov5693_check_hwcfg(ov5693); + ret = ov5693_get_hwcfg(ov5693); if (ret) return ret; From patchwork Mon Jun 27 15:04:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tommaso Merciai X-Patchwork-Id: 12896742 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 90AB7CCA473 for ; Mon, 27 Jun 2022 15:05:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237563AbiF0PFR (ORCPT ); Mon, 27 Jun 2022 11:05:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237651AbiF0PFJ (ORCPT ); Mon, 27 Jun 2022 11:05:09 -0400 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49B6D175A6 for ; Mon, 27 Jun 2022 08:05:07 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id o16-20020a05600c379000b003a02eaea815so5021328wmr.0 for ; Mon, 27 Jun 2022 08:05:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xYWlc/wQ018OwOnNA+AyeCt3Ba+fxR9sI/D7eVEieKk=; b=oIMyRqLbbNcQeDmGyzit2hoWXaACc6GAE/IMnjYVAbnHJQ6q5o/Gj7o+kOwoAz/Ach dv+JkhuPgsPBPfduG/ElG1gb9r+ZuBWDtWmTXEq86+g722shXGWd9j1CyWKgOKiNALOu JcMrRwJykwsRu9UtQGriXChqD34mkNQtWZ8Gk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xYWlc/wQ018OwOnNA+AyeCt3Ba+fxR9sI/D7eVEieKk=; b=0o8Ucwe+wTqmWeMN1/QZLdju3TP69TzzHdJABVMD2Jx3TjP8Eoydw+k1r58q7ZjRpT yMxvFkrBPS0GZQBkdYzvpVXVJsIe/zl0z7e2nDaq8EZoNibShXPM5u1qLcIGv7/Yy2Wd U5F47fU17kPlsPeM1yIJFqnNedcgZo1qK+mJ0ud88Fj3ymGqlNY2+JUmQ9W/EsPjsuOr gNABNQcqvigoeUYkaa/8u3yvcePbJxt2QkmYWk3btByIHfMcpUntWsCy4Ldt6mVFtl97 TeyhdbXYBwDaGmK1HLfKawBbLzC0kL9LBW7gW7x1wnOA29W7eEwi1WZj8fFKqC1Jak8N p/tw== X-Gm-Message-State: AJIora9gjRX1Z0ltf62VvxRrgOi+bFvdyRab6IEq7+26xBLPM9kK8GHO LxLtgsammyEhLWCKe25z3PpFnQ== X-Google-Smtp-Source: AGRyM1uZH3Ii4ouIoGJ/bAPB0LRMvYK4GIAO6xqMH2pvQRoACmD/dsL1R4X08FqzAFFRop6qXGT8kw== X-Received: by 2002:a05:600c:a18a:b0:3a0:2978:30d2 with SMTP id id10-20020a05600ca18a00b003a0297830d2mr15765046wmb.173.1656342305771; Mon, 27 Jun 2022 08:05:05 -0700 (PDT) Received: from tom-ThinkPad-T14s-Gen-2i.station (net-188-217-58-216.cust.vodafonedsl.it. [188.217.58.216]) by smtp.gmail.com with ESMTPSA id d18-20020adfe852000000b0021ba3d1f2a0sm10581250wrn.48.2022.06.27.08.05.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jun 2022 08:05:05 -0700 (PDT) From: Tommaso Merciai Cc: linuxfancy@googlegroups.com, linux-amarula@amarulasolutions.com, quentin.schulz@theobroma-systems.com, Tommaso Merciai , Dario Binacchi , Daniel Scally , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 6/7] media: ov5693: add ov5693_of_match, dts support Date: Mon, 27 Jun 2022 17:04:52 +0200 Message-Id: <20220627150453.220292-7-tommaso.merciai@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220627150453.220292-1-tommaso.merciai@amarulasolutions.com> References: <20220627150453.220292-1-tommaso.merciai@amarulasolutions.com> MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Add ov5693_of_match. Device tree support Reviewed-by: Dario Binacchi --- drivers/media/i2c/ov5693.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/media/i2c/ov5693.c b/drivers/media/i2c/ov5693.c index 273caef467fe..0854226dc140 100644 --- a/drivers/media/i2c/ov5693.c +++ b/drivers/media/i2c/ov5693.c @@ -1532,10 +1532,17 @@ static const struct acpi_device_id ov5693_acpi_match[] = { }; MODULE_DEVICE_TABLE(acpi, ov5693_acpi_match); +static const struct of_device_id ov5693_of_match[] = { + { .compatible = "ovti,ov5693", }, + { /* sentinel */ }, +}; +MODULE_DEVICE_TABLE(of, ov5693_of_match); + static struct i2c_driver ov5693_driver = { .driver = { .name = "ov5693", .acpi_match_table = ov5693_acpi_match, + .of_match_table = ov5693_of_match, .pm = &ov5693_pm_ops, }, .probe_new = ov5693_probe, From patchwork Mon Jun 27 15:04:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tommaso Merciai X-Patchwork-Id: 12896743 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 08FE0C43334 for ; Mon, 27 Jun 2022 15:05:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236690AbiF0PFS (ORCPT ); Mon, 27 Jun 2022 11:05:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237628AbiF0PFK (ORCPT ); Mon, 27 Jun 2022 11:05:10 -0400 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3660517593 for ; Mon, 27 Jun 2022 08:05:09 -0700 (PDT) Received: by mail-wm1-x336.google.com with SMTP id r81-20020a1c4454000000b003a0297a61ddso6237271wma.2 for ; Mon, 27 Jun 2022 08:05:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Q/qNchMN3fi99e0hw7FrgtY/UyQg4ox/iqGDXX9XdaQ=; b=e8qLad0cOTMs7IHvIZLMmYbi3/SfNmnY8OFnjn8+OdCKmwvED5rARJ7juYlpYdhryV 1Qr/1UuLLIvZQa87uFTclFe1u/Kx+4SuQr35WBz/ktaJFxMIl1PFEb8gxE19GeFL7qmc 4qJeqkATx+o0s1y0uUQ+WO+cmMRFM0NP8J4es= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Q/qNchMN3fi99e0hw7FrgtY/UyQg4ox/iqGDXX9XdaQ=; b=x8EAm4dvrflbP2Xk/zxDhS0QS7mHsXW3AkAqQVG03RWTLtXgquEsgiqPQ4jnCXCkRy Nh4wTJ/yFtJvu1Qzx2N2yB+KnVQwk4FzkJ4h7d7vsVVGXYjKIM0sqk3CNdV0kS9TbTq6 gy4fcN7tI/TOmjmPBdiy1FxGTveI/wpoVTOVUzaJOBo5ppwunHhSFtaxf6wRr9/gmlrq YgzX6MD/L1MBJh96OMDZ6wFM5u6Y1BdUFsbBub8PXreXWwzHolvmcsLQdNlgmTHAHtb/ xCzsIe+QYRKOu9eQzH9JAoZWvgsRiaDS540IbJ+ESO3sx78hcr9JlWrdBJylKfOFzQOd MYiQ== X-Gm-Message-State: AJIora8ls3Tm0gHPkDCd+kVDLL+FkQwnr35JWmUZLzxOsFhprwKkGc/K 7UIDkZdHcXu5DJYYMTXnUFQcNw== X-Google-Smtp-Source: AGRyM1v8O4fcCQ/hU78/LPZ5Zd2jI0PQIzJBDQS4a1F8Ic7fbDz8SQ6Nvwui6Szr+NGZwtzdowiMMg== X-Received: by 2002:a1c:2703:0:b0:3a0:2ffb:1781 with SMTP id n3-20020a1c2703000000b003a02ffb1781mr19998529wmn.146.1656342308807; Mon, 27 Jun 2022 08:05:08 -0700 (PDT) Received: from tom-ThinkPad-T14s-Gen-2i.station (net-188-217-58-216.cust.vodafonedsl.it. [188.217.58.216]) by smtp.gmail.com with ESMTPSA id d18-20020adfe852000000b0021ba3d1f2a0sm10581250wrn.48.2022.06.27.08.05.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jun 2022 08:05:08 -0700 (PDT) From: Tommaso Merciai Cc: linuxfancy@googlegroups.com, linux-amarula@amarulasolutions.com, quentin.schulz@theobroma-systems.com, Tommaso Merciai , Daniel Scally , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 7/7] media: dt-bindings: ov5693: document YAML binding Date: Mon, 27 Jun 2022 17:04:53 +0200 Message-Id: <20220627150453.220292-8-tommaso.merciai@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220627150453.220292-1-tommaso.merciai@amarulasolutions.com> References: <20220627150453.220292-1-tommaso.merciai@amarulasolutions.com> MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This patch adds documentation of device tree in YAML schema for the OV5693 CMOS image sensor from Omnivision Signed-off-by: Tommaso Merciai Reviewed-by: Krzysztof Kozlowski --- Changes since v1: - Fix allOf position as suggested by Krzysztof - Remove port description as suggested by Krzysztof - Fix EOF as suggested by Krzysztof .../bindings/media/i2c/ovti,ov5693.yaml | 108 ++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 109 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/i2c/ovti,ov5693.yaml diff --git a/Documentation/devicetree/bindings/media/i2c/ovti,ov5693.yaml b/Documentation/devicetree/bindings/media/i2c/ovti,ov5693.yaml new file mode 100644 index 000000000000..e8e2776efc08 --- /dev/null +++ b/Documentation/devicetree/bindings/media/i2c/ovti,ov5693.yaml @@ -0,0 +1,108 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +# Copyright (c) 2022 Amarulasolutions +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/i2c/ovti,ov5693.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Omnivision OV5693 CMOS Sensor + +maintainers: + - Tommaso Merciai + +description: | + The Omnivision OV5693 is a high performance, 1/4-inch, 5 megapixel, CMOS + image sensor that delivers 2592x1944 at 30fps. It provides full-frame, + sub-sampled, and windowed 10-bit MIPI images in various formats via the + Serial Camera Control Bus (SCCB) interface. + + Supports images sizes: 5 Mpixel, EIS1080p, 1080p, 720p, VGA, QVGA + + OV5693 is programmable through I2C and two-wire Serial Camera Control Bus (SCCB). + The sensor output is available via CSI-2 serial data output (up to 2-lane). + +allOf: + - $ref: /schemas/media/video-interface-devices.yaml# + +properties: + compatible: + const: ovti,ov5693 + + reg: + maxItems: 1 + + clocks: + description: + System input clock (aka XVCLK). From 6 to 27 MHz. + maxItems: 1 + + dovdd-supply: + description: + Digital I/O voltage supply, 1.8V. + + avdd-supply: + description: + Analog voltage supply, 2.8V. + + dvdd-supply: + description: + Digital core voltage supply, 1.2V. + + reset-gpios: + description: + The phandle and specifier for the GPIO that controls sensor reset. + This corresponds to the hardware pin XSHUTDN which is physically + active low. + maxItems: 1 + +required: + - compatible + - reg + - clocks + - dovdd-supply + - avdd-supply + - dvdd-supply + - port + +unevaluatedProperties: false + +examples: + - | + #include + #include + #include + + i2c { + #address-cells = <1>; + #size-cells = <0>; + + ov5693: camera@36 { + compatible = "ovti,ov5693"; + reg = <0x36>; + + reset-gpios = <&gpio2 RK_PB1 GPIO_ACTIVE_LOW>; + pinctrl-names = "default"; + pinctrl-0 = <&cif_clkout_m0>; + + clocks = <&cru SCLK_CIF_OUT>; + assigned-clocks = <&cru SCLK_CIF_OUT>; + assigned-clock-rates = <19200000>; + + avdd-supply = <&vcc_1v8>; + dvdd-supply = <&vcc_1v2>; + dovdd-supply = <&vcc_2v8>; + + rotation = <90>; + orientation = <0>; + + port { + ucam_out: endpoint { + remote-endpoint = <&mipi_in_ucam>; + data-lanes = <1 2>; + link-frequencies = /bits/ 64 <450000000>; + }; + }; + }; + }; + +... diff --git a/MAINTAINERS b/MAINTAINERS index 1fc9ead83d2a..844307cb20c4 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -14719,6 +14719,7 @@ M: Daniel Scally L: linux-media@vger.kernel.org S: Maintained T: git git://linuxtv.org/media_tree.git +F: Documentation/devicetree/bindings/media/i2c/ovti,ov5693.yaml F: drivers/media/i2c/ov5693.c OMNIVISION OV5695 SENSOR DRIVER