[U-Boot,4/7] EXYNOS5: GPIO to enable MAX98095

Submitted by Rajeshwari Birje on Jan. 21, 2013, 10:52 a.m.

Details

Message ID 1358765559-32709-5-git-send-email-rajeshwari.s@samsung.com
State Changes Requested
Delegated to: Minkyu Kang
Headers show

Commit Message

Rajeshwari Birje Jan. 21, 2013, 10:52 a.m.
This patch sets high a GPIO to enable the codec MAX98095

Signed-off-by: Rajeshwari Shinde <rajeshwari.s@samsung.com>
---
 board/samsung/smdk5250/smdk5250.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

Comments

Simon Glass Jan. 22, 2013, 2:55 p.m.
Hi Rajeshwari,

On Mon, Jan 21, 2013 at 2:52 AM, Rajeshwari Shinde
<rajeshwari.s@samsung.com> wrote:
> This patch sets high a GPIO to enable the codec MAX98095
>
> Signed-off-by: Rajeshwari Shinde <rajeshwari.s@samsung.com>
> ---
>  board/samsung/smdk5250/smdk5250.c |   15 +++++++++++++++
>  1 files changed, 15 insertions(+), 0 deletions(-)
>
> diff --git a/board/samsung/smdk5250/smdk5250.c b/board/samsung/smdk5250/smdk5250.c
> index 12cc03e..6f2e067 100644
> --- a/board/samsung/smdk5250/smdk5250.c
> +++ b/board/samsung/smdk5250/smdk5250.c
> @@ -56,6 +56,18 @@ int board_usb_vbus_init(void)
>  }
>  #endif
>
> +#ifdef CONFIG_SOUND_MAX98095
> +static void  board_enable_audio_codec(void)
> +{
> +       struct exynos5_gpio_part1 *gpio1 = (struct exynos5_gpio_part1 *)
> +                                               samsung_get_base_gpio_part1();
> +
> +       /* Enable MAX98095 Codec */
> +       s5p_gpio_direction_output(&gpio1->x1, 7, 1);
> +       s5p_gpio_set_pull(&gpio1->x1, 7, GPIO_PULL_NONE);

This GPIO is hard-coded - does the FDT version of this file do this differently?

> +}
> +#endif
> +
>  int board_init(void)
>  {
>         gd->bd->bi_boot_params = (PHYS_SDRAM_1 + 0x100UL);
> @@ -65,6 +77,9 @@ int board_init(void)
>  #ifdef CONFIG_USB_EHCI_EXYNOS
>         board_usb_vbus_init();
>  #endif
> +#ifdef CONFIG_SOUND_MAX98095
> +       board_enable_audio_codec();
> +#endif
>         return 0;
>  }
>
> --
> 1.7.4.4
>

Regards,
Simon
Rajeshwari Birje Jan. 23, 2013, 10:05 a.m.
Hi Simon,

Thank you for comments.

On Tue, Jan 22, 2013 at 8:25 PM, Simon Glass <sjg@chromium.org> wrote:
> Hi Rajeshwari,
>
> On Mon, Jan 21, 2013 at 2:52 AM, Rajeshwari Shinde
> <rajeshwari.s@samsung.com> wrote:
>> This patch sets high a GPIO to enable the codec MAX98095
>>
>> Signed-off-by: Rajeshwari Shinde <rajeshwari.s@samsung.com>
>> ---
>>  board/samsung/smdk5250/smdk5250.c |   15 +++++++++++++++
>>  1 files changed, 15 insertions(+), 0 deletions(-)
>>
>> diff --git a/board/samsung/smdk5250/smdk5250.c b/board/samsung/smdk5250/smdk5250.c
>> index 12cc03e..6f2e067 100644
>> --- a/board/samsung/smdk5250/smdk5250.c
>> +++ b/board/samsung/smdk5250/smdk5250.c
>> @@ -56,6 +56,18 @@ int board_usb_vbus_init(void)
>>  }
>>  #endif
>>
>> +#ifdef CONFIG_SOUND_MAX98095
>> +static void  board_enable_audio_codec(void)
>> +{
>> +       struct exynos5_gpio_part1 *gpio1 = (struct exynos5_gpio_part1 *)
>> +                                               samsung_get_base_gpio_part1();
>> +
>> +       /* Enable MAX98095 Codec */
>> +       s5p_gpio_direction_output(&gpio1->x1, 7, 1);
>> +       s5p_gpio_set_pull(&gpio1->x1, 7, GPIO_PULL_NONE);
>
> This GPIO is hard-coded - does the FDT version of this file do this differently?
For FDT support of same we need gpio numbering feature which is still
not merged in the mainline code.
Hence currently the same has been hard coded for MAX98095 on Snow.
>
>> +}
>> +#endif
>> +
>>  int board_init(void)
>>  {
>>         gd->bd->bi_boot_params = (PHYS_SDRAM_1 + 0x100UL);
>> @@ -65,6 +77,9 @@ int board_init(void)
>>  #ifdef CONFIG_USB_EHCI_EXYNOS
>>         board_usb_vbus_init();
>>  #endif
>> +#ifdef CONFIG_SOUND_MAX98095
>> +       board_enable_audio_codec();
>> +#endif
>>         return 0;
>>  }
>>
>> --
>> 1.7.4.4
>>
>
> Regards,
> Simon
> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
Simon Glass Jan. 25, 2013, 8:40 p.m.
Hi Rajeshwari,

On Wed, Jan 23, 2013 at 11:05 PM, Rajeshwari Birje
<rajeshwari.birje@gmail.com> wrote:
> Hi Simon,
>
> Thank you for comments.
>
> On Tue, Jan 22, 2013 at 8:25 PM, Simon Glass <sjg@chromium.org> wrote:
>> Hi Rajeshwari,
>>
>> On Mon, Jan 21, 2013 at 2:52 AM, Rajeshwari Shinde
>> <rajeshwari.s@samsung.com> wrote:
>>> This patch sets high a GPIO to enable the codec MAX98095
>>>
>>> Signed-off-by: Rajeshwari Shinde <rajeshwari.s@samsung.com>
>>> ---
>>>  board/samsung/smdk5250/smdk5250.c |   15 +++++++++++++++
>>>  1 files changed, 15 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/board/samsung/smdk5250/smdk5250.c b/board/samsung/smdk5250/smdk5250.c
>>> index 12cc03e..6f2e067 100644
>>> --- a/board/samsung/smdk5250/smdk5250.c
>>> +++ b/board/samsung/smdk5250/smdk5250.c
>>> @@ -56,6 +56,18 @@ int board_usb_vbus_init(void)
>>>  }
>>>  #endif
>>>
>>> +#ifdef CONFIG_SOUND_MAX98095
>>> +static void  board_enable_audio_codec(void)
>>> +{
>>> +       struct exynos5_gpio_part1 *gpio1 = (struct exynos5_gpio_part1 *)
>>> +                                               samsung_get_base_gpio_part1();
>>> +
>>> +       /* Enable MAX98095 Codec */
>>> +       s5p_gpio_direction_output(&gpio1->x1, 7, 1);
>>> +       s5p_gpio_set_pull(&gpio1->x1, 7, GPIO_PULL_NONE);
>>
>> This GPIO is hard-coded - does the FDT version of this file do this differently?
> For FDT support of same we need gpio numbering feature which is still
> not merged in the mainline code.
> Hence currently the same has been hard coded for MAX98095 on Snow.
>>

Yes I see, thank you.

Acked-by: Simon Glass <sjg@chromium.org>

>>> +}
>>> +#endif
>>> +
>>>  int board_init(void)
>>>  {
>>>         gd->bd->bi_boot_params = (PHYS_SDRAM_1 + 0x100UL);
>>> @@ -65,6 +77,9 @@ int board_init(void)
>>>  #ifdef CONFIG_USB_EHCI_EXYNOS
>>>         board_usb_vbus_init();
>>>  #endif
>>> +#ifdef CONFIG_SOUND_MAX98095
>>> +       board_enable_audio_codec();
>>> +#endif
>>>         return 0;
>>>  }
>>>
>>> --
>>> 1.7.4.4
>>>
>>
>> Regards,
>> Simon
>> _______________________________________________
>> U-Boot mailing list
>> U-Boot@lists.denx.de
>> http://lists.denx.de/mailman/listinfo/u-boot
>
> --
> Regards,
> Rajeshwari Shinde

Patch hide | download patch | download mbox

diff --git a/board/samsung/smdk5250/smdk5250.c b/board/samsung/smdk5250/smdk5250.c
index 12cc03e..6f2e067 100644
--- a/board/samsung/smdk5250/smdk5250.c
+++ b/board/samsung/smdk5250/smdk5250.c
@@ -56,6 +56,18 @@  int board_usb_vbus_init(void)
 }
 #endif
 
+#ifdef CONFIG_SOUND_MAX98095
+static void  board_enable_audio_codec(void)
+{
+	struct exynos5_gpio_part1 *gpio1 = (struct exynos5_gpio_part1 *)
+						samsung_get_base_gpio_part1();
+
+	/* Enable MAX98095 Codec */
+	s5p_gpio_direction_output(&gpio1->x1, 7, 1);
+	s5p_gpio_set_pull(&gpio1->x1, 7, GPIO_PULL_NONE);
+}
+#endif
+
 int board_init(void)
 {
 	gd->bd->bi_boot_params = (PHYS_SDRAM_1 + 0x100UL);
@@ -65,6 +77,9 @@  int board_init(void)
 #ifdef CONFIG_USB_EHCI_EXYNOS
 	board_usb_vbus_init();
 #endif
+#ifdef CONFIG_SOUND_MAX98095
+	board_enable_audio_codec();
+#endif
 	return 0;
 }