linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Taehun Kim <kth3321@gmail.com>
To: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
Cc: Ben Dooks <ben-linux@fluff.org>,
	Kukjin Kim <kgene.kim@samsung.com>,
	Russell King <linux@arm.linux.org.uk>,
	linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] ARM: S3C24XX: Add WIZnet W5300E01-ARM board support
Date: Wed, 5 Sep 2012 03:32:50 +0900	[thread overview]
Message-ID: <CAOkfWjfEO43WOtaM24P4xp_yW9FWfL5q99yNwftoXDONCAM9Kw@mail.gmail.com> (raw)
In-Reply-To: <50450472.5090603@gmail.com>

2012/9/4 Sylwester Nawrocki <sylvester.nawrocki@gmail.com>:
> On 09/03/2012 07:36 PM, Taehun Kim wrote:
>> +static void __init w5300e01_init(void)
>> +{
>> +     s3c_nand_set_platdata(&w5300e01_nand_info);
>> +     platform_add_devices(w5300e01_devices, ARRAY_SIZE(w5300e01_devices));
>> +
>> +     /* W5300 interrupt pin. */
>> +     s3c_gpio_cfgpin(S3C2410_GPF(0), S3C2410_GPIO_IRQ);
>> +
>> +     s3c_gpio_cfgpin(S3C2410_GPF(4), S3C2410_GPIO_OUTPUT);
>> +     s3c_gpio_cfgpin(S3C2410_GPF(5), S3C2410_GPIO_OUTPUT);
>> +     s3c_gpio_cfgpin(S3C2410_GPF(6), S3C2410_GPIO_OUTPUT);
>> +     s3c_gpio_cfgpin(S3C2410_GPF(7), S3C2410_GPIO_OUTPUT);
>
> Please don't use these obsolete S3C2410_GPIO_* defines, they will be
> gone soon, if aren't yet.
>
>> +     gpio_set_value(S3C2410_GPF(0), 1);
>> +     gpio_set_value(S3C2410_GPF(4), 1);
>> +     gpio_set_value(S3C2410_GPF(5), 1);
>> +     gpio_set_value(S3C2410_GPF(6), 1);
>> +     gpio_set_value(S3C2410_GPF(7), 1);
>
> Instead I would do something like:
>
> 8<-----------------------------------------------------------------
>
> static const struct gpio gpios[] = {
>         { S3C2410_GPF(4), GPIOF_OUT_INIT_HIGH, NULL },
>         { S3C2410_GPF(5), GPIOF_OUT_INIT_HIGH, NULL },
>         { S3C2410_GPF(6), GPIOF_OUT_INIT_HIGH, NULL },
>         { S3C2410_GPF(7), GPIOF_OUT_INIT_HIGH, NULL },
> };
>
> if (!WARN_ON(gpio_request_array(gpios, ARRAY_SIZE(gpios)))
>         gpios_free_array(gpios);
>
> /* W5300 interrupt pin. */
> if (!WARN_ON(gpio_request(S3C2410_GPF(0), GPIOF_IN, NULL))) {
>         s3c_gpio_cfgpin(S3C2410_GPF(0), S3C_GPIO_SFN(2)); /* EINT0 */
>         gpio_free(S3C2410_GPF(0));
> }
>
> 8<-----------------------------------------------------------------
>
> --
>
> Regards,
> Sylwester

Thank you for your feedback. I will change the gpio routine as follows:

-----------------------------------------------------------------

static const struct gpio w5300e01_gpios[] = {
	{ S3C2410_GPF(4), GPIOF_OUT_INIT_HIGH, NULL },
	{ S3C2410_GPF(5), GPIOF_OUT_INIT_HIGH, NULL },
	{ S3C2410_GPF(6), GPIOF_OUT_INIT_HIGH, NULL },
	{ S3C2410_GPF(7), GPIOF_OUT_INIT_HIGH, NULL },
};

static void __init w5300_init(void)
{
	/* W5300 interrupt pin. */
	if (WARN_ON(gpio_request(S3C2410_GPF(0), "W5300 irq"))) {
		pr_err("%s: GPIO request failed.\n", __func__);
		return;
	}
	s3c_gpio_cfgpin(S3C2410_GPF(0), S3C_GPIO_SFN(2)); /* EINT0 */
}

static void __init w5300e01_init(void)
{
	s3c_nand_set_platdata(&w5300e01_nand_info);
	platform_add_devices(w5300e01_devices, ARRAY_SIZE(w5300e01_devices));

	if (WARN_ON(gpio_request_array(w5300e01_gpios, ARRAY_SIZE(w5300e01_gpios))))
		pr_err("%s: GPIO request failed\n", __func__);

	w5300_init();
	s3c_pm_init();
}
-----------------------------------------------------------------

Does anybody have a other comments?

  reply	other threads:[~2012-09-04 18:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-03  6:20 [PATCH] ARM: S3C24XX: Add WIZnet W5300E01-ARM board support Taehun Kim
2012-09-03  7:56 ` Vasily Khoruzhick
2012-09-03  8:54   ` Sylwester Nawrocki
2012-09-03 15:39     ` Taehun Kim
2012-09-03 17:36 ` [PATCH v2] " Taehun Kim
2012-09-03 18:00   ` Vasily Khoruzhick
2012-09-03 19:26   ` Sylwester Nawrocki
2012-09-04 18:32     ` Taehun Kim [this message]
2012-09-06  4:27 ` [PATCH v3] " Taehun Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAOkfWjfEO43WOtaM24P4xp_yW9FWfL5q99yNwftoXDONCAM9Kw@mail.gmail.com \
    --to=kth3321@gmail.com \
    --cc=ben-linux@fluff.org \
    --cc=kgene.kim@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=sylvester.nawrocki@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).