Skip to contentSkip to conversation

powerpc: Add support for PORTA and PORTB odr registers

PATCH In review Jochen Friedrich 2 participants 2 messages Nov 13, 2007 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: Add support for PORTA and PORTB odr registers

PORTA and PORTB have odr registers, as well. However, the PORTB odr register is only 16bit.

---
arch/powerpc/sysdev/commproc.c | 13 +++++++++++++

1 files changed, 13 insertions(+), 0 deletions(-)
arch/powerpc/sysdev/commproc.c +0 -0
index d5a0dcf..3694a69 100644
@@ -441,6 +441,13 @@ static void cpm1_set_pin32(int port, int pin, int flags)
	else
		clrbits32(&iop->par, pin);

+ if (port == CPM_PORTB) {
+ if (flags & CPM_PIN_OPENDRAIN)
+ setbits16(&mpc8xx_immr->im_cpm.cp_pbodr, pin);
+ else
+ clrbits16(&mpc8xx_immr->im_cpm.cp_pbodr, pin);
+ }
+

	if (port == CPM_PORTE) {
		if (flags & CPM_PIN_SECONDARY)
			setbits32(&iop->sor, pin);
@@ -474,6 +481,12 @@ static void cpm1_set_pin16(int port, int pin, int flags)
	else
		clrbits16(&iop->par, pin);

+ if (port == CPM_PORTA) {
+ if (flags & CPM_PIN_OPENDRAIN)
+ setbits16(&iop->odr, pin);
+ else
+ clrbits16(&iop->odr, pin);
+ }

	if (port == CPM_PORTC) {
		if (flags & CPM_PIN_SECONDARY)
			setbits16(&iop->sor, pin);
Signature · 1 line
1.5.3.5
#1 lore raw
Quoted 13 lines · Jochen Friedrich
(quoted diff) +6 -0
@@ -474,6 +481,12 @@ static void cpm1_set_pin16(int port, int pin, int 
 flags)
    else
        clrbits16(&iop->par, pin);
 
+    if (port == CPM_PORTA) {
+        if (flags & CPM_PIN_OPENDRAIN)
+            setbits16(&iop->odr, pin);
+        else
+            clrbits16(&iop->odr, pin);
+    }
    if (port == CPM_PORTC) {
        if (flags & CPM_PIN_SECONDARY)
Quoted 1 line
            setbits16(&iop->sor, pin);

Where is the odr field of cpm_ioport16 defined? It's the same position as sor, so maybe call it odr_sor or something.

Also, please add an extra newline after the closing brace.

-Scott