From nobody Sun Apr 19 13:46:16 2026 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 25452CCA47B for ; Thu, 30 Jun 2022 13:50:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235589AbiF3NuB (ORCPT ); Thu, 30 Jun 2022 09:50:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235455AbiF3NtL (ORCPT ); Thu, 30 Jun 2022 09:49:11 -0400 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4AFC233347 for ; Thu, 30 Jun 2022 06:48:42 -0700 (PDT) Received: by mail-ed1-x52f.google.com with SMTP id eq6so26599556edb.6 for ; Thu, 30 Jun 2022 06:48:42 -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=jE26kz8uLkTSQmG0BFSrQuTDJo25o/aqMTxY60BA87o=; b=TjBJe4l27BlUK69/w9aTMBarDu8Hu5rsMI3YPuojTUPjti+DtWbeez4JTqjDFoBeCC 4CZtxGHVq2VnWJD5DvM38qcux3B8HyI9Xg8OrP2idCpv7Mwz/L87esvTQcbeW5IV5aEh kXb0aqoVsHj1slf6mWtRUMYv8iIKOck2Jf5sc= 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=jE26kz8uLkTSQmG0BFSrQuTDJo25o/aqMTxY60BA87o=; b=n9Gy9M6adqUNcwSPXAOMQHu358zsiaWA1mGYNkPuI9B4R7RyXlAOJ2/Hd0wuJRdPFS Hy7w+oSRSgQqKoXvfzpWO8pbR3VbYA4uySVStmcKJ7jMr0src/lzEry2UXX+1+pxGRnB GU2k+Imy3AUQyMxvIUD1INe/clEZb3f+aK0/C7TUO1cscfB3SqPRf748ds4Ud9uQ7Waq y6ih8DrDzkwa5JtMvcctwM1CanyP42FbKR+k5EFdhCP7n8aCEKSOmZHgnRZIWLzK+VgY 6yVUc1XBoHbgH1fSNa1E9NCYwST8kRY31TrjIcKYEZzIDbHUpOVqrt5QyKGb9XnQIYGs c7qw== X-Gm-Message-State: AJIora/LPmh/JrP0lHyhlbeLJdjFzpu0jWqcdIbXjmDZAltZeca0X8+C yXxSzUhT/kdh6/tg565NFU+gygeTCBaPrg== X-Google-Smtp-Source: AGRyM1vAypfxHpAD8WCEQkT4NzUt3sIuZbwI6E+sDAaDx0HZ1xtmOpSsPyY7FmDUDbKMZmjj//OAtQ== X-Received: by 2002:a05:6402:40cc:b0:435:912b:257a with SMTP id z12-20020a05640240cc00b00435912b257amr11702414edb.380.1656596921341; Thu, 30 Jun 2022 06:48:41 -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 k5-20020a1709067ac500b006fee526ed72sm9130288ejo.217.2022.06.30.06.48.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jun 2022 06:48:41 -0700 (PDT) From: Tommaso Merciai To: tommaso.merciai@amarulasolutions.com Cc: linuxfancy@googlegroups.com, linux-amarula@amarulasolutions.com, quentin.schulz@theobroma-systems.com, Jacopo Mondi , Daniel Scally , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 1/6] media: ov5693: count num_supplies using array_size Date: Thu, 30 Jun 2022 15:48:30 +0200 Message-Id: <20220630134835.592521-2-tommaso.merciai@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220630134835.592521-1-tommaso.merciai@amarulasolutions.com> References: <20220630134835.592521-1-tommaso.merciai@amarulasolutions.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Daniel Scally --- Changes since v3: - Add reviewed-by tag, suggested by Jacopo, Krzysztof Changes since v4: - Add Daniel reviewed-by tag 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 =20 -/* Miscellaneous */ -#define OV5693_NUM_SUPPLIES 2 - #define to_ov5693_sensor(x) container_of(x, struct ov5693_device, sd) =20 +static const char * const ov5693_supply_names[] =3D { + "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[] =3D { OV5693_LINK_FREQ_419_2MHZ }; =20 -static const char * const ov5693_supply_names[] =3D { - "avdd", - "dovdd", -}; - static const char * const ov5693_test_pattern_menu[] =3D { "Disabled", "Random Data", --=20 2.25.1 From nobody Sun Apr 19 13:46:16 2026 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 A5EBCC43334 for ; Thu, 30 Jun 2022 13:50:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235598AbiF3NuH (ORCPT ); Thu, 30 Jun 2022 09:50:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235456AbiF3NtL (ORCPT ); Thu, 30 Jun 2022 09:49:11 -0400 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1618D340F0 for ; Thu, 30 Jun 2022 06:48:44 -0700 (PDT) Received: by mail-ej1-x62e.google.com with SMTP id pk21so39185021ejb.2 for ; Thu, 30 Jun 2022 06:48:44 -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=REFGbYhE8dpEN5VkA7iNJtkkSRmeBAdrouvG3pc5rZ4=; b=rBpQMx9t2a7Q0FsOr1iUlU/2OoulDaYtNFW1OUkMnwtHNTf7jSX26b3IxPRpK60K5Y 2hKXbGfNqCD37LLY5CnywjL8XDAAETYEt0HFlXfX4gfFjcg5PAAEruGnI97cYzDYhIHM n2HTSi8TaetQHcCrgH9rvA+8ake3xJszCfdCU= 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=REFGbYhE8dpEN5VkA7iNJtkkSRmeBAdrouvG3pc5rZ4=; b=3Qj8KW6PAHUoAsCf2PGZtIIFBq7YB5DFAgr8KwrjIfi7nxlYNtiS3tKCVQxT4ERSo5 PsuwsrMrKYwtOyS9mn6mXhzvhynZeqaPrza9XzijqNDV2qsmK45TH135Vo3wu304V0zL jTubg7Sl1U8WsPpOZ3B+BVmO2L7JBoUrJpkIyMPxGdLuO0CBaHh0jLW5XewZVH0QsWiu NwTRtlhL/W+YUw37vE9rIy2O5lsFmDhJC8O5KafAhyLj+XkHIyD9fYH2F0Qy2yytZ2f0 uky7m2wLeI7WHJn4k7YeoF/j4GEeGW50Ka6K+TG2V8Y6AAlTESihuObjsMZpwlmw+Z7L BJPA== X-Gm-Message-State: AJIora+XiRProMf9mIn862vQDx2cTkcejDDbkBaTfg/a9UaXwOmlX+6h rK+OrQF364KN1TDf2iwxSRFGHg== X-Google-Smtp-Source: AGRyM1tGnzRXAdLJuMxqaj73mOg0FEdM9ZjdA9yVSlhCEgCOSyHf44ALTuvyynaborcTpEeBGUtK4Q== X-Received: by 2002:a17:907:6d20:b0:728:46e4:dac6 with SMTP id sa32-20020a1709076d2000b0072846e4dac6mr8878018ejc.280.1656596922605; Thu, 30 Jun 2022 06:48:42 -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 k5-20020a1709067ac500b006fee526ed72sm9130288ejo.217.2022.06.30.06.48.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jun 2022 06:48:42 -0700 (PDT) From: Tommaso Merciai To: tommaso.merciai@amarulasolutions.com Cc: linuxfancy@googlegroups.com, linux-amarula@amarulasolutions.com, quentin.schulz@theobroma-systems.com, Jacopo Mondi , Daniel Scally , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 2/6] media: ov5693: add dvdd into ov5693_supply_names array Date: Thu, 30 Jun 2022 15:48:31 +0200 Message-Id: <20220630134835.592521-3-tommaso.merciai@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220630134835.592521-1-tommaso.merciai@amarulasolutions.com> References: <20220630134835.592521-1-tommaso.merciai@amarulasolutions.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Add missing "dvdd" (Digital circuit power) entry into ov5693_supply_names array Signed-off-by: Tommaso Merciai Reviewed-by: Jacopo Mondi Reviewed-by: Daniel Scally --- Changes since v3: - Add reviewed-by tag, suggested by Jacopo, Krzysztof Changes since v4: - Add Daniel reviewed-by tag 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[] =3D { "avdd", /* Analog power */ "dovdd", /* Digital I/O power */ + "dvdd", /* Digital circuit power */ }; =20 #define OV5693_NUM_SUPPLIES ARRAY_SIZE(ov5693_supply_names) --=20 2.25.1 From nobody Sun Apr 19 13:46:16 2026 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 BB589C43334 for ; Thu, 30 Jun 2022 13:50:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235604AbiF3NuM (ORCPT ); Thu, 30 Jun 2022 09:50:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235471AbiF3NtM (ORCPT ); Thu, 30 Jun 2022 09:49:12 -0400 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80B94344F4 for ; Thu, 30 Jun 2022 06:48:45 -0700 (PDT) Received: by mail-ej1-x634.google.com with SMTP id pk21so39185115ejb.2 for ; Thu, 30 Jun 2022 06:48:45 -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=ctpa/T2vVk1WErHGmcuqVVZ1P5/ZM5PQkEWqW8vXr7A=; b=QWHMm6Rv+FtY91S2WQN+wWSdGk5S+1HjGiFpU56tVt5eNsTLFjV0VtdEBwwFl2SMfU FB9VFX90c+uREFxecu7xHH+lB8bpJ2kWphGm8H9gfjC1uQrnFsMTt59dSC3SMiBfduaQ 0flOFeBchkgjBAjirTzkfxmyBhGikH6i5IAdc= 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=ctpa/T2vVk1WErHGmcuqVVZ1P5/ZM5PQkEWqW8vXr7A=; b=zJ+3X8LRDV/Eganrul4j4vp5ArsgWV/pIMAK9EuRsc57xDvNdNu+IvoL/4EFxH1had 9fZERap0t+F6G+2kHa+q8dldcCU9sYEZS8d7Txzua36hWG5n/M4tYudldtspuIYFWUtv riGHWEtJbNHWiW97kNvaV1WsNaZFYQuS5yQS7OWvn/3m9M9mdMJCjzsVihEaUVnjOHKF BrgwisiGDh15ZpSYxBA0Iv89Q9DNp4FnvHDbAvuhpOdWZFnn3yws7PzLF0NVeOFDlCHb yxcFsE//U8QOPTlxY4Pq1UVUZhUXWlMuw60zpIAQhu9/kNF7UrYCipYNecYrydAiiejp Hv+Q== X-Gm-Message-State: AJIora8Yi8qg0wWdzFJecTYunKChZ3beVgKsaCImrab8jNwXuaZEoKwQ TjzBKu2+VAMAcXKidEYoDkCRLeZisx6o5A== X-Google-Smtp-Source: AGRyM1tl742IH4K4tuQ/XGHDZg4XSsuoE/udHOGl0i4J+cjgZcY/NrutYCDCorUvQi0EY0/51otDIA== X-Received: by 2002:a17:907:3dac:b0:722:e6ab:8d9 with SMTP id he44-20020a1709073dac00b00722e6ab08d9mr9931791ejc.20.1656596923839; Thu, 30 Jun 2022 06:48:43 -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 k5-20020a1709067ac500b006fee526ed72sm9130288ejo.217.2022.06.30.06.48.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jun 2022 06:48:43 -0700 (PDT) From: Tommaso Merciai To: tommaso.merciai@amarulasolutions.com Cc: linuxfancy@googlegroups.com, linux-amarula@amarulasolutions.com, quentin.schulz@theobroma-systems.com, Jacopo Mondi , Daniel Scally , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 3/6] media: ov5693: rename clk into xvclk Date: Thu, 30 Jun 2022 15:48:32 +0200 Message-Id: <20220630134835.592521-4-tommaso.merciai@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220630134835.592521-1-tommaso.merciai@amarulasolutions.com> References: <20220630134835.592521-1-tommaso.merciai@amarulasolutions.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 --- Changes since v3: - Add reviewed-by tag, suggested by Jacopo, Krzysztof 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; =20 struct ov5693_mode { struct v4l2_rect crop; @@ -794,7 +794,7 @@ static void ov5693_sensor_powerdown(struct ov5693_devic= e *ov5693) =20 regulator_bulk_disable(OV5693_NUM_SUPPLIES, ov5693->supplies); =20 - clk_disable_unprepare(ov5693->clk); + clk_disable_unprepare(ov5693->xvclk); } =20 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); =20 - ret =3D clk_prepare_enable(ov5693->clk); + ret =3D 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 *o= v5693) static int ov5693_probe(struct i2c_client *client) { struct ov5693_device *ov5693; - u32 clk_rate; + u32 xvclk_rate; int ret =3D 0; =20 ov5693 =3D devm_kzalloc(&client->dev, sizeof(*ov5693), GFP_KERNEL); @@ -1408,16 +1408,16 @@ static int ov5693_probe(struct i2c_client *client) =20 v4l2_i2c_subdev_init(&ov5693->sd, client, &ov5693_ops); =20 - ov5693->clk =3D devm_clk_get(&client->dev, "xvclk"); - if (IS_ERR(ov5693->clk)) { + ov5693->xvclk =3D 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); } =20 - clk_rate =3D clk_get_rate(ov5693->clk); - if (clk_rate !=3D OV5693_XVCLK_FREQ) + xvclk_rate =3D clk_get_rate(ov5693->xvclk); + if (xvclk_rate !=3D OV5693_XVCLK_FREQ) dev_warn(&client->dev, "Found clk freq %u, expected %u\n", - clk_rate, OV5693_XVCLK_FREQ); + xvclk_rate, OV5693_XVCLK_FREQ); =20 ret =3D ov5693_configure_gpios(ov5693); if (ret) --=20 2.25.1 From nobody Sun Apr 19 13:46:16 2026 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 02494C43334 for ; Thu, 30 Jun 2022 13:50:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235629AbiF3NuZ (ORCPT ); Thu, 30 Jun 2022 09:50:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235398AbiF3Nta (ORCPT ); Thu, 30 Jun 2022 09:49:30 -0400 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 688352CDF4 for ; Thu, 30 Jun 2022 06:48:46 -0700 (PDT) Received: by mail-ed1-x52e.google.com with SMTP id k20so5239178edj.13 for ; Thu, 30 Jun 2022 06:48:46 -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=ROC0BgtK/N+kzsuCvrmnTVmfs20tFROFRODZongU+to=; b=NaoC0xFuRq2ObQvdXuPj82w4yVCM/A/ZMWn+W0zeWYsDUTYGGbQJdNxBJqYyAbTzCT qcFAuggucFIZvrj9SpxMx/AS8vGpx1GzK/cA9mktGtrnKV4DV3CsYHfYhWHkavX5gAbx U/Mtc6Q7FM9kqfsf1I9SsvzlZpEq/sgXxdi9k= 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=ROC0BgtK/N+kzsuCvrmnTVmfs20tFROFRODZongU+to=; b=PjoOhR1Fn0fBs6LOwoAhNXVM12lGARlazaFW4kM5d8SWx73ilcc8BP+h/hASzRk7wa iw327P42us9d8NWZfXOP3i539Wm2eSJFdlZu/qZVpiZSmZ7YB3x0cOmQLmMvBE5eqvLP cXDQaBkqFGlc4PyBjELBAQXeoKQCOk2IynYznupVb+thj6Z0PEfZ+Aq9Xw8TY9Z7omvQ LmnSnMPGynYOm69uYMl0MgKLNvW1kSNe4CFnZ9asohhC0XyllPcWRhqpsSIM+oCU82Wz IdEC4dZ3QQBq8U/WiMbRbiWNsg5nwgIcLhTc5tpANLbgODeSIIqhhugGv0eTH30Y4tEE 6kog== X-Gm-Message-State: AJIora+9mm5u+7xJYBTRd5d/PC5j48TOlWpftQa+z9svf+jKotkVeVPY oonydawWNfJzcBp+tICAvMoq8w== X-Google-Smtp-Source: AGRyM1s9h/6dn4X3QmybTx+NQeRd1kfhotuKgCuC0FQY7rw9ZwgAgS9szjrVgzUwVvo9Sc+uvVDy0g== X-Received: by 2002:aa7:d294:0:b0:435:5d12:867f with SMTP id w20-20020aa7d294000000b004355d12867fmr11725808edq.147.1656596925203; Thu, 30 Jun 2022 06:48:45 -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 k5-20020a1709067ac500b006fee526ed72sm9130288ejo.217.2022.06.30.06.48.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jun 2022 06:48:44 -0700 (PDT) From: Tommaso Merciai To: tommaso.merciai@amarulasolutions.com Cc: linuxfancy@googlegroups.com, linux-amarula@amarulasolutions.com, quentin.schulz@theobroma-systems.com, Jacopo Mondi , Daniel Scally , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 4/6] media: ov5693: add support for acpi clock-frequency prop Date: Thu, 30 Jun 2022 15:48:33 +0200 Message-Id: <20220630134835.592521-5-tommaso.merciai@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220630134835.592521-1-tommaso.merciai@amarulasolutions.com> References: <20220630134835.592521-1-tommaso.merciai@amarulasolutions.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Add support for ACPI-based platforms that specify the clock frequency by using the "clock-frequency" property instead of specifying a clock provider reference Signed-off-by: Tommaso Merciai Reviewed-by: Jacopo Mondi --- Changes since v2: - Fix commit body as suggested by Sakari, Jacopo - Add details to commit body as suggested by Jacopo - Move ov5693_check_hwcfg into ov5693_hwcfg - Fix xvclk_rate position as suggested by Jacopo - Use devm_clk_get_optional instead of devm_clk_get as suggested Jacopo Changes since v3: - Fix commit body as suggested by Jacopo - Add reviewed-by tags, suggested by Jacopo, Krzysztof Changes since v4: - Remove wrong Sakari reviewed-by tag, suggested by Krzysztof, Sakari - Revert ov5693_check_hwcfg function changes. Keep clk init on probe funct= ion as suggested by Sakari - Fix commit body - Fix commit msg drivers/media/i2c/ov5693.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/drivers/media/i2c/ov5693.c b/drivers/media/i2c/ov5693.c index d2adc5513a21..701468267f20 100644 --- a/drivers/media/i2c/ov5693.c +++ b/drivers/media/i2c/ov5693.c @@ -1408,13 +1408,25 @@ static int ov5693_probe(struct i2c_client *client) =20 v4l2_i2c_subdev_init(&ov5693->sd, client, &ov5693_ops); =20 - ov5693->xvclk =3D devm_clk_get(&client->dev, "xvclk"); - if (IS_ERR(ov5693->xvclk)) { - dev_err(&client->dev, "Error getting clock\n"); - return PTR_ERR(ov5693->xvclk); + ov5693->xvclk =3D devm_clk_get_optional(&client->dev, "xvclk"); + if (IS_ERR(ov5693->xvclk)) + return dev_err_probe(&client->dev, PTR_ERR(ov5693->xvclk), + "failed to get xvclk: %ld\n", + PTR_ERR(ov5693->xvclk)); + + if (ov5693->xvclk) { + xvclk_rate =3D clk_get_rate(ov5693->xvclk); + } else { + ret =3D fwnode_property_read_u32(dev_fwnode(&client->dev), + "clock-frequency", + &xvclk_rate); + + if (ret) { + dev_err(&client->dev, "can't get clock frequency"); + return ret; + } } =20 - xvclk_rate =3D clk_get_rate(ov5693->xvclk); if (xvclk_rate !=3D OV5693_XVCLK_FREQ) dev_warn(&client->dev, "Found clk freq %u, expected %u\n", xvclk_rate, OV5693_XVCLK_FREQ); --=20 2.25.1 From nobody Sun Apr 19 13:46:16 2026 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 92A93C433EF for ; Thu, 30 Jun 2022 13:50:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235643AbiF3Nud (ORCPT ); Thu, 30 Jun 2022 09:50:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235538AbiF3Ntg (ORCPT ); Thu, 30 Jun 2022 09:49:36 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97B70366B7 for ; Thu, 30 Jun 2022 06:48:49 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id h23so39065347ejj.12 for ; Thu, 30 Jun 2022 06:48:49 -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=eOZJrPGyU69k5/hpys+BWBEpcPJoLxPkpyby+vBavA8=; b=VgTwHbK1z1Ya3yd6YY8kbfQyIkcBfjmwgbOJZ5vLOnk2oGjRmCW4XV1pCH4r4D/+2K QPhKh9nuGCPiFj2LCvlTH6PxiBIYgGR/CpSpgCgjHw5g1K8NY2OAtDH3+Dx33AjuSN/Q eqKLCxTo+KStXUUb7AGbitsht6L5JYybp2Djs= 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=eOZJrPGyU69k5/hpys+BWBEpcPJoLxPkpyby+vBavA8=; b=ZHJz/A+d6+EkSHIhAGu1lAT49YL2KbZhlE8+Qs8RSPM8fpAwI97knwa02EpcfGCQF8 2C6Zyz4O2AurptC066coXEh6GvYxSAbAIIh8Mkq/7DCNZ2wolTEEEAIUZw6wd5VJ9Nhb HKJ9UNvsUYBYQyGWWD4YGychAT36w5d1CA9QtRNT9Zxk8dmXqRxTx4RmSJ1nhAcHd6cK WNwZ0fuhe7vJSuycEQ7er8V+2sTYeXOqyAufXv6W4/AA63MHjX3gdyUpTR51Smmnxdir PCDAo8j4NERBhQtrDcgw8nfKX3iEkSoUDJrJuGpmc9dMEUyOqzzKmdYsQ1Eq0Lr6EoCw ZqAQ== X-Gm-Message-State: AJIora91BnOV38YHQqWp6o3DxvkMeixzmNWk1PwnD8+y76lhWbDDVieU R3krTOsELkgMwpJJ3kFkPjwf/Q== X-Google-Smtp-Source: AGRyM1uDW8a/GCb3gf+ZCp6ucKBXI9PdYq/gTUxxLIpNHU/0s9Yze+7uMivvV5FHYEjBwbYJ6rs0og== X-Received: by 2002:a17:906:5d0d:b0:726:be93:1118 with SMTP id g13-20020a1709065d0d00b00726be931118mr8683530ejt.503.1656596927841; Thu, 30 Jun 2022 06:48:47 -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 k5-20020a1709067ac500b006fee526ed72sm9130288ejo.217.2022.06.30.06.48.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jun 2022 06:48:47 -0700 (PDT) From: Tommaso Merciai To: tommaso.merciai@amarulasolutions.com Cc: linuxfancy@googlegroups.com, linux-amarula@amarulasolutions.com, quentin.schulz@theobroma-systems.com, Krzysztof Kozlowski , 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 v5 5/6] media: dt-bindings: ov5693: document YAML binding Date: Thu, 30 Jun 2022 15:48:34 +0200 Message-Id: <20220630134835.592521-6-tommaso.merciai@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220630134835.592521-1-tommaso.merciai@amarulasolutions.com> References: <20220630134835.592521-1-tommaso.merciai@amarulasolutions.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Add 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 Changes since v2: - Fix commit body as suggested by Krzysztof Changes since v3: - Add reviewed-by tags, suggested by Jacopo, Krzysztof Changes since v4: - Remove wrong Sakari reviewed-by tag, suggested by Krzysztof, Sakari .../bindings/media/i2c/ovti,ov5693.yaml | 106 ++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 107 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..b83c9fc04023 --- /dev/null +++ b/Documentation/devicetree/bindings/media/i2c/ovti,ov5693.yaml @@ -0,0 +1,106 @@ +# 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. + + OV5693 is controlled via I2C and two-wire Serial Camera Control Bus (SCC= B). + The sensor output is available via CSI-2 serial data output (up to 2-lan= e). + +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 =3D <1>; + #size-cells =3D <0>; + + ov5693: camera@36 { + compatible =3D "ovti,ov5693"; + reg =3D <0x36>; + + reset-gpios =3D <&gpio2 RK_PB1 GPIO_ACTIVE_LOW>; + pinctrl-names =3D "default"; + pinctrl-0 =3D <&cif_clkout_m0>; + + clocks =3D <&cru SCLK_CIF_OUT>; + assigned-clocks =3D <&cru SCLK_CIF_OUT>; + assigned-clock-rates =3D <19200000>; + + avdd-supply =3D <&vcc_1v8>; + dvdd-supply =3D <&vcc_1v2>; + dovdd-supply =3D <&vcc_2v8>; + + rotation =3D <90>; + orientation =3D <0>; + + port { + ucam_out: endpoint { + remote-endpoint =3D <&mipi_in_ucam>; + data-lanes =3D <1 2>; + link-frequencies =3D /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 =20 OMNIVISION OV5695 SENSOR DRIVER --=20 2.25.1 From nobody Sun Apr 19 13:46:16 2026 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 E6C09C43334 for ; Thu, 30 Jun 2022 13:50:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235443AbiF3Nuh (ORCPT ); Thu, 30 Jun 2022 09:50:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235414AbiF3Ntk (ORCPT ); Thu, 30 Jun 2022 09:49:40 -0400 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 525A737AB4 for ; Thu, 30 Jun 2022 06:48:51 -0700 (PDT) Received: by mail-ej1-x635.google.com with SMTP id fi2so39084226ejb.9 for ; Thu, 30 Jun 2022 06:48:51 -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=UyZCaF6+qRS4Tv5koTh8Q5qQEkydwOcaODvMQ6qR/MQ=; b=e+d4Orc3w9dk00wlozE8gVY3xNuuARW9q+cHmyLq1PSkXNMae9wkooVTYoNLTXyQf+ PC5ps9jB7YSMaSjBP3tnC6OmiAxYPjQbQPwm2GcsyseAqHFWVDsAs09i8thDK07HfgvF SqvzNpmKn4LX3fGYDP9dO0mrKQzGWA+M0t8dw= 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=UyZCaF6+qRS4Tv5koTh8Q5qQEkydwOcaODvMQ6qR/MQ=; b=0LqWycFY5HlTe/FsMyu/l33Qcwr9GrjRNHRBncX59ut2O2EII9063FmRngqiLNCE8+ nCDhXSUJ06ulrZ+u2ZVvmEKJ15oD3dZtJHS+yKwY+8TDvPr790DOH+3yDFJPM7pR6njX kv6IMkXHeYQ88TQ6HEjQKe4Zl5QiEM2YxBZX4HfiAoHDHqKAiY/pf8zofoODvpqdA4gl WFSglFXBjDElrVBg0hLwJC0/y4sXyESu6TPefZMw93/K1O6MyPiTejjE+rrd/xJ0MEDv 4XCfchBD9UYnYLFPpEtyz30GI2Q0z3zPPx0WAO7nAakWNgVnva0H+Qra8z3oborvAUWn b0cw== X-Gm-Message-State: AJIora/cr8Il48OykOVs8FNnvql2XdqfK+Hm8RHB74GtWvEOewnzCBzm ybHEQiyRmD7Op1dfw6/Ku8KPJg== X-Google-Smtp-Source: AGRyM1vfwOsKJqKBaA9zfwKUYoEU7G0JNUoJlfJ976EVKpA6FQR446obllP4hc3kQcE34zIsmcvIdA== X-Received: by 2002:a17:907:2d9e:b0:726:a03a:16c4 with SMTP id gt30-20020a1709072d9e00b00726a03a16c4mr8483121ejc.742.1656596929413; Thu, 30 Jun 2022 06:48:49 -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 k5-20020a1709067ac500b006fee526ed72sm9130288ejo.217.2022.06.30.06.48.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jun 2022 06:48:49 -0700 (PDT) From: Tommaso Merciai To: tommaso.merciai@amarulasolutions.com Cc: linuxfancy@googlegroups.com, linux-amarula@amarulasolutions.com, quentin.schulz@theobroma-systems.com, Jacopo Mondi , Daniel Scally , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 6/6] media: ov5693: add ov5693_of_match, dts support Date: Thu, 30 Jun 2022 15:48:35 +0200 Message-Id: <20220630134835.592521-7-tommaso.merciai@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220630134835.592521-1-tommaso.merciai@amarulasolutions.com> References: <20220630134835.592521-1-tommaso.merciai@amarulasolutions.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Add ov5693_of_match. Device tree support Signed-off-by: Tommaso Merciai Reviewed-by: Jacopo Mondi Reviewed-by: Daniel Scally --- Changes since v2: - Change patch order 7 -> 6 as suggested by Sakari - Add missing signed-off as suggested by Jacopo Changes since v3: - Add reviewed-by tags, suggested by Jacopo, Krzysztof Changes since v4: - Remove wrong Sakari reviewed-by tag, suggested by Krzysztof, Sakari - Add Daniel reviewed-by tag 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 3c805a5a5181..5930207193c7 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_matc= h[] =3D { }; MODULE_DEVICE_TABLE(acpi, ov5693_acpi_match); =20 +static const struct of_device_id ov5693_of_match[] =3D { + { .compatible =3D "ovti,ov5693", }, + { /* sentinel */ }, +}; +MODULE_DEVICE_TABLE(of, ov5693_of_match); + static struct i2c_driver ov5693_driver =3D { .driver =3D { .name =3D "ov5693", .acpi_match_table =3D ov5693_acpi_match, + .of_match_table =3D ov5693_of_match, .pm =3D &ov5693_pm_ops, }, .probe_new =3D ov5693_probe, --=20 2.25.1