diff mbox

[v2,2/5] clk: mediatek: modify MT7622 audsys to adapt MFD device

Message ID d6669277f5232446b4798a6b724074b18d5c21aa.1515639336.git.ryder.lee@mediatek.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ryder Lee Jan. 31, 2018, 7:42 a.m. UTC
As the new MFD parent is in place, switch probing method to adapt it.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
---
 drivers/clk/mediatek/clk-mt7622-aud.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Matthias Brugger Feb. 3, 2018, 2:26 p.m. UTC | #1
On 01/31/2018 08:42 AM, Ryder Lee wrote:
> As the new MFD parent is in place, switch probing method to adapt it.
> 
> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
> ---
>  drivers/clk/mediatek/clk-mt7622-aud.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/mediatek/clk-mt7622-aud.c b/drivers/clk/mediatek/clk-mt7622-aud.c
> index 13f752d..8c18536 100644
> --- a/drivers/clk/mediatek/clk-mt7622-aud.c
> +++ b/drivers/clk/mediatek/clk-mt7622-aud.c
> @@ -142,11 +142,12 @@ static int clk_mt7622_audiosys_init(struct platform_device *pdev)
>  {
>  	struct clk_onecell_data *clk_data;
>  	struct device_node *node = pdev->dev.of_node;
> +	struct device_node *pnode = pdev->dev.parent->of_node;
>  	int r;
>  
>  	clk_data = mtk_alloc_clk_data(CLK_AUDIO_NR_CLK);
>  
> -	mtk_clk_register_gates(node, audio_clks, ARRAY_SIZE(audio_clks),
> +	mtk_clk_register_gates(pnode, audio_clks, ARRAY_SIZE(audio_clks),

We will need a fallback here for older device tree bindings.

Regards,
Matthias

>  			       clk_data);
>  
>  	r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
>
Matthias Brugger Feb. 7, 2018, 3:18 p.m. UTC | #2
On 02/05/2018 05:07 AM, Ryder Lee wrote:
> On Sat, 2018-02-03 at 15:26 +0100, Matthias Brugger wrote:
>>
>> On 01/31/2018 08:42 AM, Ryder Lee wrote:
>>> As the new MFD parent is in place, switch probing method to adapt it.
>>>
>>> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
>>> ---
>>>  drivers/clk/mediatek/clk-mt7622-aud.c | 3 ++-
>>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/clk/mediatek/clk-mt7622-aud.c b/drivers/clk/mediatek/clk-mt7622-aud.c
>>> index 13f752d..8c18536 100644
>>> --- a/drivers/clk/mediatek/clk-mt7622-aud.c
>>> +++ b/drivers/clk/mediatek/clk-mt7622-aud.c
>>> @@ -142,11 +142,12 @@ static int clk_mt7622_audiosys_init(struct platform_device *pdev)
>>>  {
>>>  	struct clk_onecell_data *clk_data;
>>>  	struct device_node *node = pdev->dev.of_node;
>>> +	struct device_node *pnode = pdev->dev.parent->of_node;
>>>  	int r;
>>>  
>>>  	clk_data = mtk_alloc_clk_data(CLK_AUDIO_NR_CLK);
>>>  
>>> -	mtk_clk_register_gates(node, audio_clks, ARRAY_SIZE(audio_clks),
>>> +	mtk_clk_register_gates(pnode, audio_clks, ARRAY_SIZE(audio_clks),
>>
>> We will need a fallback here for older device tree bindings.
>>
>> Regards,
>> Matthias
> 
> Up to now, I didn't see both driver and bindings are used anywhere.
> Should I still care about that?
> 

Yes please, we have to ensure that newer kernel work with older bindings and
vice-versa.

Thanks,
Matthias
Ryder Lee Feb. 8, 2018, 5:57 a.m. UTC | #3
On Wed, 2018-02-07 at 16:18 +0100, Matthias Brugger wrote:
> 
> On 02/05/2018 05:07 AM, Ryder Lee wrote:
> > On Sat, 2018-02-03 at 15:26 +0100, Matthias Brugger wrote:
> >>
> >> On 01/31/2018 08:42 AM, Ryder Lee wrote:
> >>> As the new MFD parent is in place, switch probing method to adapt it.
> >>>
> >>> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
> >>> ---
> >>>  drivers/clk/mediatek/clk-mt7622-aud.c | 3 ++-
> >>>  1 file changed, 2 insertions(+), 1 deletion(-)
> >>>
> >>> diff --git a/drivers/clk/mediatek/clk-mt7622-aud.c b/drivers/clk/mediatek/clk-mt7622-aud.c
> >>> index 13f752d..8c18536 100644
> >>> --- a/drivers/clk/mediatek/clk-mt7622-aud.c
> >>> +++ b/drivers/clk/mediatek/clk-mt7622-aud.c
> >>> @@ -142,11 +142,12 @@ static int clk_mt7622_audiosys_init(struct platform_device *pdev)
> >>>  {
> >>>  	struct clk_onecell_data *clk_data;
> >>>  	struct device_node *node = pdev->dev.of_node;
> >>> +	struct device_node *pnode = pdev->dev.parent->of_node;
> >>>  	int r;
> >>>  
> >>>  	clk_data = mtk_alloc_clk_data(CLK_AUDIO_NR_CLK);
> >>>  
> >>> -	mtk_clk_register_gates(node, audio_clks, ARRAY_SIZE(audio_clks),
> >>> +	mtk_clk_register_gates(pnode, audio_clks, ARRAY_SIZE(audio_clks),
> >>
> >> We will need a fallback here for older device tree bindings.
> >>
> >> Regards,
> >> Matthias
> > 
> > Up to now, I didn't see both driver and bindings are used anywhere.
> > Should I still care about that?
> > 
> 
> Yes please, we have to ensure that newer kernel work with older bindings and
> vice-versa.

OKay. An unrelated question - is it possible to change the compatible
string (*-audsys-clk) without breaking backward compatible?
Matthias Brugger Feb. 9, 2018, 1:24 p.m. UTC | #4
On 02/08/2018 06:57 AM, Ryder Lee wrote:
> On Wed, 2018-02-07 at 16:18 +0100, Matthias Brugger wrote:
>>
>> On 02/05/2018 05:07 AM, Ryder Lee wrote:
>>> On Sat, 2018-02-03 at 15:26 +0100, Matthias Brugger wrote:
>>>>
>>>> On 01/31/2018 08:42 AM, Ryder Lee wrote:
>>>>> As the new MFD parent is in place, switch probing method to adapt it.
>>>>>
>>>>> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
>>>>> ---
>>>>>  drivers/clk/mediatek/clk-mt7622-aud.c | 3 ++-
>>>>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/drivers/clk/mediatek/clk-mt7622-aud.c b/drivers/clk/mediatek/clk-mt7622-aud.c
>>>>> index 13f752d..8c18536 100644
>>>>> --- a/drivers/clk/mediatek/clk-mt7622-aud.c
>>>>> +++ b/drivers/clk/mediatek/clk-mt7622-aud.c
>>>>> @@ -142,11 +142,12 @@ static int clk_mt7622_audiosys_init(struct platform_device *pdev)
>>>>>  {
>>>>>  	struct clk_onecell_data *clk_data;
>>>>>  	struct device_node *node = pdev->dev.of_node;
>>>>> +	struct device_node *pnode = pdev->dev.parent->of_node;
>>>>>  	int r;
>>>>>  
>>>>>  	clk_data = mtk_alloc_clk_data(CLK_AUDIO_NR_CLK);
>>>>>  
>>>>> -	mtk_clk_register_gates(node, audio_clks, ARRAY_SIZE(audio_clks),
>>>>> +	mtk_clk_register_gates(pnode, audio_clks, ARRAY_SIZE(audio_clks),
>>>>
>>>> We will need a fallback here for older device tree bindings.
>>>>
>>>> Regards,
>>>> Matthias
>>>
>>> Up to now, I didn't see both driver and bindings are used anywhere.
>>> Should I still care about that?
>>>
>>
>> Yes please, we have to ensure that newer kernel work with older bindings and
>> vice-versa.
> 
> OKay. An unrelated question - is it possible to change the compatible
> string (*-audsys-clk) without breaking backward compatible?
> 

You can't change the compatible string, but you can add a new one, if the DT
maintainer are ok with that. Beware that you won't be able to re-use the old one
in a different driver.

Regards,
Matthias
diff mbox

Patch

diff --git a/drivers/clk/mediatek/clk-mt7622-aud.c b/drivers/clk/mediatek/clk-mt7622-aud.c
index 13f752d..8c18536 100644
--- a/drivers/clk/mediatek/clk-mt7622-aud.c
+++ b/drivers/clk/mediatek/clk-mt7622-aud.c
@@ -142,11 +142,12 @@  static int clk_mt7622_audiosys_init(struct platform_device *pdev)
 {
 	struct clk_onecell_data *clk_data;
 	struct device_node *node = pdev->dev.of_node;
+	struct device_node *pnode = pdev->dev.parent->of_node;
 	int r;
 
 	clk_data = mtk_alloc_clk_data(CLK_AUDIO_NR_CLK);
 
-	mtk_clk_register_gates(node, audio_clks, ARRAY_SIZE(audio_clks),
+	mtk_clk_register_gates(pnode, audio_clks, ARRAY_SIZE(audio_clks),
 			       clk_data);
 
 	r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);