diff mbox

[v4,03/15] drm: rockchip/dw_hdmi_rockchip: add resume/suspend support

Message ID 1425177128-1844-1-git-send-email-ykk@rock-chips.com (mailing list archive)
State New, archived
Headers show

Commit Message

Yakir Yang March 1, 2015, 2:32 a.m. UTC
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
---
Changes in v4: None
Changes in v3:
- Setting the .pm member instead of suspend/resume

Changes in v2:
- Add suspend/resume support for dw_hdmi_rockchip driver

 drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

Comments

Philipp Zabel March 12, 2015, 10:24 a.m. UTC | #1
Am Samstag, den 28.02.2015, 21:32 -0500 schrieb Yakir Yang:
> Signed-off-by: Yakir Yang <ykk@rock-chips.com>
> ---
> Changes in v4: None
> Changes in v3:
> - Setting the .pm member instead of suspend/resume
> 
> Changes in v2:
> - Add suspend/resume support for dw_hdmi_rockchip driver
> 
>  drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
> index d236faa..fc1d02e 100644
> --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
> +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
> @@ -323,11 +323,27 @@ static int dw_hdmi_rockchip_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> +static int dw_hdmi_rockchip_suspend(struct device *dev)
> +{
> +	return dw_hdmi_suspend(dev);
> +}
> +
> +static int dw_hdmi_rockchip_resume(struct device *dev)
> +{
> +	return dw_hdmi_resume(dev);
> +}

You could just skip dw_hdmi_rockchip_suspend/resume and
set .suspend/.resume in dw_hdmi_rockchip_pm directly to
dw_hdmi_suspend/resume.

> +static const struct dev_pm_ops dw_hdmi_rockchip_pm = {
> +	.resume = dw_hdmi_rockchip_resume,
> +	.suspend = dw_hdmi_rockchip_suspend,
> +};
> +
>  static struct platform_driver dw_hdmi_rockchip_pltfm_driver = {
>  	.probe  = dw_hdmi_rockchip_probe,
>  	.remove = dw_hdmi_rockchip_remove,
>  	.driver = {
>  		.name = "dwhdmi-rockchip",
> +		.pm = &dw_hdmi_rockchip_pm,
>  		.of_match_table = dw_hdmi_rockchip_dt_ids,
>  	},
>  };

regards
Philipp
Yakir Yang March 12, 2015, 2:32 p.m. UTC | #2
Hi Philipp,

On 2015?03?12? 18:24, Philipp Zabel wrote:
> Am Samstag, den 28.02.2015, 21:32 -0500 schrieb Yakir Yang:
>> Signed-off-by: Yakir Yang <ykk@rock-chips.com>
>> ---
>> Changes in v4: None
>> Changes in v3:
>> - Setting the .pm member instead of suspend/resume
>>
>> Changes in v2:
>> - Add suspend/resume support for dw_hdmi_rockchip driver
>>
>>   drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 16 ++++++++++++++++
>>   1 file changed, 16 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
>> index d236faa..fc1d02e 100644
>> --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
>> +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
>> @@ -323,11 +323,27 @@ static int dw_hdmi_rockchip_remove(struct platform_device *pdev)
>>   	return 0;
>>   }
>>   
>> +static int dw_hdmi_rockchip_suspend(struct device *dev)
>> +{
>> +	return dw_hdmi_suspend(dev);
>> +}
>> +
>> +static int dw_hdmi_rockchip_resume(struct device *dev)
>> +{
>> +	return dw_hdmi_resume(dev);
>> +}
> You could just skip dw_hdmi_rockchip_suspend/resume and
> set .suspend/.resume in dw_hdmi_rockchip_pm directly to
> dw_hdmi_suspend/resume.
>
Okay, sounds good, I will adjust it in next version.

Thanks  :)
>> +static const struct dev_pm_ops dw_hdmi_rockchip_pm = {
>> +	.resume = dw_hdmi_rockchip_resume,
>> +	.suspend = dw_hdmi_rockchip_suspend,
>> +};
>> +
>>   static struct platform_driver dw_hdmi_rockchip_pltfm_driver = {
>>   	.probe  = dw_hdmi_rockchip_probe,
>>   	.remove = dw_hdmi_rockchip_remove,
>>   	.driver = {
>>   		.name = "dwhdmi-rockchip",
>> +		.pm = &dw_hdmi_rockchip_pm,
>>   		.of_match_table = dw_hdmi_rockchip_dt_ids,
>>   	},
>>   };
> regards
> Philipp
>
regards :)
Yakir
>
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
index d236faa..fc1d02e 100644
--- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
@@ -323,11 +323,27 @@  static int dw_hdmi_rockchip_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static int dw_hdmi_rockchip_suspend(struct device *dev)
+{
+	return dw_hdmi_suspend(dev);
+}
+
+static int dw_hdmi_rockchip_resume(struct device *dev)
+{
+	return dw_hdmi_resume(dev);
+}
+
+static const struct dev_pm_ops dw_hdmi_rockchip_pm = {
+	.resume = dw_hdmi_rockchip_resume,
+	.suspend = dw_hdmi_rockchip_suspend,
+};
+
 static struct platform_driver dw_hdmi_rockchip_pltfm_driver = {
 	.probe  = dw_hdmi_rockchip_probe,
 	.remove = dw_hdmi_rockchip_remove,
 	.driver = {
 		.name = "dwhdmi-rockchip",
+		.pm = &dw_hdmi_rockchip_pm,
 		.of_match_table = dw_hdmi_rockchip_dt_ids,
 	},
 };