From patchwork Thu Jul 20 10:30:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 704811 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 11CF0EB64DA for ; Thu, 20 Jul 2023 10:31:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231372AbjGTKbo (ORCPT ); Thu, 20 Jul 2023 06:31:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231366AbjGTKbn (ORCPT ); Thu, 20 Jul 2023 06:31:43 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D3D510F1; Thu, 20 Jul 2023 03:31:42 -0700 (PDT) Received: from [127.0.1.1] (91-154-35-171.elisa-laajakaista.fi [91.154.35.171]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 030083484; Thu, 20 Jul 2023 12:30:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1689849043; bh=P2mwt86IU+mUzZLLbuoF0ir+LSKXHqgzspTaSIT0SUo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=RBp2sQ4BeAQlW9GbIPUqXXxiM7Vat1kuWEuSNUnM+KqZX8kESb7u1Y+tGAUSD009x zAk16Q0j56P9QBPsR71Dr1+hyBAaef36TajrQjv9uVHMSWxX+5Dna4GFAbfv7ClXrK FXCjwJbYFcCgw0yUqq+Sg7NLye976KV4GI+hByCM= From: Tomi Valkeinen Date: Thu, 20 Jul 2023 13:30:33 +0300 Subject: [PATCH v2 2/8] media: i2c: ds90ub953: Use v4l2_fwnode_endpoint_parse() MIME-Version: 1.0 Message-Id: <20230720-fpdlink-additions-v2-2-b91b1eca2ad3@ideasonboard.com> References: <20230720-fpdlink-additions-v2-0-b91b1eca2ad3@ideasonboard.com> In-Reply-To: <20230720-fpdlink-additions-v2-0-b91b1eca2ad3@ideasonboard.com> To: Mauro Carvalho Chehab , Luca Ceresoli , Andy Shevchenko , Laurent Pinchart , Sakari Ailus , Hans Verkuil , Satish Nagireddy , Matti Vaittinen Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Tomi Valkeinen X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1970; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=P2mwt86IU+mUzZLLbuoF0ir+LSKXHqgzspTaSIT0SUo=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBkuQ0FA9GXOLwxUYO52+WLLQqADbI7QZUvTsO5o 6uQOD1QOEaJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZLkNBQAKCRD6PaqMvJYe 9dKJD/9HVYxsj3ditaU5OdgmrYzNNMcy2DR8i8FE+5Sc46z+HqD5hWREguYYRs9kd2a2nFDRSnP yHaS9nteGT+HuWXkaLBMh4XJLY9IMpXb5X6q2sAsLrPUTdRPEU8GQ2h1aNoLIJXnIL44lTymJPV hSgiubMe0VBk6auxPmneHQTt/es6RTAG9v/QfN4nxJbkqbsiQ/MiDb090yxDLMN+IREPrMzmq+6 iqWbYwUCruJWQvzQjDuC01OZzhMnV2MVw4Uw4GVEhyW0HeKBit7VBDXKnqP8TIOWgSavxK33eV5 ITi3YgjW3lTdklCOi7z4gMplpdxqvu84Xs7VpkkgtrLH0WisgTeGcfGIEC08srbv8W9XhDuoJNp SzzFPV0ndcxuFkNL9B0HEs2CwGo3XISUJRvofcg8B5zpB2VmLVAwi2D1vzKUdd3T73g9C2p9e33 9XJzCpbu33rvdVKiTpgNuUu/pzo0PVQ8bpzVbMH5ECvVv3O3vPZr6/JPfTP/9XGUf4uidKv/crN iWK/vEUrg48v4+789L0jV/+lzlSlMy+VWYXGGoNMijsINhli3R8EWt8JcYciAM5EFmtUZO6wVV6 2P4nQv13LqhPJdG8AvxnlL67dLWuDOruXet0jOTSyTb8A+OQeZmFCKJyBEUrWvoO5YWs6Kp069v oRzd6mu7Anf9alg== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Use v4l2_fwnode_endpoint_parse() to parse the sink endpoint parameters. Signed-off-by: Tomi Valkeinen --- drivers/media/i2c/ds90ub953.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/media/i2c/ds90ub953.c b/drivers/media/i2c/ds90ub953.c index 591b52bf71c2..ad964bd6c7eb 100644 --- a/drivers/media/i2c/ds90ub953.c +++ b/drivers/media/i2c/ds90ub953.c @@ -25,6 +25,8 @@ #include #include #include +#include +#include #include #define UB953_PAD_SINK 0 @@ -1111,7 +1113,9 @@ static const struct regmap_config ub953_regmap_config = { static int ub953_parse_dt(struct ub953_data *priv) { struct device *dev = &priv->client->dev; + struct v4l2_fwnode_endpoint vep = {}; struct fwnode_handle *ep_fwnode; + unsigned char nlanes; int ret; ep_fwnode = fwnode_graph_get_endpoint_by_id(dev_fwnode(dev), @@ -1119,19 +1123,21 @@ static int ub953_parse_dt(struct ub953_data *priv) if (!ep_fwnode) return dev_err_probe(dev, -ENOENT, "no endpoint found\n"); - ret = fwnode_property_count_u32(ep_fwnode, "data-lanes"); + vep.bus_type = V4L2_MBUS_CSI2_DPHY; + ret = v4l2_fwnode_endpoint_parse(ep_fwnode, &vep); fwnode_handle_put(ep_fwnode); - if (ret < 0) + if (ret) return dev_err_probe(dev, ret, - "failed to parse property 'data-lanes'\n"); + "failed to parse sink endpoint data\n"); - if (ret != 1 && ret != 2 && ret != 4) + nlanes = vep.bus.mipi_csi2.num_data_lanes; + if (nlanes != 1 && nlanes != 2 && nlanes != 4) return dev_err_probe(dev, -EINVAL, - "bad number of data-lanes: %d\n", ret); + "bad number of data-lanes: %d\n", nlanes); - priv->num_data_lanes = ret; + priv->num_data_lanes = nlanes; return 0; } From patchwork Thu Jul 20 10:30:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 704810 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 0A1CFEB64DC for ; Thu, 20 Jul 2023 10:31:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231401AbjGTKbr (ORCPT ); Thu, 20 Jul 2023 06:31:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231377AbjGTKbp (ORCPT ); Thu, 20 Jul 2023 06:31:45 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5945310F1; Thu, 20 Jul 2023 03:31:44 -0700 (PDT) Received: from [127.0.1.1] (91-154-35-171.elisa-laajakaista.fi [91.154.35.171]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id BA0483697; Thu, 20 Jul 2023 12:30:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1689849045; bh=3zg0TxkVcXHwj80fcueaquBqUvRn/uJahEbl2HWcRHo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=kpfxg6FZprwwUtPx9ietn1V4s0lFbbWhlMEwizaf+z1blPmYtbwBJT3DnkbVK0Ss/ Qd0lTD3yCP6aGS3HJnRaQqytNZKDkZfWXd2Ynul8b69Y5XIb7lUxLYLSiWDow4//5N rPBWN77RwyJmCIVCxDTA+48fnZT/uayuNmKtwFfo= From: Tomi Valkeinen Date: Thu, 20 Jul 2023 13:30:35 +0300 Subject: [PATCH v2 4/8] media: i2c: ds90ub953: Handle V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK MIME-Version: 1.0 Message-Id: <20230720-fpdlink-additions-v2-4-b91b1eca2ad3@ideasonboard.com> References: <20230720-fpdlink-additions-v2-0-b91b1eca2ad3@ideasonboard.com> In-Reply-To: <20230720-fpdlink-additions-v2-0-b91b1eca2ad3@ideasonboard.com> To: Mauro Carvalho Chehab , Luca Ceresoli , Andy Shevchenko , Laurent Pinchart , Sakari Ailus , Hans Verkuil , Satish Nagireddy , Matti Vaittinen Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Tomi Valkeinen X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1301; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=3zg0TxkVcXHwj80fcueaquBqUvRn/uJahEbl2HWcRHo=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBkuQ0FWYffPp2nMhTi2liX/2xEN899/vyaYUJJX yU9efkuiHyJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZLkNBQAKCRD6PaqMvJYe 9RPAD/47epS1smq6O8YL2r+cKuMGUA+uCmzry2xhn4N/I7X51aKRcgpq22drWpksdA8nKP81kCH WASbwl9eJnahZX37OWbDsAvLFJsU9oryaAkDooOp4lizGw/c8AjXlLrjsIt+3mjK+6EFKvmAMjP b+lulfsxM08Dbx7vivjtMVR72qed3+YoD/CS11CPK+Miq7FYqMzwWRivgyoPjAcqD5VXqd0uG43 cSpfrpx0N85dnvpjBwZ4V6cIdyaW61FCjsIPWX2CQsvcVrR5Rkf3xdy1b+s8SHfeuChe818j0Zj 9yB/QBDVO4ne9sGJHQ3Ke6PFGbcqM/4BQMGrUMqxz+H11WCNGbdsEb/swjUqHriec/fWuzlcVOO PKqAIdKWJBgMxINgkMB82cGxLnOLXV9cu3ZkOePqGu6mUMO+k1VKiLHZygPQe30MrdAm3qJblux ru3TGTn9ahKlgm7JkqVA+F/ENu3ESZvN3TsTyxCMf/My8CkCk0PUkxkVYR2O00/DxNn1sAnKaPi jwJfWbgiEbdxhQ+rpyK2WPwuW9f1eQlHrgaOTMYoVuLtmfFhaaCjJaPnYXPkqbsd2Vrc4rbLlJN dJsY6l42GtQ8jF2qXSxWVGMLyM50ErM0xU2KVhhqIyOzajwmLa1RV2Wfw1+JfGU9T94xv1t3K7Z qTS8JbfVtaLKXSw== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Handle V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK flag to configure the CSI-2 RX continuous/non-continuous clock register. Signed-off-by: Tomi Valkeinen --- drivers/media/i2c/ds90ub953.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/ds90ub953.c b/drivers/media/i2c/ds90ub953.c index ad964bd6c7eb..ad479923d2b4 100644 --- a/drivers/media/i2c/ds90ub953.c +++ b/drivers/media/i2c/ds90ub953.c @@ -138,6 +138,7 @@ struct ub953_data { struct regmap *regmap; u32 num_data_lanes; + bool non_cont_clk; struct gpio_chip gpio_chip; @@ -1139,6 +1140,9 @@ static int ub953_parse_dt(struct ub953_data *priv) priv->num_data_lanes = nlanes; + priv->non_cont_clk = vep.bus.mipi_csi2.flags & + V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK; + return 0; } @@ -1201,7 +1205,7 @@ static int ub953_hw_init(struct ub953_data *priv) return dev_err_probe(dev, ret, "i2c init failed\n"); ub953_write(priv, UB953_REG_GENERAL_CFG, - UB953_REG_GENERAL_CFG_CONT_CLK | + (priv->non_cont_clk ? 0 : UB953_REG_GENERAL_CFG_CONT_CLK) | ((priv->num_data_lanes - 1) << UB953_REG_GENERAL_CFG_CSI_LANE_SEL_SHIFT) | UB953_REG_GENERAL_CFG_CRC_TX_GEN_ENABLE); From patchwork Thu Jul 20 10:30:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 704809 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 66D60EB64DA for ; Thu, 20 Jul 2023 10:31:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231405AbjGTKb5 (ORCPT ); Thu, 20 Jul 2023 06:31:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229632AbjGTKbs (ORCPT ); Thu, 20 Jul 2023 06:31:48 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D82261719; Thu, 20 Jul 2023 03:31:46 -0700 (PDT) Received: from [127.0.1.1] (91-154-35-171.elisa-laajakaista.fi [91.154.35.171]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 71C1537B1; Thu, 20 Jul 2023 12:30:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1689849048; bh=Rur1IK4TcPD70743h/tvl3kOfm8iOTDAhEwetSWaWDY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=kTWD2/BOqU1mHDUETVmqL8Xqgc+KID6QJZTDOvsZViSS1WlREwDP2O7HQPiZhuBbE IqQj6taNn4vL14OwZZ0E8ZBBUjoHMCiGkJ7tunZqd+IkL6P41xgbNwnTFANABWs5eM y/syppZugjyabQMHPXi/e/yxxvfa/Fst76OxvvuE= From: Tomi Valkeinen Date: Thu, 20 Jul 2023 13:30:38 +0300 Subject: [PATCH v2 7/8] media: i2c: ds90ub953: Support non-sync mode MIME-Version: 1.0 Message-Id: <20230720-fpdlink-additions-v2-7-b91b1eca2ad3@ideasonboard.com> References: <20230720-fpdlink-additions-v2-0-b91b1eca2ad3@ideasonboard.com> In-Reply-To: <20230720-fpdlink-additions-v2-0-b91b1eca2ad3@ideasonboard.com> To: Mauro Carvalho Chehab , Luca Ceresoli , Andy Shevchenko , Laurent Pinchart , Sakari Ailus , Hans Verkuil , Satish Nagireddy , Matti Vaittinen Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Tomi Valkeinen X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2508; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=Rur1IK4TcPD70743h/tvl3kOfm8iOTDAhEwetSWaWDY=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBkuQ0GiP2nZraBbDa6yM3SKZJuVPbC4eCco1Cnr ATJOwBF2HGJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZLkNBgAKCRD6PaqMvJYe 9X7KD/9AUuDRNnHu+8MdFW0vpJ19RtR8/1MAfDzbJjDy/hW7fD/oBZvcnwVZ4M83XAzbi1uEjg6 znk7BsFaCw9LYOBd9WvU7mGfbcr6F6TH1ZWwRFMZhZE+ZE+aYTIEGppn0mmkgTXs8yeeJHHPEaw K3nvyntN1NyxfotbW2YrhzJ7nxDkvX/3fAE9ST/1jo59TKgkbDVeWyzD9f54zbUPGlqLcnoiiw9 Q/0+CvBpN9W33nLsoSHR6J5s2pvdObiXFzH7T8+QMUSoDkwaH5MU/qihWbPoAsMRx0TkdeBe9tx SyCGlrkCtNHKfFsNZvk8MV1ONk4AeZNflPEfcgrj2O5RANhvTFE5h5ybUdwxvkeW/NmvnAIdgjN uqDIj8F63hl1BclVZA1PzhL7gZvtOeUZ/bFs88ja/xF8F5U5ZngplyWmzTPy5PexY7A8Rckm5EQ bzUEIX/xhWqC7ESGr2clmY4deyy1UY2k4yx5rmriIflvt14PQdLA+99wPjbXABRRymNPqlygq6u lePxsFdB33QicHht0dwss9L0IDYeDOj6qT7k0s22ljX/ap9EJg3M57Xv8dFhpcHZvD76Qqpjx0U 7VMUgtY0AW3kEDtNhzwCvJ7gcgAxRxDUCyJJwPx3Q7Pq5yshOJJ4U9iSKmKCqzsTsr91tef0KY/ CFzBb21ty6PiVXQ== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Add support for FPD-Link non-sync mode with external clock. The only thing that needs to be added is the calculation for the clkout. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart --- drivers/media/i2c/ds90ub953.c | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/drivers/media/i2c/ds90ub953.c b/drivers/media/i2c/ds90ub953.c index 3a19c6dedd2f..846542e6e20d 100644 --- a/drivers/media/i2c/ds90ub953.c +++ b/drivers/media/i2c/ds90ub953.c @@ -143,6 +143,7 @@ struct ub953_data { struct i2c_client *client; struct regmap *regmap; + struct clk *clkin; u32 num_data_lanes; bool non_cont_clk; @@ -842,15 +843,21 @@ static int ub953_i2c_master_init(struct ub953_data *priv) static u64 ub953_get_fc_rate(struct ub953_data *priv) { - if (priv->mode != UB953_MODE_SYNC) { + switch (priv->mode) { + case UB953_MODE_SYNC: + if (priv->hw_data->is_ub971) + return priv->plat_data->bc_rate * 160ull; + else + return priv->plat_data->bc_rate / 2 * 160ull; + + case UB953_MODE_NONSYNC_EXT: + /* CLKIN_DIV = 1 always */ + return clk_get_rate(priv->clkin) * 80ull; + + default: /* Not supported */ return 0; } - - if (priv->hw_data->is_ub971) - return priv->plat_data->bc_rate * 160ull; - else - return priv->plat_data->bc_rate / 2 * 160ull; } static unsigned long ub953_calc_clkout_ub953(struct ub953_data *priv, @@ -1188,9 +1195,15 @@ static int ub953_hw_init(struct ub953_data *priv) dev_dbg(dev, "mode from %s: %#x\n", mode_override ? "reg" : "strap", priv->mode); - if (priv->mode != UB953_MODE_SYNC) + if (priv->mode != UB953_MODE_SYNC && + priv->mode != UB953_MODE_NONSYNC_EXT) return dev_err_probe(dev, -ENODEV, - "Only synchronous mode supported\n"); + "Unsupported mode selected: %d\n", + priv->mode); + + if (priv->mode == UB953_MODE_NONSYNC_EXT && !priv->clkin) + return dev_err_probe(dev, -EINVAL, + "clkin required for non-sync ext mode\n"); ret = ub953_read(priv, UB953_REG_REV_MASK_ID, &v); if (ret) @@ -1318,6 +1331,11 @@ static int ub953_probe(struct i2c_client *client) goto err_mutex_destroy; } + priv->clkin = devm_clk_get_optional(dev, "clkin"); + if (IS_ERR(priv->clkin)) + return dev_err_probe(dev, PTR_ERR(priv->clkin), + "failed to parse 'clkin'\n"); + ret = ub953_parse_dt(priv); if (ret) goto err_mutex_destroy; From patchwork Thu Jul 20 10:30:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 704808 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 581EAEB64DD for ; Thu, 20 Jul 2023 10:32:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231508AbjGTKcL (ORCPT ); Thu, 20 Jul 2023 06:32:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231426AbjGTKb4 (ORCPT ); Thu, 20 Jul 2023 06:31:56 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C7331726; Thu, 20 Jul 2023 03:31:49 -0700 (PDT) Received: from [127.0.1.1] (91-154-35-171.elisa-laajakaista.fi [91.154.35.171]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 530693809; Thu, 20 Jul 2023 12:30:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1689849049; bh=BnpBVZYY+/GA3ZmNzw9v9ygUo60Pbgode19CRNRPRs0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=ti9StKN/4g2CywLOTcOwwZvLuq5X93caF52kjjVcu9f0wTJ3NUHaKSB4/mjUNT4oc mimXgvQJbbJuSjKdo9DzgKKiw6R4GCpPvEpq3TikPJbWNv8NPsldFZT1ahBlKAnRZC i7aq46ob6LjgGLMszVxoIv/fKyajHJ3ahP/s2+7U= From: Tomi Valkeinen Date: Thu, 20 Jul 2023 13:30:39 +0300 Subject: [PATCH v2 8/8] media: i2c: ds90ub960: Rename RXPORT_MODE_CSI2_ASYNC to RXPORT_MODE_CSI2_NONSYNC MIME-Version: 1.0 Message-Id: <20230720-fpdlink-additions-v2-8-b91b1eca2ad3@ideasonboard.com> References: <20230720-fpdlink-additions-v2-0-b91b1eca2ad3@ideasonboard.com> In-Reply-To: <20230720-fpdlink-additions-v2-0-b91b1eca2ad3@ideasonboard.com> To: Mauro Carvalho Chehab , Luca Ceresoli , Andy Shevchenko , Laurent Pinchart , Sakari Ailus , Hans Verkuil , Satish Nagireddy , Matti Vaittinen Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Tomi Valkeinen X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=3438; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=BnpBVZYY+/GA3ZmNzw9v9ygUo60Pbgode19CRNRPRs0=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBkuQ0HPIOE/bsugJhJge9C5M30jkHGJVYVewFg6 LClJf5MKiSJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZLkNBwAKCRD6PaqMvJYe 9XjWD/9Jlpj1Kf468RDQ4MDKE+dX5gJTkcj384jqFJlPxnjlyX2et0g+PHE3NjKG7/HIBk0i5JP N0+ndA0hX7SDjyKsCmVtqNFN4mILbXN75QLxWwSiGd1O7ITtNN0E/sbkSGUXe6a5rjtZGdSGB0o fJDI57eU4tTaiIWbgscEUd8YUA4p+hzPo5FLye8Qd3aDJyR3WGIzKwWaqhfeMsopV3aXKvuZLMR DZyy4IH50xGTrxrHDl4vGfYaWEABhbm8VS5rQotXoHhvWkD3xHui1l0nYWu4XvAP+mDGwXIxzyo eDd5vgX+bue9GVrozgMMFMvo4tAyiCPG5w7Y837qjImE50IN7XhHQIW5N30pTK4sT6rYS+CHzxx 3i7hvt5Y+dg8qVzqjGPROjsqNskC6ndLWhzxoIquUCMRvXmmDSc6sygviUlKWtywEbNvidPXr8U 6kKN5cHorkI9x21kAA8VVRXf3SVyO2TMNTBglXq11H4Y8BdBe27mSWfZCXL08gcLOvPe5Ku/am+ LnYga/IeDPQiXstGTeovpdMmHvrZkWnRxSTML0NUdLvRzUNfb3lID1OQGxFd0kIOzE2s7Hs+f0h DSHZW/DTwep6quF1r7jj98u0q8dq8fN3eMjvb26xaSEvbbxGU3u3LlKJAlzE326CkasdULWSGHH oiDrsBBVX19Ww1w== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org FPD-Link has an operating mode that used to be called "asynchronous" in the hardware documentation, but that has been changed to non-synchronous already quite a while back. The ub960 driver still had one instance of the old naming, so let's rename it. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart --- drivers/media/i2c/ds90ub960.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/media/i2c/ds90ub960.c b/drivers/media/i2c/ds90ub960.c index ea819fb6e99b..2ed4d4763a02 100644 --- a/drivers/media/i2c/ds90ub960.c +++ b/drivers/media/i2c/ds90ub960.c @@ -415,8 +415,8 @@ enum ub960_rxport_mode { RXPORT_MODE_RAW12_HF = 1, RXPORT_MODE_RAW12_LF = 2, RXPORT_MODE_CSI2_SYNC = 3, - RXPORT_MODE_CSI2_ASYNC = 4, - RXPORT_MODE_LAST = RXPORT_MODE_CSI2_ASYNC, + RXPORT_MODE_CSI2_NONSYNC = 4, + RXPORT_MODE_LAST = RXPORT_MODE_CSI2_NONSYNC, }; enum ub960_rxport_cdr { @@ -1609,7 +1609,7 @@ static unsigned long ub960_calc_bc_clk_rate_ub960(struct ub960_data *priv, div = 1; break; - case RXPORT_MODE_CSI2_ASYNC: + case RXPORT_MODE_CSI2_NONSYNC: mult = 2; div = 5; break; @@ -1633,7 +1633,7 @@ static unsigned long ub960_calc_bc_clk_rate_ub9702(struct ub960_data *priv, case RXPORT_MODE_CSI2_SYNC: return 47187500; - case RXPORT_MODE_CSI2_ASYNC: + case RXPORT_MODE_CSI2_NONSYNC: return 9437500; default: @@ -1840,7 +1840,7 @@ static void ub960_init_rx_port_ub960(struct ub960_data *priv, bc_freq_val = 0; break; - case RXPORT_MODE_CSI2_ASYNC: + case RXPORT_MODE_CSI2_NONSYNC: bc_freq_val = 2; break; @@ -1878,7 +1878,7 @@ static void ub960_init_rx_port_ub960(struct ub960_data *priv, return; case RXPORT_MODE_CSI2_SYNC: - case RXPORT_MODE_CSI2_ASYNC: + case RXPORT_MODE_CSI2_NONSYNC: /* CSI-2 Mode (DS90UB953-Q1 compatible) */ ub960_rxport_update_bits(priv, nport, UB960_RR_PORT_CONFIG, 0x3, 0x0); @@ -1938,7 +1938,7 @@ static void ub960_init_rx_port_ub9702_fpd3(struct ub960_data *priv, fpd_func_mode = 2; break; - case RXPORT_MODE_CSI2_ASYNC: + case RXPORT_MODE_CSI2_NONSYNC: bc_freq_val = 2; fpd_func_mode = 2; break; @@ -2032,7 +2032,7 @@ static void ub960_init_rx_port_ub9702_fpd4(struct ub960_data *priv, bc_freq_val = 6; break; - case RXPORT_MODE_CSI2_ASYNC: + case RXPORT_MODE_CSI2_NONSYNC: bc_freq_val = 2; break; @@ -2098,7 +2098,7 @@ static void ub960_init_rx_port_ub9702(struct ub960_data *priv, return; case RXPORT_MODE_CSI2_SYNC: - case RXPORT_MODE_CSI2_ASYNC: + case RXPORT_MODE_CSI2_NONSYNC: break; } @@ -2444,7 +2444,7 @@ static int ub960_configure_ports_for_streaming(struct ub960_data *priv, /* For the rest, we are only interested in parallel busses */ if (rxport->rx_mode == RXPORT_MODE_CSI2_SYNC || - rxport->rx_mode == RXPORT_MODE_CSI2_ASYNC) + rxport->rx_mode == RXPORT_MODE_CSI2_NONSYNC) continue; if (rx_data[nport].num_streams > 2) @@ -2508,7 +2508,7 @@ static int ub960_configure_ports_for_streaming(struct ub960_data *priv, break; case RXPORT_MODE_CSI2_SYNC: - case RXPORT_MODE_CSI2_ASYNC: + case RXPORT_MODE_CSI2_NONSYNC: if (!priv->hw_data->is_ub9702) { /* Map all VCs from this port to the same VC */ ub960_rxport_write(priv, nport, UB960_RR_CSI_VC_MAP,