bc4dcc43c52ccba33777857b5406bbd5d7984e46
[openwrt/staging/ansuel.git] /
1 From 6d6d0783a96c6a4eeeef42039bfd5ac23f2575f1 Mon Sep 17 00:00:00 2001
2 From: Naushir Patuck <naush@raspberrypi.com>
3 Date: Fri, 31 Mar 2023 15:05:33 +0100
4 Subject: [PATCH] drivers: media: imx708: Follow the standard
5 devicetree labels
6
7 Switch the system clock name from "xclk" to "inclk".
8 Use lower case lables for all regulator names.
9
10 Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
11 ---
12 drivers/media/i2c/imx708.c | 36 ++++++++++++++++++------------------
13 1 file changed, 18 insertions(+), 18 deletions(-)
14
15 --- a/drivers/media/i2c/imx708.c
16 +++ b/drivers/media/i2c/imx708.c
17 @@ -33,7 +33,7 @@
18
19 #define IMX708_REG_ORIENTATION 0x101
20
21 -#define IMX708_XCLK_FREQ 24000000
22 +#define IMX708_INCLK_FREQ 24000000
23
24 /* Default initial pixel rate, will get updated for each mode. */
25 #define IMX708_INITIAL_PIXEL_RATE 590000000
26 @@ -786,10 +786,10 @@ static const int imx708_test_pattern_val
27 /* regulator supplies */
28 static const char * const imx708_supply_name[] = {
29 /* Supplies can be enabled in any order */
30 - "VANA1", /* Analog1 (2.8V) supply */
31 - "VANA2", /* Analog2 (1.8V) supply */
32 - "VDIG", /* Digital Core (1.1V) supply */
33 - "VDDL", /* IF (1.8V) supply */
34 + "vana1", /* Analog1 (2.8V) supply */
35 + "vana2", /* Analog2 (1.8V) supply */
36 + "vdig", /* Digital Core (1.1V) supply */
37 + "vddl", /* IF (1.8V) supply */
38 };
39
40 /*
41 @@ -809,8 +809,8 @@ struct imx708 {
42
43 struct v4l2_mbus_framefmt fmt;
44
45 - struct clk *xclk;
46 - u32 xclk_freq;
47 + struct clk *inclk;
48 + u32 inclk_freq;
49
50 struct gpio_desc *reset_gpio;
51 struct regulator_bulk_data supplies[ARRAY_SIZE(imx708_supply_name)];
52 @@ -1602,7 +1602,7 @@ static int imx708_power_on(struct device
53 return ret;
54 }
55
56 - ret = clk_prepare_enable(imx708->xclk);
57 + ret = clk_prepare_enable(imx708->inclk);
58 if (ret) {
59 dev_err(&client->dev, "%s: failed to enable clock\n",
60 __func__);
61 @@ -1630,7 +1630,7 @@ static int imx708_power_off(struct devic
62 gpiod_set_value_cansleep(imx708->reset_gpio, 0);
63 regulator_bulk_disable(ARRAY_SIZE(imx708_supply_name),
64 imx708->supplies);
65 - clk_disable_unprepare(imx708->xclk);
66 + clk_disable_unprepare(imx708->inclk);
67
68 /* Force reprogramming of the common registers when powered up again. */
69 imx708->common_regs_written = false;
70 @@ -1951,17 +1951,17 @@ static int imx708_probe(struct i2c_clien
71 if (imx708_check_hwcfg(dev, imx708))
72 return -EINVAL;
73
74 - /* Get system clock (xclk) */
75 - imx708->xclk = devm_clk_get(dev, NULL);
76 - if (IS_ERR(imx708->xclk))
77 - return dev_err_probe(dev, PTR_ERR(imx708->xclk),
78 - "failed to get xclk\n");
79 + /* Get system clock (inclk) */
80 + imx708->inclk = devm_clk_get(dev, "inclk");
81 + if (IS_ERR(imx708->inclk))
82 + return dev_err_probe(dev, PTR_ERR(imx708->inclk),
83 + "failed to get inclk\n");
84
85 - imx708->xclk_freq = clk_get_rate(imx708->xclk);
86 - if (imx708->xclk_freq != IMX708_XCLK_FREQ)
87 + imx708->inclk_freq = clk_get_rate(imx708->inclk);
88 + if (imx708->inclk_freq != IMX708_INCLK_FREQ)
89 return dev_err_probe(dev, -EINVAL,
90 - "xclk frequency not supported: %d Hz\n",
91 - imx708->xclk_freq);
92 + "inclk frequency not supported: %d Hz\n",
93 + imx708->inclk_freq);
94
95 ret = imx708_get_regulators(imx708);
96 if (ret)