Patchwork [U-Boot,1/2,V3] EXYNOS5: Add function to setup set ps hold

login
register
mail settings
Submitter Rajeshwari Birje
Date Feb. 13, 2013, 6:40 a.m.
Message ID <1360737602-19085-2-git-send-email-rajeshwari.s@samsung.com>
Download mbox | patch
Permalink /patch/220060/
State Accepted
Delegated to: Minkyu Kang
Headers show

Comments

Rajeshwari Birje - Feb. 13, 2013, 6:40 a.m.
This patch adds a function to set ps_hold data driving value high.
This enables the machine to stay powered on even after the initial
power-on condition goes away(e.g. power button).

Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rajeshwari Shinde <rajeshwari.s@samsung.com>
---
Changes in V2:
        - Corrected the multi line comment style
Changes in V3:
	- Renamed ps hold funstion to set_ps_hold_ctrl and made 
	exynos5_set_ps_hold_ctrl specific for exynos5.
 arch/arm/cpu/armv7/exynos/power.c        |   16 ++++++++++++++++
 arch/arm/include/asm/arch-exynos/power.h |    9 +++++++++
 2 files changed, 25 insertions(+), 0 deletions(-)
Simon Glass - Feb. 14, 2013, 6:53 a.m.
Hi,

On Tue, Feb 12, 2013 at 10:40 PM, Rajeshwari Shinde
<rajeshwari.s@samsung.com> wrote:
> This patch adds a function to set ps_hold data driving value high.
> This enables the machine to stay powered on even after the initial
> power-on condition goes away(e.g. power button).
>
> Acked-by: Simon Glass <sjg@chromium.org>

Probably should take this out when you rev the version, unless you are
just fixing nits from that person.

> Signed-off-by: Rajeshwari Shinde <rajeshwari.s@samsung.com>
> ---
> Changes in V2:
>         - Corrected the multi line comment style
> Changes in V3:
>         - Renamed ps hold funstion to set_ps_hold_ctrl and made
>         exynos5_set_ps_hold_ctrl specific for exynos5.
>  arch/arm/cpu/armv7/exynos/power.c        |   16 ++++++++++++++++
>  arch/arm/include/asm/arch-exynos/power.h |    9 +++++++++
>  2 files changed, 25 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/cpu/armv7/exynos/power.c b/arch/arm/cpu/armv7/exynos/power.c
> index d4bce6d..e09a678 100644
> --- a/arch/arm/cpu/armv7/exynos/power.c
> +++ b/arch/arm/cpu/armv7/exynos/power.c
> @@ -95,3 +95,19 @@ void set_dp_phy_ctrl(unsigned int enable)
>         if (cpu_is_exynos5())
>                 exynos5_dp_phy_control(enable);
>  }
> +
> +static void exynos5_set_ps_hold_ctrl(void)
> +{
> +       struct exynos5_power *power =
> +               (struct exynos5_power *)samsung_get_base_power();
> +
> +       /* Set PS-Hold high */
> +       setbits_le32(&power->ps_hold_control,
> +                       EXYNOS_PS_HOLD_CONTROL_DATA_HIGH);
> +}
> +
> +void set_ps_hold_ctrl(void)

Sorry to be a pain, but this has lost the power_ prefix. How about
power_set_ps_hold_ctrl() then?

> +{
> +       if (cpu_is_exynos5())
> +               exynos5_set_ps_hold_ctrl();
> +}
> diff --git a/arch/arm/include/asm/arch-exynos/power.h b/arch/arm/include/asm/arch-exynos/power.h
> index d2fdb59..f2f73fa 100644
> --- a/arch/arm/include/asm/arch-exynos/power.h
> +++ b/arch/arm/include/asm/arch-exynos/power.h
> @@ -864,4 +864,13 @@ void set_dp_phy_ctrl(unsigned int enable);
>
>  #define EXYNOS_DP_PHY_ENABLE           (1 << 0)
>
> +#define EXYNOS_PS_HOLD_CONTROL_DATA_HIGH       (1 << 8)
> +
> +/*
> + * Set ps_hold data driving value high
> + * This enables the machine to stay powered on
> + * after the initial power-on condition goes away
> + * (e.g. power button).
> + */
> +void set_ps_hold_ctrl(void);
>  #endif
> --
> 1.7.4.4
>

Regards,
Simon
Minkyu Kang - Feb. 14, 2013, 7:11 a.m.
Dear Simon Glass,

On 14/02/13 15:53, Simon Glass wrote:
> Hi,
> 
> On Tue, Feb 12, 2013 at 10:40 PM, Rajeshwari Shinde
> <rajeshwari.s@samsung.com> wrote:
>> This patch adds a function to set ps_hold data driving value high.
>> This enables the machine to stay powered on even after the initial
>> power-on condition goes away(e.g. power button).
>>
>> Acked-by: Simon Glass <sjg@chromium.org>
> 
> Probably should take this out when you rev the version, unless you are
> just fixing nits from that person.
> 
>> Signed-off-by: Rajeshwari Shinde <rajeshwari.s@samsung.com>
>> ---
>> Changes in V2:
>>         - Corrected the multi line comment style
>> Changes in V3:
>>         - Renamed ps hold funstion to set_ps_hold_ctrl and made
>>         exynos5_set_ps_hold_ctrl specific for exynos5.
>>  arch/arm/cpu/armv7/exynos/power.c        |   16 ++++++++++++++++
>>  arch/arm/include/asm/arch-exynos/power.h |    9 +++++++++
>>  2 files changed, 25 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/arm/cpu/armv7/exynos/power.c b/arch/arm/cpu/armv7/exynos/power.c
>> index d4bce6d..e09a678 100644
>> --- a/arch/arm/cpu/armv7/exynos/power.c
>> +++ b/arch/arm/cpu/armv7/exynos/power.c
>> @@ -95,3 +95,19 @@ void set_dp_phy_ctrl(unsigned int enable)
>>         if (cpu_is_exynos5())
>>                 exynos5_dp_phy_control(enable);
>>  }
>> +
>> +static void exynos5_set_ps_hold_ctrl(void)
>> +{
>> +       struct exynos5_power *power =
>> +               (struct exynos5_power *)samsung_get_base_power();
>> +
>> +       /* Set PS-Hold high */
>> +       setbits_le32(&power->ps_hold_control,
>> +                       EXYNOS_PS_HOLD_CONTROL_DATA_HIGH);
>> +}
>> +
>> +void set_ps_hold_ctrl(void)
> 
> Sorry to be a pain, but this has lost the power_ prefix. How about
> power_set_ps_hold_ctrl() then?

I requested it as the exynos naming rule.

> 
>> +{
>> +       if (cpu_is_exynos5())
>> +               exynos5_set_ps_hold_ctrl();
>> +}
>> diff --git a/arch/arm/include/asm/arch-exynos/power.h b/arch/arm/include/asm/arch-exynos/power.h
>> index d2fdb59..f2f73fa 100644
>> --- a/arch/arm/include/asm/arch-exynos/power.h
>> +++ b/arch/arm/include/asm/arch-exynos/power.h
>> @@ -864,4 +864,13 @@ void set_dp_phy_ctrl(unsigned int enable);
>>
>>  #define EXYNOS_DP_PHY_ENABLE           (1 << 0)
>>
>> +#define EXYNOS_PS_HOLD_CONTROL_DATA_HIGH       (1 << 8)
>> +
>> +/*
>> + * Set ps_hold data driving value high
>> + * This enables the machine to stay powered on
>> + * after the initial power-on condition goes away
>> + * (e.g. power button).
>> + */
>> +void set_ps_hold_ctrl(void);
>>  #endif
>> --
>> 1.7.4.4
>>
> 
> Regards,
> Simon
> 

Thanks.
Minkyu Kang.
Simon Glass - Feb. 14, 2013, 7:24 a.m.
Hi Minkyu,

On Wed, Feb 13, 2013 at 11:11 PM, Minkyu Kang <mk7.kang@samsung.com> wrote:
> Dear Simon Glass,
>
> On 14/02/13 15:53, Simon Glass wrote:
>> Hi,
>>
>> On Tue, Feb 12, 2013 at 10:40 PM, Rajeshwari Shinde
>> <rajeshwari.s@samsung.com> wrote:
>>> This patch adds a function to set ps_hold data driving value high.
>>> This enables the machine to stay powered on even after the initial
>>> power-on condition goes away(e.g. power button).
>>>
>>> Acked-by: Simon Glass <sjg@chromium.org>
>>
>> Probably should take this out when you rev the version, unless you are
>> just fixing nits from that person.
>>
>>> Signed-off-by: Rajeshwari Shinde <rajeshwari.s@samsung.com>
>>> ---
>>> Changes in V2:
>>>         - Corrected the multi line comment style
>>> Changes in V3:
>>>         - Renamed ps hold funstion to set_ps_hold_ctrl and made
>>>         exynos5_set_ps_hold_ctrl specific for exynos5.
>>>  arch/arm/cpu/armv7/exynos/power.c        |   16 ++++++++++++++++
>>>  arch/arm/include/asm/arch-exynos/power.h |    9 +++++++++
>>>  2 files changed, 25 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/arch/arm/cpu/armv7/exynos/power.c b/arch/arm/cpu/armv7/exynos/power.c
>>> index d4bce6d..e09a678 100644
>>> --- a/arch/arm/cpu/armv7/exynos/power.c
>>> +++ b/arch/arm/cpu/armv7/exynos/power.c
>>> @@ -95,3 +95,19 @@ void set_dp_phy_ctrl(unsigned int enable)
>>>         if (cpu_is_exynos5())
>>>                 exynos5_dp_phy_control(enable);
>>>  }
>>> +
>>> +static void exynos5_set_ps_hold_ctrl(void)
>>> +{
>>> +       struct exynos5_power *power =
>>> +               (struct exynos5_power *)samsung_get_base_power();
>>> +
>>> +       /* Set PS-Hold high */
>>> +       setbits_le32(&power->ps_hold_control,
>>> +                       EXYNOS_PS_HOLD_CONTROL_DATA_HIGH);
>>> +}
>>> +
>>> +void set_ps_hold_ctrl(void)
>>
>> Sorry to be a pain, but this has lost the power_ prefix. How about
>> power_set_ps_hold_ctrl() then?
>
> I requested it as the exynos naming rule.

Do you mean the exynos_ prefix? OK then. I suppose
exynos_power_set_ps_hold_ctrl() is just getting a bit silly.

Regards,
Simon

>
>>
>>> +{
>>> +       if (cpu_is_exynos5())
>>> +               exynos5_set_ps_hold_ctrl();
>>> +}
>>> diff --git a/arch/arm/include/asm/arch-exynos/power.h b/arch/arm/include/asm/arch-exynos/power.h
>>> index d2fdb59..f2f73fa 100644
>>> --- a/arch/arm/include/asm/arch-exynos/power.h
>>> +++ b/arch/arm/include/asm/arch-exynos/power.h
>>> @@ -864,4 +864,13 @@ void set_dp_phy_ctrl(unsigned int enable);
>>>
>>>  #define EXYNOS_DP_PHY_ENABLE           (1 << 0)
>>>
>>> +#define EXYNOS_PS_HOLD_CONTROL_DATA_HIGH       (1 << 8)
>>> +
>>> +/*
>>> + * Set ps_hold data driving value high
>>> + * This enables the machine to stay powered on
>>> + * after the initial power-on condition goes away
>>> + * (e.g. power button).
>>> + */
>>> +void set_ps_hold_ctrl(void);
>>>  #endif
>>> --
>>> 1.7.4.4
>>>
>>
>> Regards,
>> Simon
>>
>
> Thanks.
> Minkyu Kang.
>
Minkyu Kang - Feb. 14, 2013, 7:39 a.m.
Dear Simon Glass,

On 14/02/13 16:24, Simon Glass wrote:
> Hi Minkyu,
> 
> On Wed, Feb 13, 2013 at 11:11 PM, Minkyu Kang <mk7.kang@samsung.com> wrote:
>> Dear Simon Glass,
>>
>> On 14/02/13 15:53, Simon Glass wrote:
>>> Hi,
>>>
>>> On Tue, Feb 12, 2013 at 10:40 PM, Rajeshwari Shinde
>>> <rajeshwari.s@samsung.com> wrote:
>>>> This patch adds a function to set ps_hold data driving value high.
>>>> This enables the machine to stay powered on even after the initial
>>>> power-on condition goes away(e.g. power button).
>>>>
>>>> Acked-by: Simon Glass <sjg@chromium.org>
>>>
>>> Probably should take this out when you rev the version, unless you are
>>> just fixing nits from that person.
>>>
>>>> Signed-off-by: Rajeshwari Shinde <rajeshwari.s@samsung.com>
>>>> ---
>>>> Changes in V2:
>>>>         - Corrected the multi line comment style
>>>> Changes in V3:
>>>>         - Renamed ps hold funstion to set_ps_hold_ctrl and made
>>>>         exynos5_set_ps_hold_ctrl specific for exynos5.
>>>>  arch/arm/cpu/armv7/exynos/power.c        |   16 ++++++++++++++++
>>>>  arch/arm/include/asm/arch-exynos/power.h |    9 +++++++++
>>>>  2 files changed, 25 insertions(+), 0 deletions(-)
>>>>
>>>> diff --git a/arch/arm/cpu/armv7/exynos/power.c b/arch/arm/cpu/armv7/exynos/power.c
>>>> index d4bce6d..e09a678 100644
>>>> --- a/arch/arm/cpu/armv7/exynos/power.c
>>>> +++ b/arch/arm/cpu/armv7/exynos/power.c
>>>> @@ -95,3 +95,19 @@ void set_dp_phy_ctrl(unsigned int enable)
>>>>         if (cpu_is_exynos5())
>>>>                 exynos5_dp_phy_control(enable);
>>>>  }
>>>> +
>>>> +static void exynos5_set_ps_hold_ctrl(void)
>>>> +{
>>>> +       struct exynos5_power *power =
>>>> +               (struct exynos5_power *)samsung_get_base_power();
>>>> +
>>>> +       /* Set PS-Hold high */
>>>> +       setbits_le32(&power->ps_hold_control,
>>>> +                       EXYNOS_PS_HOLD_CONTROL_DATA_HIGH);
>>>> +}
>>>> +
>>>> +void set_ps_hold_ctrl(void)
>>>
>>> Sorry to be a pain, but this has lost the power_ prefix. How about
>>> power_set_ps_hold_ctrl() then?
>>
>> I requested it as the exynos naming rule.
> 
> Do you mean the exynos_ prefix? OK then. I suppose
> exynos_power_set_ps_hold_ctrl() is just getting a bit silly.
> 

No.
exynos's functions are named to set_* and get_*.
There are no prefix.
Because of it's a exynos specific function, and it is placed in power.c.

Thanks.
Minkyu Kang.

Patch

diff --git a/arch/arm/cpu/armv7/exynos/power.c b/arch/arm/cpu/armv7/exynos/power.c
index d4bce6d..e09a678 100644
--- a/arch/arm/cpu/armv7/exynos/power.c
+++ b/arch/arm/cpu/armv7/exynos/power.c
@@ -95,3 +95,19 @@  void set_dp_phy_ctrl(unsigned int enable)
 	if (cpu_is_exynos5())
 		exynos5_dp_phy_control(enable);
 }
+
+static void exynos5_set_ps_hold_ctrl(void)
+{
+	struct exynos5_power *power =
+		(struct exynos5_power *)samsung_get_base_power();
+
+	/* Set PS-Hold high */
+	setbits_le32(&power->ps_hold_control,
+			EXYNOS_PS_HOLD_CONTROL_DATA_HIGH);
+}
+
+void set_ps_hold_ctrl(void)
+{
+	if (cpu_is_exynos5())
+		exynos5_set_ps_hold_ctrl();
+}
diff --git a/arch/arm/include/asm/arch-exynos/power.h b/arch/arm/include/asm/arch-exynos/power.h
index d2fdb59..f2f73fa 100644
--- a/arch/arm/include/asm/arch-exynos/power.h
+++ b/arch/arm/include/asm/arch-exynos/power.h
@@ -864,4 +864,13 @@  void set_dp_phy_ctrl(unsigned int enable);
 
 #define EXYNOS_DP_PHY_ENABLE		(1 << 0)
 
+#define EXYNOS_PS_HOLD_CONTROL_DATA_HIGH	(1 << 8)
+
+/*
+ * Set ps_hold data driving value high
+ * This enables the machine to stay powered on
+ * after the initial power-on condition goes away
+ * (e.g. power button).
+ */
+void set_ps_hold_ctrl(void);
 #endif