diff options
author | Jochen Friedrich <jochen@scram.de> | 2007-11-22 11:54:13 -0500 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2007-12-13 23:46:42 -0500 |
commit | 721c0c8af1a27941a34af5046aae4a8369c8404c (patch) | |
tree | e21e70bf584b22296019f7ca4a97529f1f1f1d1d /arch/powerpc/sysdev/commproc.c | |
parent | 0b5cf10691eb2c95a9126bf25f5e084d83d5d743 (diff) |
[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.
Signed-off-by: Jochen Friedrich <jochen@scram.de>
Acked-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Vitaly Bordug <vitb@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/sysdev/commproc.c')
-rw-r--r-- | arch/powerpc/sysdev/commproc.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/commproc.c index f6a63780bbde..74d937249348 100644 --- a/arch/powerpc/sysdev/commproc.c +++ b/arch/powerpc/sysdev/commproc.c | |||
@@ -408,7 +408,7 @@ EXPORT_SYMBOL(cpm_dpram_phys); | |||
408 | #endif /* !CONFIG_PPC_CPM_NEW_BINDING */ | 408 | #endif /* !CONFIG_PPC_CPM_NEW_BINDING */ |
409 | 409 | ||
410 | struct cpm_ioport16 { | 410 | struct cpm_ioport16 { |
411 | __be16 dir, par, sor, dat, intr; | 411 | __be16 dir, par, odr_sor, dat, intr; |
412 | __be16 res[3]; | 412 | __be16 res[3]; |
413 | }; | 413 | }; |
414 | 414 | ||
@@ -438,6 +438,13 @@ static void cpm1_set_pin32(int port, int pin, int flags) | |||
438 | else | 438 | else |
439 | clrbits32(&iop->par, pin); | 439 | clrbits32(&iop->par, pin); |
440 | 440 | ||
441 | if (port == CPM_PORTB) { | ||
442 | if (flags & CPM_PIN_OPENDRAIN) | ||
443 | setbits16(&mpc8xx_immr->im_cpm.cp_pbodr, pin); | ||
444 | else | ||
445 | clrbits16(&mpc8xx_immr->im_cpm.cp_pbodr, pin); | ||
446 | } | ||
447 | |||
441 | if (port == CPM_PORTE) { | 448 | if (port == CPM_PORTE) { |
442 | if (flags & CPM_PIN_SECONDARY) | 449 | if (flags & CPM_PIN_SECONDARY) |
443 | setbits32(&iop->sor, pin); | 450 | setbits32(&iop->sor, pin); |
@@ -471,11 +478,17 @@ static void cpm1_set_pin16(int port, int pin, int flags) | |||
471 | else | 478 | else |
472 | clrbits16(&iop->par, pin); | 479 | clrbits16(&iop->par, pin); |
473 | 480 | ||
481 | if (port == CPM_PORTA) { | ||
482 | if (flags & CPM_PIN_OPENDRAIN) | ||
483 | setbits16(&iop->odr_sor, pin); | ||
484 | else | ||
485 | clrbits16(&iop->odr_sor, pin); | ||
486 | } | ||
474 | if (port == CPM_PORTC) { | 487 | if (port == CPM_PORTC) { |
475 | if (flags & CPM_PIN_SECONDARY) | 488 | if (flags & CPM_PIN_SECONDARY) |
476 | setbits16(&iop->sor, pin); | 489 | setbits16(&iop->odr_sor, pin); |
477 | else | 490 | else |
478 | clrbits16(&iop->sor, pin); | 491 | clrbits16(&iop->odr_sor, pin); |
479 | } | 492 | } |
480 | } | 493 | } |
481 | 494 | ||