From: u.kleine-koenig@pengutronix.de (Uwe Kleine-König)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 1/3] ARM: mxs: add GPMI-NFC support for imx23/imx28
Date: Fri, 8 Jul 2011 11:09:03 +0200 [thread overview]
Message-ID: <20110708090903.GQ29624@pengutronix.de> (raw)
In-Reply-To: <4E16B47E.8090909@freescale.com>
Hello,
On Fri, Jul 08, 2011 at 03:40:46PM +0800, Huang Shijie wrote:
> ? 2011?07?08? 15:31, Uwe Kleine-K?nig ??:
> >Hello,
> >
> >On Thu, Jun 30, 2011 at 03:55:19PM +0200, Arnd Bergmann wrote:
> >>On Thursday 30 June 2011, Huang Shijie wrote:
> >>>add GPMI-NFC support for imx23 and imx28.
> >>>
> >>>Signed-off-by: Huang Shijie<b32955@freescale.com>
> >>>+/**
> >>>+ * struct gpmi_nfc_platform_data - GPMI NFC driver platform data.
> >>>+ *
> >>>+ * This structure communicates platform-specific information to the GPMI NFC
> >>>+ * driver that can't be expressed as resources.
> >>>+ *
> >>>+ * @platform_init: A pointer to a function the driver will call to
> >>>+ * initialize the platform (e.g., set up the pin mux).
> >>>+ * @platform_exit: A pointer to a function the driver will call to
> >>>+ * exit the platform (e.g., free pins).
> >>>+ * @min_prop_delay_in_ns: Minimum propagation delay of GPMI signals to and
> >>>+ * from the NAND Flash device, in nanoseconds.
> >>>+ * @max_prop_delay_in_ns: Maximum propagation delay of GPMI signals to and
> >>>+ * from the NAND Flash device, in nanoseconds.
> >>>+ * @max_chip_count: The maximum number of chips for which the driver
> >>>+ * should configure the hardware. This value most
> >>>+ * likely reflects the number of pins that are
> >>>+ * connected to a NAND Flash device. If this is
> >>>+ * greater than the SoC hardware can support, the
> >>>+ * driver will print a message and fail to initialize.
> >>>+ * @partitions: An optional pointer to an array of partition
> >>>+ * descriptions.
> >>>+ * @partition_count: The number of elements in the partitions array.
> >>>+ */
> >>>+struct gpmi_nfc_platform_data {
> >>>+ /* SoC hardware information. */
> >>>+ int (*platform_init)(void);
> >>>+ void (*platform_exit)(void);
> >>>+
> >>>+ /* NAND Flash information. */
> >>>+ unsigned int min_prop_delay_in_ns;
> >>>+ unsigned int max_prop_delay_in_ns;
> >>>+ unsigned int max_chip_count;
> >>>+
> >>>+ /* Medium information. */
> >>>+ struct mtd_partition *partitions;
> >>>+ unsigned partition_count;
> >>>+};
> >>When adding new infrastructure, always keep in mind how you want it to look
> >>after the device tree conversion. The partitions and min/max_* are easily covered
> >>with that, but the init/exit function pointers are somewhat problematic.
> >>
> >>Fortunately, you don't really require these functions for this driver. The _exit
> >>function is completely unused, so just get rid of it.
> >>
> >>The init function is used only to set up iomux, so the logical replacement is
> >>a pointer to the iomux data, and calling mxs_iomux_setup_multiple_pads
> >>directly from the driver.
> >Why not put the iomux stuff into the per-machine table and get rid of
> >the init callback, too?
>
> The mmc (ssp) has pin conflict with gpmi on both mx23evk and mx28evk.
> So, it's better to initialize the pin when the driver(GPMI or MMC)
> is enabled.
What do you do to prevent userspace from trying to use both devices?
I guess you need to configure the hardware somehow to switch between the
two using a jumper? Isn't it possible to detect the hardware setting and
setup the muxer accordingly?
IMHO an per-device init-callback is the wrong approach to solve a pin
conflict.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | http://www.pengutronix.de/ |
next prev parent reply other threads:[~2011-07-08 9:09 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-30 3:53 [PATCH v5 0/3] add the GPMI-NFC support for imx23/imx28 Huang Shijie
2011-06-30 3:53 ` [PATCH v5 1/3] ARM: mxs: add " Huang Shijie
2011-06-30 13:55 ` Arnd Bergmann
2011-06-30 14:58 ` Lothar Waßmann
2011-06-30 22:22 ` Arnd Bergmann
2011-07-01 5:59 ` Lothar Waßmann
2011-07-01 6:03 ` Wolfram Sang
2011-07-01 7:53 ` Huang Shijie
2011-07-01 8:01 ` Wolfram Sang
2011-07-01 8:39 ` Huang Shijie
2011-07-01 8:45 ` Huang Shijie
2011-07-01 9:25 ` Arnd Bergmann
2011-07-08 7:31 ` Uwe Kleine-König
2011-07-08 7:40 ` Huang Shijie
2011-07-08 9:09 ` Uwe Kleine-König [this message]
2011-07-08 9:27 ` Huang Shijie
2011-07-08 10:16 ` Uwe Kleine-König
2011-07-08 10:24 ` Lothar Waßmann
2011-07-11 8:00 ` Uwe Kleine-König
2011-07-11 8:30 ` Huang Shijie
2011-07-11 8:37 ` Lothar Waßmann
2011-07-08 9:02 ` Arnd Bergmann
2011-06-30 3:53 ` [PATCH v5 2/3] ARM: mxs/mx23evk: add GPMI-NFC device Huang Shijie
2011-06-30 7:55 ` Uwe Kleine-König
2011-06-30 8:37 ` Huang Shijie
2011-06-30 3:53 ` [PATCH v5 3/3] ARM: mxs/mx28evk: " Huang Shijie
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=20110708090903.GQ29624@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
/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).