2023-11-18 12:41:22

by Satya Priya Kakitapalli

[permalink] [raw]
Subject: [PATCH V2 0/4] Add runtime PM support for videocc on SM8150

Add runtime support for videocc on SM8150 and update the resets
and video_pll0_config configuration.

Satya Priya Kakitapalli (4):
dt-bindings: clock: Update the videocc resets for sm8150
clk: qcom: videocc-sm8150: Update the videocc resets
clk: qcom: videocc-sm8150: Add missing PLL config properties
clk: qcom: videocc-sm8150: Add runtime PM support

drivers/clk/qcom/videocc-sm8150.c | 25 +++++++++++++++++--
.../dt-bindings/clock/qcom,videocc-sm8150.h | 4 +++
2 files changed, 27 insertions(+), 2 deletions(-)

--
2.25.1


2023-11-18 12:41:24

by Satya Priya Kakitapalli

[permalink] [raw]
Subject: [PATCH V2 1/4] dt-bindings: clock: Update the videocc resets for sm8150

Add all the available resets for the video clock controller
on sm8150.

Signed-off-by: Satya Priya Kakitapalli <[email protected]>
Acked-by: Krzysztof Kozlowski <[email protected]>
---
Changes since v1:
- None.

include/dt-bindings/clock/qcom,videocc-sm8150.h | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/include/dt-bindings/clock/qcom,videocc-sm8150.h b/include/dt-bindings/clock/qcom,videocc-sm8150.h
index e24ee840cfdb..c557b78dc572 100644
--- a/include/dt-bindings/clock/qcom,videocc-sm8150.h
+++ b/include/dt-bindings/clock/qcom,videocc-sm8150.h
@@ -16,6 +16,10 @@

/* VIDEO_CC Resets */
#define VIDEO_CC_MVSC_CORE_CLK_BCR 0
+#define VIDEO_CC_INTERFACE_BCR 1
+#define VIDEO_CC_MVS0_BCR 2
+#define VIDEO_CC_MVS1_BCR 3
+#define VIDEO_CC_MVSC_BCR 4

/* VIDEO_CC GDSCRs */
#define VENUS_GDSC 0
--
2.25.1

2023-11-18 12:42:11

by Satya Priya Kakitapalli

[permalink] [raw]
Subject: [PATCH V2 3/4] clk: qcom: videocc-sm8150: Add missing PLL config property

When the driver was ported upstream, PLL test_ctl_hi1 register value
was omitted. Add it to ensure the PLLs are fully configured.

Fixes: 5658e8cf1a8a ("clk: qcom: add video clock controller driver for SM8150")
Signed-off-by: Satya Priya Kakitapalli <[email protected]>
---
Changes since v1:
- Removed updating the test_ctl_hi_val, because as per latest HW recommendation
its value is 0x0 which is same as PoR and hence no need to update it.
- Keeping test_ctl_hi1_val same as before(v1).

drivers/clk/qcom/videocc-sm8150.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/clk/qcom/videocc-sm8150.c b/drivers/clk/qcom/videocc-sm8150.c
index 6a5f89f53da8..52a9a453a143 100644
--- a/drivers/clk/qcom/videocc-sm8150.c
+++ b/drivers/clk/qcom/videocc-sm8150.c
@@ -33,6 +33,7 @@ static struct alpha_pll_config video_pll0_config = {
.config_ctl_val = 0x20485699,
.config_ctl_hi_val = 0x00002267,
.config_ctl_hi1_val = 0x00000024,
+ .test_ctl_hi1_val = 0x00000020,
.user_ctl_val = 0x00000000,
.user_ctl_hi_val = 0x00000805,
.user_ctl_hi1_val = 0x000000D0,
--
2.25.1

2023-11-18 12:42:11

by Satya Priya Kakitapalli

[permalink] [raw]
Subject: [PATCH V2 4/4] clk: qcom: videocc-sm8150: Add runtime PM support

Add runtime PM support to ensure the supply rails are enabled
when necessary.

Signed-off-by: Satya Priya Kakitapalli <[email protected]>
---
Changes since v1:
- None.

drivers/clk/qcom/videocc-sm8150.c | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/qcom/videocc-sm8150.c b/drivers/clk/qcom/videocc-sm8150.c
index 52a9a453a143..b57df5ff96c4 100644
--- a/drivers/clk/qcom/videocc-sm8150.c
+++ b/drivers/clk/qcom/videocc-sm8150.c
@@ -6,6 +6,7 @@
#include <linux/clk-provider.h>
#include <linux/module.h>
#include <linux/platform_device.h>
+#include <linux/pm_runtime.h>
#include <linux/regmap.h>

#include <dt-bindings/clock/qcom,videocc-sm8150.h>
@@ -240,17 +241,32 @@ MODULE_DEVICE_TABLE(of, video_cc_sm8150_match_table);
static int video_cc_sm8150_probe(struct platform_device *pdev)
{
struct regmap *regmap;
+ int ret;
+
+ ret = devm_pm_runtime_enable(&pdev->dev);
+ if (ret)
+ return ret;
+
+ ret = pm_runtime_resume_and_get(&pdev->dev);
+ if (ret)
+ return ret;

regmap = qcom_cc_map(pdev, &video_cc_sm8150_desc);
- if (IS_ERR(regmap))
+ if (IS_ERR(regmap)) {
+ pm_runtime_put(&pdev->dev);
return PTR_ERR(regmap);
+ }

clk_trion_pll_configure(&video_pll0, regmap, &video_pll0_config);

/* Keep VIDEO_CC_XO_CLK ALWAYS-ON */
regmap_update_bits(regmap, 0x984, 0x1, 0x1);

- return qcom_cc_really_probe(pdev, &video_cc_sm8150_desc, regmap);
+ ret = qcom_cc_really_probe(pdev, &video_cc_sm8150_desc, regmap);
+
+ pm_runtime_put(&pdev->dev);
+
+ return ret;
}

static struct platform_driver video_cc_sm8150_driver = {
--
2.25.1

2023-11-20 11:48:47

by Konrad Dybcio

[permalink] [raw]
Subject: Re: [PATCH V2 0/4] Add runtime PM support for videocc on SM8150

On 18.11.2023 13:39, Satya Priya Kakitapalli wrote:
> Add runtime support for videocc on SM8150 and update the resets
> and video_pll0_config configuration.
>
> Satya Priya Kakitapalli (4):
> dt-bindings: clock: Update the videocc resets for sm8150
> clk: qcom: videocc-sm8150: Update the videocc resets
> clk: qcom: videocc-sm8150: Add missing PLL config properties
> clk: qcom: videocc-sm8150: Add runtime PM support
Hi, it's good practive to include a link to the previous revision
and a summary of changes.

The b4 tool [1] does that for you, please consider using it.

Konrad

[1] https://b4.docs.kernel.org/en/latest/index.html

2023-11-20 11:49:48

by Konrad Dybcio

[permalink] [raw]
Subject: Re: [PATCH V2 3/4] clk: qcom: videocc-sm8150: Add missing PLL config property

On 18.11.2023 13:39, Satya Priya Kakitapalli wrote:
> When the driver was ported upstream, PLL test_ctl_hi1 register value
> was omitted. Add it to ensure the PLLs are fully configured.
>
> Fixes: 5658e8cf1a8a ("clk: qcom: add video clock controller driver for SM8150")
> Signed-off-by: Satya Priya Kakitapalli <[email protected]>
> ---
Reviewed-by: Konrad Dybcio <[email protected]>

Konrad

2023-11-22 20:03:41

by Konrad Dybcio

[permalink] [raw]
Subject: Re: [PATCH V2 4/4] clk: qcom: videocc-sm8150: Add runtime PM support



On 11/18/23 13:39, Satya Priya Kakitapalli wrote:
> Add runtime PM support to ensure the supply rails are enabled
> when necessary.
>
> Signed-off-by: Satya Priya Kakitapalli <[email protected]>
> ---
> Changes since v1:
> - None.
>
> drivers/clk/qcom/videocc-sm8150.c | 20 ++++++++++++++++++--
> 1 file changed, 18 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/clk/qcom/videocc-sm8150.c b/drivers/clk/qcom/videocc-sm8150.c
> index 52a9a453a143..b57df5ff96c4 100644
> --- a/drivers/clk/qcom/videocc-sm8150.c
> +++ b/drivers/clk/qcom/videocc-sm8150.c
> @@ -6,6 +6,7 @@
> #include <linux/clk-provider.h>
> #include <linux/module.h>
> #include <linux/platform_device.h>
> +#include <linux/pm_runtime.h>
> #include <linux/regmap.h>
>
> #include <dt-bindings/clock/qcom,videocc-sm8150.h>
> @@ -240,17 +241,32 @@ MODULE_DEVICE_TABLE(of, video_cc_sm8150_match_table);
> static int video_cc_sm8150_probe(struct platform_device *pdev)
> {
> struct regmap *regmap;
> + int ret;
> +
> + ret = devm_pm_runtime_enable(&pdev->dev);
> + if (ret)
> + return ret;
> +
> + ret = pm_runtime_resume_and_get(&pdev->dev);
> + if (ret)
> + return ret;
>
> regmap = qcom_cc_map(pdev, &video_cc_sm8150_desc);
> - if (IS_ERR(regmap))
> + if (IS_ERR(regmap)) {
> + pm_runtime_put(&pdev->dev);
Shouldn't this be _sync?

Konrad

2023-11-24 11:34:55

by Satya Priya Kakitapalli

[permalink] [raw]
Subject: Re: [PATCH V2 4/4] clk: qcom: videocc-sm8150: Add runtime PM support


On 11/23/2023 1:31 AM, Konrad Dybcio wrote:
>
>
> On 11/18/23 13:39, Satya Priya Kakitapalli wrote:
>> Add runtime PM support to ensure the supply rails are enabled
>> when necessary.
>>
>> Signed-off-by: Satya Priya Kakitapalli <[email protected]>
>> ---
>> Changes since v1:
>>   - None.
>>
>>   drivers/clk/qcom/videocc-sm8150.c | 20 ++++++++++++++++++--
>>   1 file changed, 18 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/clk/qcom/videocc-sm8150.c
>> b/drivers/clk/qcom/videocc-sm8150.c
>> index 52a9a453a143..b57df5ff96c4 100644
>> --- a/drivers/clk/qcom/videocc-sm8150.c
>> +++ b/drivers/clk/qcom/videocc-sm8150.c
>> @@ -6,6 +6,7 @@
>>   #include <linux/clk-provider.h>
>>   #include <linux/module.h>
>>   #include <linux/platform_device.h>
>> +#include <linux/pm_runtime.h>
>>   #include <linux/regmap.h>
>>     #include <dt-bindings/clock/qcom,videocc-sm8150.h>
>> @@ -240,17 +241,32 @@ MODULE_DEVICE_TABLE(of,
>> video_cc_sm8150_match_table);
>>   static int video_cc_sm8150_probe(struct platform_device *pdev)
>>   {
>>       struct regmap *regmap;
>> +    int ret;
>> +
>> +    ret = devm_pm_runtime_enable(&pdev->dev);
>> +    if (ret)
>> +        return ret;
>> +
>> +    ret = pm_runtime_resume_and_get(&pdev->dev);
>> +    if (ret)
>> +        return ret;
>>         regmap = qcom_cc_map(pdev, &video_cc_sm8150_desc);
>> -    if (IS_ERR(regmap))
>> +    if (IS_ERR(regmap)) {
>> +        pm_runtime_put(&pdev->dev);
> Shouldn't this be _sync?
>

Yes, will update it on v2


> Konrad

2023-11-28 16:12:19

by Satya Priya Kakitapalli

[permalink] [raw]
Subject: Re: [PATCH V2 0/4] Add runtime PM support for videocc on SM8150


On 11/20/2023 5:18 PM, Konrad Dybcio wrote:
> On 18.11.2023 13:39, Satya Priya Kakitapalli wrote:
>> Add runtime support for videocc on SM8150 and update the resets
>> and video_pll0_config configuration.
>>
>> Satya Priya Kakitapalli (4):
>> dt-bindings: clock: Update the videocc resets for sm8150
>> clk: qcom: videocc-sm8150: Update the videocc resets
>> clk: qcom: videocc-sm8150: Add missing PLL config properties
>> clk: qcom: videocc-sm8150: Add runtime PM support
> Hi, it's good practive to include a link to the previous revision
> and a summary of changes.
>
> The b4 tool [1] does that for you, please consider using it.


Hi, I have installed b4 and followed all the steps, but it doesn't
populate my cover letter with change log and previous series link, do i
need to use some option for that?


> Konrad
>
> [1] https://b4.docs.kernel.org/en/latest/index.html

2023-11-29 14:01:45

by Konrad Dybcio

[permalink] [raw]
Subject: Re: [PATCH V2 0/4] Add runtime PM support for videocc on SM8150

On 28.11.2023 17:11, Satya Priya Kakitapalli (Temp) wrote:
>
> On 11/20/2023 5:18 PM, Konrad Dybcio wrote:
>> On 18.11.2023 13:39, Satya Priya Kakitapalli wrote:
>>> Add runtime support for videocc on SM8150 and update the resets
>>> and video_pll0_config configuration.
>>>
>>> Satya Priya Kakitapalli (4):
>>>    dt-bindings: clock: Update the videocc resets for sm8150
>>>    clk: qcom: videocc-sm8150: Update the videocc resets
>>>    clk: qcom: videocc-sm8150: Add missing PLL config properties
>>>    clk: qcom: videocc-sm8150: Add runtime PM support
>> Hi, it's good practive to include a link to the previous revision
>> and a summary of changes.
>>
>> The b4 tool [1] does that for you, please consider using it.
>
>
> Hi, I have installed b4 and followed all the steps, but it doesn't populate my cover letter with change log and previous series link, do i need to use some option for that?
You probably did something like this:

b4 prep -n 8150vidcc --from-thread [email protected]

Then if you do:

b4 prep --edit-cover

you'll see a note like

EDITME: Imported from [email protected]
Please review before sending.

so you need to do it manually.


Generally, when the series has been sent at least once with b4 already,
you'll notice that `b4 send` appends something like this to the cover
letter:

Changes in v2:
- EDITME: describe what is new in this series revision.
- EDITME: use bulletpoints and terse descriptions.
- Link to v1: https://lore.kernel.org/r/[email protected]


This should be only necessary to do by hand once, since as mentioned it's
the first time b4 sees this series


Konrad

2023-12-01 09:19:44

by Satya Priya Kakitapalli

[permalink] [raw]
Subject: Re: [PATCH V2 0/4] Add runtime PM support for videocc on SM8150


On 11/29/2023 7:30 PM, Konrad Dybcio wrote:
> On 28.11.2023 17:11, Satya Priya Kakitapalli (Temp) wrote:
>> On 11/20/2023 5:18 PM, Konrad Dybcio wrote:
>>> On 18.11.2023 13:39, Satya Priya Kakitapalli wrote:
>>>> Add runtime support for videocc on SM8150 and update the resets
>>>> and video_pll0_config configuration.
>>>>
>>>> Satya Priya Kakitapalli (4):
>>>>    dt-bindings: clock: Update the videocc resets for sm8150
>>>>    clk: qcom: videocc-sm8150: Update the videocc resets
>>>>    clk: qcom: videocc-sm8150: Add missing PLL config properties
>>>>    clk: qcom: videocc-sm8150: Add runtime PM support
>>> Hi, it's good practive to include a link to the previous revision
>>> and a summary of changes.
>>>
>>> The b4 tool [1] does that for you, please consider using it.
>>
>> Hi, I have installed b4 and followed all the steps, but it doesn't populate my cover letter with change log and previous series link, do i need to use some option for that?
> You probably did something like this:
>
> b4 prep -n 8150vidcc --from-thread [email protected]
>
> Then if you do:
>
> b4 prep --edit-cover
>
> you'll see a note like
>
> EDITME: Imported from [email protected]
> Please review before sending.
>
> so you need to do it manually.
>
>
> Generally, when the series has been sent at least once with b4 already,
> you'll notice that `b4 send` appends something like this to the cover
> letter:
>
> Changes in v2:
> - EDITME: describe what is new in this series revision.
> - EDITME: use bulletpoints and terse descriptions.
> - Link to v1: https://lore.kernel.org/r/[email protected]
>
>
> This should be only necessary to do by hand once, since as mentioned it's
> the first time b4 sees this series
>

Thanks for the information, will add them manually.


> Konrad