From patchwork Fri Jun 24 23:03:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tommaso Merciai X-Patchwork-Id: 12895150 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 93FC8C43334 for ; Fri, 24 Jun 2022 23:03:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231526AbiFXXDc (ORCPT ); Fri, 24 Jun 2022 19:03:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229454AbiFXXDa (ORCPT ); Fri, 24 Jun 2022 19:03:30 -0400 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 249DE51E5D for ; Fri, 24 Jun 2022 16:03:29 -0700 (PDT) Received: by mail-ej1-x62f.google.com with SMTP id pk21so7575799ejb.2 for ; Fri, 24 Jun 2022 16:03:29 -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=cdPlkqVcoWoSFU8LRn4IpAsmIYKReNGfIdPxoZMdkRPq2WFoQ9nr5dwMnG5+weD/sD J02wws+Qe4SgAoovSNOpaoRrnein1CmTagwuoj5Hqn6R/rFLDJRmczsefN1Sr14YtW4Q IUJD4oJeb/wtkA8EmCsv/ei3y3hrvU0TUrwDs= 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=HMSHZHFs7hHeGdizyaMu39tCPIftTxQe8QXRPSKnzdexeZbM7TRKzMOgVHaNJEGIz/ 0DwOyqMmKeMZuTc8+SlQ5z94fbz+dnFyRXuSE5NX4VdEVclhFpjwSZabx0Dv8H1VHFFo Wo8kQ1uWgcyq1A0mvyhQO6P1Ln/LfGCQ1DhyVWKxti2pU/1iMqEj5+jJ3WAAEp4l45Q0 O1+Vr74L2UC3jSJ3gxmfQVjo0f3aRZYU49rIU4Db9+ujncOiEexnkeBPQ7TlpyRXugIJ IBbuEUPUE673DBd7jugZOYE3tpcXRIOMPMhzQrrNwNUsHCHg3IGqLBKDBBvR67aw1R+m MM9g== X-Gm-Message-State: AJIora9OAH/hRLDN/WxDDEWpr4EFyZ3QKZl3PchYjqg77KN29ESSe9S+ pZgTtewyHfNzZjQ3v7XFEZtfBtCYuXHZYg== X-Google-Smtp-Source: AGRyM1vhqjiGM7xH32xE7QgCpESMy0PxzCwGDtTt0aC5PvWyn9gqo5qu7GB847/gpS4mM9tg+ABWHA== X-Received: by 2002:a17:907:2d2a:b0:726:3527:60ac with SMTP id gs42-20020a1709072d2a00b00726352760acmr1262045ejc.661.1656111807720; Fri, 24 Jun 2022 16:03:27 -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 w1-20020aa7da41000000b004356a647d08sm2880291eds.94.2022.06.24.16.03.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jun 2022 16:03:27 -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 1/7] media: ov5693: count num_supplies using array_size Date: Sat, 25 Jun 2022 01:03:01 +0200 Message-Id: <20220624230307.3066530-2-tommaso.merciai@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220624230307.3066530-1-tommaso.merciai@amarulasolutions.com> References: <20220624230307.3066530-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 --- 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 Fri Jun 24 23:03:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tommaso Merciai X-Patchwork-Id: 12895151 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 1294EC433EF for ; Fri, 24 Jun 2022 23:03:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231617AbiFXXDd (ORCPT ); Fri, 24 Jun 2022 19:03:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231144AbiFXXDc (ORCPT ); Fri, 24 Jun 2022 19:03:32 -0400 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CADB52E5D for ; Fri, 24 Jun 2022 16:03:31 -0700 (PDT) Received: by mail-ed1-x529.google.com with SMTP id fd6so5404944edb.5 for ; Fri, 24 Jun 2022 16:03:31 -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=CPJGBltRQMTNQ0gqN29pV2a5f+a8qkKK5suEXswUmGRVbkS07Ncv2z2e1clEqmF7fN K4FhzM+mpjyRZ+OOFcPCcdcVho5zjb9RhKavj2lOuHtOQ2QfGQi2eB1rvB6dycwJGK6q cIzS/eOHsirikEIc+8JmANSMg/fnrwf+7OMi4= 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=KL/qslAbkOVU+4x2Tl3FvyPPgl+UKnaiigN9drXBJiHFuArlttSvc42tzUSWsaGfH2 qJV7edHKD+OLYzAg3N1jB3YO9iNckHoKTZggFPqsJf8PJBgIm6XDoFYMorZ2BvqXLxhR uTtYRigSPlKc98Ovh7oHaGPwFRoN9dRKcQSwAfAf/VD+26tvVKPxFGRnZg2DNaarzzsb 7Q+7CtZ0H3LOQZn1cNRZTIguggQhKuFLp7832LMCJUW070ooxNgTNNbukqu22iK7SUc3 NJFCfoO2IkUYAVVSLt33c3GMZwQPJgqH7jw92XvK5ttJ/1aTuw6LPAQRgJwm/i3FroAN L3Dg== X-Gm-Message-State: AJIora8DaYVTqnqdDLdtJlWpFwcZHDK2749EBkfBxlxsnSngoXEKnqmu UpK6Ry+T8qJYKtBG/uPJxpcMBw== X-Google-Smtp-Source: AGRyM1u6hdDfTgUzidUtOS7Pa1meRutKonF/+CpYb+2IG1xaeYJn3J0ptqYgolsj3R1f1S7qejJK0Q== X-Received: by 2002:a05:6402:1f14:b0:435:97f3:640 with SMTP id b20-20020a0564021f1400b0043597f30640mr1718726edb.169.1656111809799; Fri, 24 Jun 2022 16:03:29 -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 w1-20020aa7da41000000b004356a647d08sm2880291eds.94.2022.06.24.16.03.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jun 2022 16:03:29 -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 2/7] media: ov5693: add dvdd into ov5693_supply_names array Date: Sat, 25 Jun 2022 01:03:02 +0200 Message-Id: <20220624230307.3066530-3-tommaso.merciai@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220624230307.3066530-1-tommaso.merciai@amarulasolutions.com> References: <20220624230307.3066530-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 --- 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 Fri Jun 24 23:03:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tommaso Merciai X-Patchwork-Id: 12895152 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 17F6BC43334 for ; Fri, 24 Jun 2022 23:03:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231707AbiFXXDi (ORCPT ); Fri, 24 Jun 2022 19:03:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229757AbiFXXDf (ORCPT ); Fri, 24 Jun 2022 19:03:35 -0400 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A7818289D for ; Fri, 24 Jun 2022 16:03:34 -0700 (PDT) Received: by mail-ej1-x633.google.com with SMTP id t5so7590344eje.1 for ; Fri, 24 Jun 2022 16:03:33 -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=j/EW46XmjD1+C0Yl6GvfN54Mr4rCGg3DSTzJVutybtOCGMpbiPDgpjSmgRtp4m7BhK 2MJqzuxyPnRgQOxcKMKHAdbP3tqnV8FO4LXhhiX09+bBNGNzG8UPgZTWO2VNoLINPAWR OpFWNFQYe26IW2MmoNCLrjtfzTfNq8GTKlREQ= 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=6bb094GXtP1LW1HCFzqRooxAXAWmQ4KGUUO1N3ab0gL5l7XSIzoSQtu3pW2n/EV5qR N0UXuG1tajG8XC8AR5++7G1GEygs0rffcaRC4kvxbGkB/qxa5KZyETGWZHxapvpnGGWd 9cjB5/Xf3Ox37XwlwNtwBKjdvjUm0uNWzf/tBCDF8hloxPnWcGzc/CJGDMre+lCGgngb VT/aFLvdyPBVUd5oRic44w8ZjWY9zdoqLJnrcTmA/G7dQPsvI/86GaGcyQVQhYCXUQik FFJBMbq2buLV4WOFaHgyPPkcuE+4WPrFmocBZMvQvdvJ8i915o8CcALv3LC/8HRIte+1 iqew== X-Gm-Message-State: AJIora/mPDj4dVgsjfSoXFX30z9zWW9cpJ1rRAQzLYqs8FlsxI4lbfGq XtT8FRUm2HWOJ8EpUVEGQREy5A== X-Google-Smtp-Source: AGRyM1ukJ4p7wfz/NeE9J04z4qMVxbrWxclP3ijoDLcfvuhGxZjXeTvHu2Tw7Q8EBQhsQ6OoDLm9eA== X-Received: by 2002:a17:906:e104:b0:711:d510:54ca with SMTP id gj4-20020a170906e10400b00711d51054camr1320076ejb.342.1656111812463; Fri, 24 Jun 2022 16:03:32 -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 w1-20020aa7da41000000b004356a647d08sm2880291eds.94.2022.06.24.16.03.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jun 2022 16:03:32 -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 3/7] media: ov5693: rename clk into xvclk Date: Sat, 25 Jun 2022 01:03:03 +0200 Message-Id: <20220624230307.3066530-4-tommaso.merciai@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220624230307.3066530-1-tommaso.merciai@amarulasolutions.com> References: <20220624230307.3066530-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 --- 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 Fri Jun 24 23:03:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tommaso Merciai X-Patchwork-Id: 12895153 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 13B33C433EF for ; Fri, 24 Jun 2022 23:03:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231725AbiFXXDj (ORCPT ); Fri, 24 Jun 2022 19:03:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231419AbiFXXDg (ORCPT ); Fri, 24 Jun 2022 19:03:36 -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 52AA187D6A for ; Fri, 24 Jun 2022 16:03:35 -0700 (PDT) Received: by mail-ej1-x635.google.com with SMTP id fi2so7505441ejb.9 for ; Fri, 24 Jun 2022 16:03:35 -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=Nslflgx+vC6wlDa38RA+REXLnTqEX5+bu6g9ShxBqsc+cFFvdjQ9T4GPzoyet4MDoJ vjxmrnleCvPcD1wlhC/HxPb9qrINaBBrNR8jh7djyIGY9uZVrSApbuKks43rlsfdrdqp sw0CY8OILmEVZ6L+S0OwjZIuZKWnioNgA/3QU= 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=mCKxIgM57CjbdPjcXoF9Qc1U3TttppboOaK7UEJeQtGD0SIm1hHgNermY5X+DmCOvQ Wjc1dEeW0q+GxiqEKCGp06Lnp809TGUMXb6DnF1+LhxjmMjZd5sVxApjzCNWLC7eIvqd JjPGboK+Y23+s2LlajfNXPHSX7jtp/oD6sFdJAp0uctJl2zwuZKAU51aRxLr9QHmr4qL e6Tm5cRTt+uxVwqsnce31NDKWj5XlCtegCWTEZP6WDyhr7tsNwxX6fZ7XYLWhVQPvvbS LPt2b1xI225mr97It/4Xl8nScPbEvUJOoCq7fYuQawliYDcg9BjoaX/qjDDsjILxpZn9 f+OA== X-Gm-Message-State: AJIora+Rh7JEwYRQ9VWuWz+3m4Eo3hGu0TpoKJzIIL82TP3SoHwnY0FS gtcdqZf60+ez9P2qBbvRqFdktg== X-Google-Smtp-Source: AGRyM1tlrG2DIrP2a8KAibUba590k2twf2MsHXy9VNHXYbTtgBZ6tdw82kShPk057cNTiqdMRQOIVQ== X-Received: by 2002:a17:907:948f:b0:722:e90c:6bc9 with SMTP id dm15-20020a170907948f00b00722e90c6bc9mr1371123ejc.180.1656111813900; Fri, 24 Jun 2022 16:03:33 -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 w1-20020aa7da41000000b004356a647d08sm2880291eds.94.2022.06.24.16.03.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jun 2022 16:03:33 -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 4/7] media: ov5693: move hw cfg functions into ov5693_check_hwcfg Date: Sat, 25 Jun 2022 01:03:04 +0200 Message-Id: <20220624230307.3066530-5-tommaso.merciai@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220624230307.3066530-1-tommaso.merciai@amarulasolutions.com> References: <20220624230307.3066530-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 Fri Jun 24 23:03:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tommaso Merciai X-Patchwork-Id: 12895155 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 A5537CCA473 for ; Fri, 24 Jun 2022 23:03:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229454AbiFXXDj (ORCPT ); Fri, 24 Jun 2022 19:03:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231680AbiFXXDh (ORCPT ); Fri, 24 Jun 2022 19:03:37 -0400 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4FA388969 for ; Fri, 24 Jun 2022 16:03:36 -0700 (PDT) Received: by mail-ej1-x632.google.com with SMTP id ge10so7523401ejb.7 for ; Fri, 24 Jun 2022 16:03:36 -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=gH2Z7bGufOOexKb1QCi6vG5Jtst7PDiEp12YxfktJF6iT9LumdlhD7WGjFie91X0EY EpBVumPmxwiot9IDUQdu/IHpt23AG03XrapwS25ESQZzkMcVJHogiTvYkEhc6/qwIFDs lNllUY9JchYHRn/k/rpE8Qnl6m8JU+JCnqUO4= 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=uwgfttPBJCStXZ1XHEAXFLeZXw4nb2XdB3DvTYnnUFB04OcE+GZA2LR2Ch6U9B1GAM nP8dBTJX4GHlqL3GCAYjVQJxiIghtAUUl+8jtM2dDdOG0q3uwTp95c4TGUY93KDokwk9 YlS+JgloKx7/SO8Ra2IkPKbL2Ob73zeOPINm1CQrQi7/2NI9KOTiCYed2735jXIe30/J utqtBNGdsqlvm5/wFQzpudxoSyBL+x5DKTrbs7UOLBfHk2UR+1Yp417rxZgaR7qdEkwL KmI/aCuV4IoqXsiYvX1LAZyaKy7xpxKMyJrmPZ4qbc9wP1kpGOXOiFXZvXLD96N/BIoL 4xtw== X-Gm-Message-State: AJIora+j8/wLwOZpomha0LY6h+veIA82NEitPEi18g85dG5oFLsC4x8N SQPr45J9l6PJZPnr4xTrJfBzEw== X-Google-Smtp-Source: AGRyM1sJyFili14FlSFtjNScmHSlGY/vuxR8LImiMA2h51vjwTyXUpuN4qaa6WmJWtoJh/H7vUvGeQ== X-Received: by 2002:a17:906:4f87:b0:718:c7ce:bd64 with SMTP id o7-20020a1709064f8700b00718c7cebd64mr1236330eju.507.1656111815169; Fri, 24 Jun 2022 16:03:35 -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 w1-20020aa7da41000000b004356a647d08sm2880291eds.94.2022.06.24.16.03.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jun 2022 16:03:34 -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 5/7] media: ov5693: rename ov5693_check_hwcfg into ov5693_get_hwcfg Date: Sat, 25 Jun 2022 01:03:05 +0200 Message-Id: <20220624230307.3066530-6-tommaso.merciai@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220624230307.3066530-1-tommaso.merciai@amarulasolutions.com> References: <20220624230307.3066530-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 --- 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 Fri Jun 24 23:03:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tommaso Merciai X-Patchwork-Id: 12895154 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 504CEC43334 for ; Fri, 24 Jun 2022 23:03:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231708AbiFXXDk (ORCPT ); Fri, 24 Jun 2022 19:03:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231713AbiFXXDi (ORCPT ); Fri, 24 Jun 2022 19:03:38 -0400 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC580828B4 for ; Fri, 24 Jun 2022 16:03:37 -0700 (PDT) Received: by mail-ed1-x52b.google.com with SMTP id z11so5388452edp.9 for ; Fri, 24 Jun 2022 16:03:37 -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=oj4upZHCp3jgvvltD1qbGy+vaQmuJfrulVaI6ymBNWA=; b=CANYcJDLEMAvkkSJzGjJ5i4Or7H+i4cAqYsHgubfePpnNilvBBbUtSa/bvKEpt7G0s 6ui13IbdkntInhPQDYm5nPPg1XkjBhHGw+vzEas13LOfaGe/IupyU2jV1gII3TtWJbMo X1C6hdT+Itfr2MXQDsIC18VwNaDK4MNiE97G8= 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=oj4upZHCp3jgvvltD1qbGy+vaQmuJfrulVaI6ymBNWA=; b=OtMMFs+vOn70i0RayfFTx2Z8gccJNH92dXwXFjIKQNWWEVcD6TOvPms12Gmc3vEi1O EvSe76rRYCG+kv9I6BUw/QHlyjdK3bt5CyqBU9Y4OGfDYnC9mH0NHMA68NX3w48hgw2C /NFKQ4y9GbfnI9Y9FDpha9NWmgTNkPrtZSG8HDDn3qI8vyr8+7W5nsZEQ0fB5jRXZUwu /T0bLQFyl1YVQT0dVY5Ma+aWPWlY6dpXQgAXSX8b9x7ZDsvmBYlVluFfVKPobxOeZGmg kSrDMlqWVgfdwDXQzzHGIEq+zSHL3UlwTZLunzJii9XzGXJTU3wXGnQeGEkFpPIMq6zy 1kWg== X-Gm-Message-State: AJIora8SK4O8jD9LvJ0+tfWqvNDH0Ll5q4b2Bu4auJ1rXRzhE1nmUgVp ZlBVea3TuhJL61JnqUWdfZc6ow== X-Google-Smtp-Source: AGRyM1sp3U0cy5ITjeNoalU6rxPTZugvJj4o7nifc+gaGqrY9rfIZ15IHJh/Mx8hLFdGHpoxS7tDfA== X-Received: by 2002:a05:6402:2402:b0:435:3418:61b5 with SMTP id t2-20020a056402240200b00435341861b5mr1770090eda.82.1656111816540; Fri, 24 Jun 2022 16:03:36 -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 w1-20020aa7da41000000b004356a647d08sm2880291eds.94.2022.06.24.16.03.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jun 2022 16:03:36 -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 6/7] media: ov5693: add ov5693_of_match, dts support Date: Sat, 25 Jun 2022 01:03:06 +0200 Message-Id: <20220624230307.3066530-7-tommaso.merciai@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220624230307.3066530-1-tommaso.merciai@amarulasolutions.com> References: <20220624230307.3066530-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 Signed-off-by: Tommaso Merciai --- 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 Fri Jun 24 23:03:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tommaso Merciai X-Patchwork-Id: 12895156 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 7E607C43334 for ; Fri, 24 Jun 2022 23:03:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231907AbiFXXDw (ORCPT ); Fri, 24 Jun 2022 19:03:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231642AbiFXXDk (ORCPT ); Fri, 24 Jun 2022 19:03: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 C805451E5D for ; Fri, 24 Jun 2022 16:03:39 -0700 (PDT) Received: by mail-ej1-x635.google.com with SMTP id fi2so7505441ejb.9 for ; Fri, 24 Jun 2022 16:03:39 -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=iJe+xcZ3/D6PBSynO0jW7/Eqhilgv6gNqpZ8p3aGXd0=; b=MnE6HFKeJE96PcaRLagx5/+3ziVOcE+1hsvFY5sY/Cdn8gEfANbQZhJr3yWzr0DNyP cro1ywge4Mq9rwcGE7j2QM9hpm+qkHMKIJ4pyk3i2OioePxvc1btkQSHwEaekZnjwoT5 UXFwfiwVrYlb6RLk8vuzINxhNcravsga2+dD0= 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=iJe+xcZ3/D6PBSynO0jW7/Eqhilgv6gNqpZ8p3aGXd0=; b=YnTmWgcsN5HHa5l64+AOEb9X1wFffsBATxNgzQnRnCp62aMEkUJvrpV8O4U3BGtfQX VDNnsDNx8PdmeSY6Rtafnahrq3qePcZaYZosje3dalkL/fgwmOhVXYydEeHM1PB2FOUj f80KjrHfVvtQnZpN3zJW2VM1w2bonKUWpIyo/hWlTypwieejB+cVMRRUowVhIEGRYs7I 7EPiafmW+GoKjmpJWoADR8BffLqA+kx9/2+Qbb1G42kgNE0tghApeSl9duam3AGwD/9h 7jB21wn4HBSmzRc7PZWCqSJhD61ORrBVgN2Pk9oP3zPHEkby13pQzvqI+f9CkNVaxAN3 RBJg== X-Gm-Message-State: AJIora+66M9+3khAHOQ49lS5O9JPdVA2KYGXphDVNEw0zaRHQl1KwJMc geU+A1TS0dr3L23aktQQsANuvQ== X-Google-Smtp-Source: AGRyM1u9OrGaQ3FO3H0QgxOTsvLQiGp1ni6Lj1KBxemuMVOZbqVG6TzVRElD9/a1D3MJ77tfYQcEng== X-Received: by 2002:a17:906:9c84:b0:6e0:7c75:6f01 with SMTP id fj4-20020a1709069c8400b006e07c756f01mr1328997ejc.103.1656111819427; Fri, 24 Jun 2022 16:03:39 -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 w1-20020aa7da41000000b004356a647d08sm2880291eds.94.2022.06.24.16.03.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jun 2022 16:03:39 -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 7/7] media: dt-bindings: ov5693: document YAML binding Date: Sat, 25 Jun 2022 01:03:07 +0200 Message-Id: <20220624230307.3066530-8-tommaso.merciai@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220624230307.3066530-1-tommaso.merciai@amarulasolutions.com> References: <20220624230307.3066530-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 --- .../bindings/media/i2c/ovti,ov5693.yaml | 123 ++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 124 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..1ee70af40000 --- /dev/null +++ b/Documentation/devicetree/bindings/media/i2c/ovti,ov5693.yaml @@ -0,0 +1,123 @@ +# 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 + +allOf: + - $ref: /schemas/media/video-interface-devices.yaml# + +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). + +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 + + port: + $ref: /schemas/graph.yaml#/$defs/port-base + additionalProperties: false + + properties: + endpoint: + $ref: /schemas/media/video-interfaces.yaml# + unevaluatedProperties: false + + properties: + data-lanes: + minItems: 1 + maxItems: 2 + + # Supports max data transfer of 900 Mbps per lane + link-frequencies: true + +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>; + }; + }; + }; + }; \ No newline at end of file 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