From: Scott Wood <scottwood@freescale.com>
To: Kumar Gala <galak@kernel.crashing.org>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH 28/61] Add cpm2_set_pin().
Date: Wed, 18 Jul 2007 13:51:55 -0500 [thread overview]
Message-ID: <469E614B.1000700@freescale.com> (raw)
In-Reply-To: <44F03DBB-C3D6-4AA1-9960-730F64829EC6@kernel.crashing.org>
Kumar Gala wrote:
> On Jul 17, 2007, at 8:35 PM, Scott Wood wrote:
>> +
>> +struct cpm2_ioports {
>> + u32 dir, par, sor, odr, dat;
>
> __be32?
OK.
>> + u32 res[3];
>> +};
>> +
>> +void cpm2_set_pin(int port, int pin, int flags)
>
>
> Can we make the function take a pointer to the port directly?
I'd rather not -- it'd require the caller to use the immr struct
directly, and either have no type checking, or different functions for
different types of ports (on 8xx).
>> +{
>> + struct cpm2_ioports __iomem *iop =
>> + (struct cpm_ioports __iomem *)&cpm2_immr->im_ioport;
>> +
>> + pin = 1 << (31 - pin);
>> +
>> + if (flags & CPM_PIN_OUTPUT)
>> + setbits32(&iop[port].dir, pin);
>> + else
>> + clrbits32(&iop[port].dir, pin);
>> +
>> + if (!(flags & CPM_PIN_GPIO))
>> + setbits32(&iop[port].par, pin);
>> + else
>> + clrbits32(&iop[port].par, pin);
>> +
>> + if (flags & CPM_PIN_SECONDARY)
>> + setbits32(&iop[port].sor, pin);
>> + else
>> + clrbits32(&iop[port].sor, pin);
>
>
> should we only do this if !(flags & CPM_PIN_GPIO)?
I don't think it matters.
> Any reason we don't also set odr here?
It wasn't clear to me when we need to set it. I can add a flag for it,
though.
-Scott
next prev parent reply other threads:[~2007-07-18 18:52 UTC|newest]
Thread overview: 129+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-18 1:31 [PATCH 01/61] Use strcasecmp() rather than strncasecmp() when determining device node compatibility Scott Wood
2007-07-18 1:32 ` [PATCH 02/61] mpc8272ads.dts: Whitespace cleanup Scott Wood
2007-07-18 1:32 ` [PATCH 03/61] Only include linux/ide.h if CONFIG_BLOCK is defined Scott Wood
2007-07-18 4:51 ` Kumar Gala
2007-07-18 1:32 ` [PATCH 04/61] 8xx: Work around CPU15 erratum Scott Wood
2007-07-19 15:01 ` Segher Boessenkool
2007-07-19 15:32 ` Scott Wood
2007-07-18 1:33 ` [PATCH 05/61] bootwrapper: Change cuImage .gitignore entry to cuImage.* Scott Wood
2007-07-18 1:42 ` David Gibson
2007-07-18 16:09 ` Scott Wood
2007-07-19 1:32 ` David Gibson
2007-07-18 1:33 ` [PATCH 06/61] 8xx: Don't call non-existent Soft_emulate_8xx from SoftwareEmulation Scott Wood
2007-07-18 5:05 ` Kumar Gala
2007-07-18 16:22 ` Scott Wood
2007-07-18 18:24 ` Kumar Gala
2007-07-18 19:52 ` Scott Wood
2007-07-18 1:33 ` [PATCH 07/61] bootwrapper: Set timebase_period_ns from dt_fixup_cpu_clocks Scott Wood
2007-07-18 8:17 ` Stephen Rothwell
2007-07-18 1:33 ` [PATCH 08/61] bootwrapper: dt_xlate_range() bugfixes Scott Wood
2007-07-18 1:33 ` [PATCH 09/61] bootwrapper: Add dt_is_compatible() Scott Wood
2007-07-18 16:20 ` Milton Miller
2007-07-18 18:24 ` Scott Wood
2007-07-18 1:33 ` [PATCH 10/61] bootwrapper: flatdevtree fixes Scott Wood
2007-07-18 16:20 ` Milton Miller
2007-07-18 1:33 ` [PATCH 11/61] bootwrapper: Add 16-bit I/O Scott Wood
2007-07-18 1:33 ` [PATCH 12/61] bootwrapper: Add TARGET_HAS_ETHn tests to ppcboot.h Scott Wood
2007-07-18 1:33 ` [PATCH 13/61] bootwrapper: Search the entire compatible list for serial devices Scott Wood
2007-07-18 1:33 ` [PATCH 14/61] bootwrapper: Don't call serial_edit_cmdline if getc isn't defined Scott Wood
2007-07-18 1:33 ` [PATCH 15/61] Declare udelay() in ops.h, and remove declarations in various users Scott Wood
2007-07-18 1:33 ` [PATCH 16/61] bootwrapper: Add CPM serial driver Scott Wood
2007-07-18 1:33 ` [PATCH 17/61] bootwrapper: Add 8xx support Scott Wood
2007-07-18 3:30 ` David Gibson
2007-07-18 16:13 ` Scott Wood
2007-07-19 1:32 ` David Gibson
2007-07-19 15:04 ` Scott Wood
2007-07-18 1:33 ` [PATCH 18/61] bootwrapper: Add PowerQUICC II (82xx with CPM) support Scott Wood
2007-07-18 1:35 ` [PATCH 20/61] Add early debug console for CPM serial ports Scott Wood
2007-07-18 1:35 ` [PATCH 21/61] Minor whitespace (space->tab) fixup in irq.c Scott Wood
2007-07-18 1:35 ` [PATCH 22/61] Rename mpc82xx_ads to mpc8272ads Scott Wood
2007-07-18 3:07 ` Mark Zhan
2007-07-18 16:10 ` Scott Wood
2007-07-18 5:09 ` Kumar Gala
2007-07-18 1:35 ` [PATCH 23/61] Rename mpc82xx_ads_show_cpuinfo to m82xx_show_cpuinfo Scott Wood
2007-07-18 5:20 ` Kumar Gala
2007-07-18 1:35 ` [PATCH 24/61] Change references from 82xx_ADS to 8272ADS Scott Wood
2007-07-18 1:35 ` [PATCH 25/61] Fix off-by-one error in CPM2 setbrg() Scott Wood
2007-07-18 1:35 ` [PATCH 26/61] cpm2: Add SCCs to cpm2_clk_setup() Scott Wood
2007-07-18 1:35 ` [PATCH 27/61] cpm2: Fix whitespace in cpm2_clk_setup() Scott Wood
2007-07-19 0:21 ` Arnd Bergmann
2007-07-18 1:35 ` [PATCH 28/61] Add cpm2_set_pin() Scott Wood
2007-07-18 15:02 ` Kumar Gala
2007-07-18 18:51 ` Scott Wood [this message]
2007-07-18 1:35 ` [PATCH 29/61] fsl_soc: Fix get_immrbase() to use ranges, rather than reg Scott Wood
2007-07-18 1:35 ` [PATCH 30/61] fsl_soc: Update the way get_brgfreq() finds things in the device tree Scott Wood
2007-07-18 5:28 ` Kumar Gala
2007-07-18 16:32 ` Scott Wood
2007-07-19 14:55 ` Kumar Gala
2007-07-19 20:16 ` Scott Wood
2007-07-19 15:09 ` Segher Boessenkool
2007-07-18 1:35 ` [PATCH 31/61] mpc8272ads: Check the board in the probe function Scott Wood
2007-07-18 3:31 ` David Gibson
2007-07-18 1:35 ` [PATCH 32/61] mpc82xx: Move PQ2 restart and halt functions out of mpc8272-specific code Scott Wood
2007-07-18 5:31 ` Kumar Gala
2007-07-18 16:33 ` Scott Wood
2007-07-18 1:35 ` [PATCH 33/61] mpc82xx: Remove a bunch of cruft that duplicates generic functionality Scott Wood
2007-07-18 1:35 ` [PATCH 34/61] cpm2: Use the global cpm2_immr rather than ioremapping() all over the place Scott Wood
2007-07-18 1:35 ` [PATCH 35/61] 82xx: Factor PCI PIC out of 8272ads code Scott Wood
2007-07-18 1:35 ` [PATCH 36/61] mpc82xx: Factor PCI init out of mpc8272ads Scott Wood
2007-07-18 1:35 ` [PATCH 37/61] cpm2: Rework 8272ads initialization, and eliminate init_fcc_ioports() Scott Wood
2007-07-19 0:04 ` Arnd Bergmann
2007-07-19 0:14 ` Arnd Bergmann
2007-07-19 15:02 ` Scott Wood
2007-07-18 1:35 ` [PATCH 38/61] cpm2: Update device trees Scott Wood
2007-07-18 12:22 ` Vitaly Bordug
2007-07-18 16:42 ` Scott Wood
2007-07-19 15:04 ` Segher Boessenkool
2007-07-18 1:35 ` [PATCH 39/61] mpc885ads: Whitespace cleanup (space->tab) Scott Wood
2007-07-18 5:38 ` Kumar Gala
2007-07-18 1:35 ` [PATCH 40/61] 8xx: Whitespace cleanup in commproc.c Scott Wood
2007-07-18 1:35 ` [PATCH 41/61] 8xx: Keep a global mpc8xx_immr mapping Scott Wood
2007-07-18 1:35 ` [PATCH 42/61] 8xx: commproc.c: Use better OF names Scott Wood
2007-07-18 1:35 ` [PATCH 43/61] 8xx: Always reset CPM if not using early console Scott Wood
2007-07-18 1:35 ` [PATCH 44/61] 8xx: Miscellaneous commproc.c cleanup Scott Wood
2007-07-18 1:35 ` [PATCH 45/61] 8xx: Add pin and clock setting functions Scott Wood
2007-07-18 1:36 ` [PATCH 46/61] mpc885ads: Rework initialization Scott Wood
2007-07-18 8:44 ` Vitaly Bordug
2007-07-18 16:40 ` Scott Wood
2007-07-18 18:24 ` Vitaly Bordug
2007-07-18 18:29 ` Scott Wood
2007-07-18 19:31 ` Scott Wood
2007-07-18 1:36 ` [PATCH 47/61] 8xx: Don't hardcode the vendor in cpuinfo Scott Wood
2007-07-18 1:36 ` [PATCH 48/61] 8xx: Use better OF names for PIC Scott Wood
2007-07-18 1:36 ` [PATCH 49/61] 8xx: Update device trees Scott Wood
2007-07-19 14:36 ` Segher Boessenkool
2007-07-19 16:57 ` Vitaly Bordug
2007-07-19 17:11 ` Segher Boessenkool
2007-07-19 18:56 ` Scott Wood
2007-07-19 19:04 ` Segher Boessenkool
2007-07-18 1:36 ` [PATCH 50/61] fsl_soc: Remove 8xx/cpm2 glue code Scott Wood
2007-07-18 1:36 ` [PATCH 51/61] cpm_uart: Be an of_platform device when using arch/powerpc Scott Wood
2007-07-18 8:53 ` Vitaly Bordug
2007-07-18 23:59 ` Arnd Bergmann
2007-07-18 1:36 ` [PATCH 52/61] cpm_uart: Issue STOP_TX command before initializing console Scott Wood
2007-07-18 8:00 ` Vitaly Bordug
2007-07-18 16:35 ` Scott Wood
2007-07-18 17:24 ` Vitaly Bordug
2007-07-18 1:36 ` [PATCH 53/61] 82xx: Set NOT_COHERENT_CACHE on 8272 with PCI Scott Wood
2007-07-18 3:28 ` David Gibson
2007-07-18 4:30 ` Kumar Gala
2007-07-18 20:08 ` Scott Wood
2007-07-19 14:58 ` Kumar Gala
2007-07-19 16:36 ` Scott Wood
2007-07-19 14:40 ` Segher Boessenkool
2007-07-18 1:36 ` [PATCH 54/61] Update mpc885ads defconfig Scott Wood
2007-07-18 1:36 ` [PATCH 55/61] Update mpc8272ads defconfig Scott Wood
2007-07-18 1:36 ` [PATCH 56/61] 82xx: Add pq2fads board support Scott Wood
2007-07-18 23:54 ` Arnd Bergmann
2007-07-19 14:59 ` Scott Wood
2007-07-18 1:36 ` [PATCH 57/61] fs_enet: Whitespace cleanup Scott Wood
2007-07-18 1:36 ` [PATCH 58/61] fs_enet: Don't share the interrupt Scott Wood
2007-07-18 1:36 ` [PATCH 59/61] fs_enet: mac-fcc: Eliminate __fcc-* macros Scott Wood
2007-07-18 1:36 ` [PATCH 60/61] fs_enet: Align receive buffers Scott Wood
2007-07-18 1:36 ` [PATCH 61/61] fs_enet: Be an of_platform device when using arch/powerpc Scott Wood
2007-07-18 1:58 ` [PATCH 01/61] Use strcasecmp() rather than strncasecmp() when determining device node compatibility Michael Ellerman
2007-07-18 6:39 ` Geert Uytterhoeven
2007-07-18 4:27 ` Kumar Gala
2007-07-18 16:17 ` Scott Wood
2007-07-18 6:07 ` Stephen Rothwell
2007-07-18 16:29 ` [PATCH 19/61] 8xx: Fix CONFIG_PIN_TLB Scott Wood
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=469E614B.1000700@freescale.com \
--to=scottwood@freescale.com \
--cc=galak@kernel.crashing.org \
--cc=linuxppc-dev@ozlabs.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).