All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: oleg.matcovschi@ti.com
Cc: linux@arm.linux.org.uk, linux-omap@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] OMAP2+: mux: Fixed gpio mux mode analysis.
Date: Fri, 16 Nov 2012 17:22:32 -0800	[thread overview]
Message-ID: <20121117012231.GQ6801@atomide.com> (raw)
In-Reply-To: <1353015597-22703-1-git-send-email-oleg.matcovschi@ti.com>

* oleg.matcovschi@ti.com <oleg.matcovschi@ti.com> [121115 13:42]:
> From: Oleg Matcovschi <oleg.matcovschi@ti.com>
> 
> OMAP_MODE_GPIO() macro verified only OMAP_MUX_MODE4.

Indeed, that needs to be fixed.

> It is not correct for following platforms:
>     2430 - gpio mux mode 3
>     44xx - gpio mux mode 3

Looks like these are set properly to GPIO_IN_MODE3 with
omap_mux_init().

>     54xx - gpio mux mode 6

This will be only using pinctrl-single.c, so we don't
really have to worrry about this one. But I guess we might
as well fix that too while at it if somebody backports omap5
support to some older kernel..
 
> Patch reserves first 3 bits in partition flags for storing gpio mux
> mode in same format as stored in control pad register.
> Modified OMAP_MODE_GPIO() macro handles all possible cases of gpio mux mode.
> Modified omap_mux_init() flags of omap34xx to include OMAP_MUX_GPIO_IN_MODE4.

Why don't you just add int gpio to struct omap_mux_partition?

You're not saving many bytes as at most we have two partitions
so far per SoC.
 
> --- a/arch/arm/mach-omap2/mux34xx.c
> +++ b/arch/arm/mach-omap2/mux34xx.c
> @@ -2053,7 +2053,7 @@ int __init omap3_mux_init(struct omap_board_mux *board_subset, int flags)
>  		return -EINVAL;
>  	}
>  
> -	return omap_mux_init("core", 0,
> +	return omap_mux_init("core", OMAP_MUX_GPIO_IN_MODE4,
>  			     OMAP3_CONTROL_PADCONF_MUX_PBASE,
>  			     OMAP3_CONTROL_PADCONF_MUX_SIZE,
>  			     omap3_muxmodes, package_subset, board_subset,

The default is GPIO_IN_MODE4, but that seems to be a bad
default choice as only omap3 uses it. So yeah, might as well
initialize that too and not assume any defaults GPIO mode.

Regards,

Tony

WARNING: multiple messages have this Message-ID (diff)
From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] OMAP2+: mux: Fixed gpio mux mode analysis.
Date: Fri, 16 Nov 2012 17:22:32 -0800	[thread overview]
Message-ID: <20121117012231.GQ6801@atomide.com> (raw)
In-Reply-To: <1353015597-22703-1-git-send-email-oleg.matcovschi@ti.com>

* oleg.matcovschi at ti.com <oleg.matcovschi@ti.com> [121115 13:42]:
> From: Oleg Matcovschi <oleg.matcovschi@ti.com>
> 
> OMAP_MODE_GPIO() macro verified only OMAP_MUX_MODE4.

Indeed, that needs to be fixed.

> It is not correct for following platforms:
>     2430 - gpio mux mode 3
>     44xx - gpio mux mode 3

Looks like these are set properly to GPIO_IN_MODE3 with
omap_mux_init().

>     54xx - gpio mux mode 6

This will be only using pinctrl-single.c, so we don't
really have to worrry about this one. But I guess we might
as well fix that too while at it if somebody backports omap5
support to some older kernel..
 
> Patch reserves first 3 bits in partition flags for storing gpio mux
> mode in same format as stored in control pad register.
> Modified OMAP_MODE_GPIO() macro handles all possible cases of gpio mux mode.
> Modified omap_mux_init() flags of omap34xx to include OMAP_MUX_GPIO_IN_MODE4.

Why don't you just add int gpio to struct omap_mux_partition?

You're not saving many bytes as at most we have two partitions
so far per SoC.
 
> --- a/arch/arm/mach-omap2/mux34xx.c
> +++ b/arch/arm/mach-omap2/mux34xx.c
> @@ -2053,7 +2053,7 @@ int __init omap3_mux_init(struct omap_board_mux *board_subset, int flags)
>  		return -EINVAL;
>  	}
>  
> -	return omap_mux_init("core", 0,
> +	return omap_mux_init("core", OMAP_MUX_GPIO_IN_MODE4,
>  			     OMAP3_CONTROL_PADCONF_MUX_PBASE,
>  			     OMAP3_CONTROL_PADCONF_MUX_SIZE,
>  			     omap3_muxmodes, package_subset, board_subset,

The default is GPIO_IN_MODE4, but that seems to be a bad
default choice as only omap3 uses it. So yeah, might as well
initialize that too and not assume any defaults GPIO mode.

Regards,

Tony

  reply	other threads:[~2012-11-17  1:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-15 21:39 [PATCH] OMAP2+: mux: Fixed gpio mux mode analysis oleg.matcovschi
2012-11-15 21:39 ` oleg.matcovschi
2012-11-15 21:39 ` oleg.matcovschi at ti.com
2012-11-17  1:22 ` Tony Lindgren [this message]
2012-11-17  1:22   ` Tony Lindgren

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=20121117012231.GQ6801@atomide.com \
    --to=tony@atomide.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=oleg.matcovschi@ti.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.