From: Timur Tabi <timur@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH v2] QE IO: Add initial data to pin configuration + read/write functions
Date: Thu, 17 Jan 2008 11:39:21 -0600 [thread overview]
Message-ID: <478F92C9.8030205@freescale.com> (raw)
In-Reply-To: <B27D27F93BC429468DBC3B0DA043AA4401BE0DB7@ILPTEX02.ecitele.com>
David Saada wrote:
> @@ -38,6 +38,16 @@ void qe_config_iopin(u8 port, u8 pin, in
> volatile par_io_t *par_io = (volatile par_io_t *)
> &(gur->qe_par_io);
>
> + /* Calculate pin location for 1bit mask */
> + pin_1bit_mask = (u32)(1 << (NUM_OF_PINS - (pin+1)));
> +
> + /* Setup the data */
> + tmp_val = in_be32(&par_io[port].cpdat);
> + if (data)
> + out_be32(&par_io[port].cpdat, pin_1bit_mask | tmp_val);
> + else
> + out_be32(&par_io[port].cpdat, ~pin_1bit_mask & tmp_val);
> +
I see that qe_config_iopin() will always write a 0 or 1 now, ignoring the
current value. Are you sure this is a good idea? What if I don't want U-Boot
to change the current pin value?
Plus, doesn't this assume that the pin is set to output? Shouldn't you check to
see if the pin is output or input/output, and only write cpdat if it is? Also,
I believe that cpdat is used only if the pin is configured as a GPIO. If so, I
don't see you check for that, either.
--
Timur Tabi
Linux kernel developer at Freescale
next prev parent reply other threads:[~2008-01-17 17:39 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-17 14:31 [U-Boot-Users] [PATCH v2] QE IO: Add initial data to pin configuration + read/write functions David Saada
2008-01-17 17:30 ` Timur Tabi
2008-01-17 17:39 ` Timur Tabi [this message]
2008-01-20 6:48 ` David Saada
2008-01-20 9:36 ` [U-Boot-Users] [PATCH v3] " David Saada
2008-01-22 18:11 ` David Saada
2008-01-22 18:55 ` Timur Tabi
2008-01-23 7:47 ` David Saada
2008-01-23 22:43 ` Timur Tabi
2008-01-28 16:01 ` Timur Tabi
2008-01-28 16:21 ` David Saada
2008-02-05 16:54 ` Andy Fleming
2008-02-06 7:44 ` David Saada
2008-02-07 10:26 ` [U-Boot-Users] [PATCH v4] " David Saada
2008-02-07 15:28 ` Timur Tabi
2008-02-07 15:55 ` David Saada
2008-02-07 15:57 ` Timur Tabi
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=478F92C9.8030205@freescale.com \
--to=timur@freescale.com \
--cc=u-boot@lists.denx.de \
/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.