Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * linux/arch/sh/boards/hp6xx/hp680/setup.c |
| 3 | * |
| 4 | * Copyright (C) 2002 Andriy Skulysh |
| 5 | * |
| 6 | * May be copied or modified under the terms of the GNU General Public |
| 7 | * License. See linux/COPYING for more information. |
| 8 | * |
| 9 | * Setup code for an HP680 (internal peripherials only) |
| 10 | */ |
| 11 | |
| 12 | #include <linux/config.h> |
| 13 | #include <linux/init.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 14 | #include <asm/io.h> |
Paul Mundt | 0025835 | 2006-01-16 22:14:08 -0800 | [diff] [blame^] | 15 | #include <asm/hd64461.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 | #include <asm/hp6xx/hp6xx.h> |
| 17 | #include <asm/cpu/dac.h> |
| 18 | |
| 19 | const char *get_system_type(void) |
| 20 | { |
Paul Mundt | 0025835 | 2006-01-16 22:14:08 -0800 | [diff] [blame^] | 21 | return "HP6xx"; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | } |
| 23 | |
| 24 | int __init platform_setup(void) |
| 25 | { |
Paul Mundt | 0025835 | 2006-01-16 22:14:08 -0800 | [diff] [blame^] | 26 | u8 v8; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 | u16 v; |
| 28 | v = inw(HD64461_STBCR); |
| 29 | v |= HD64461_STBCR_SURTST | HD64461_STBCR_SIRST | |
| 30 | HD64461_STBCR_STM1ST | HD64461_STBCR_STM0ST | |
| 31 | HD64461_STBCR_SAFEST | HD64461_STBCR_SPC0ST | |
| 32 | HD64461_STBCR_SMIAST | HD64461_STBCR_SAFECKE_OST | |
| 33 | HD64461_STBCR_SAFECKE_IST; |
Paul Mundt | 0025835 | 2006-01-16 22:14:08 -0800 | [diff] [blame^] | 34 | #ifndef CONFIG_HD64461_ENABLER |
| 35 | v |= HD64461_STBCR_SPC1ST; |
| 36 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 | outw(v, HD64461_STBCR); |
| 38 | v = inw(HD64461_GPADR); |
| 39 | v |= HD64461_GPADR_SPEAKER | HD64461_GPADR_PCMCIA0; |
| 40 | outw(v, HD64461_GPADR); |
| 41 | |
Paul Mundt | 0025835 | 2006-01-16 22:14:08 -0800 | [diff] [blame^] | 42 | outw(HD64461_PCCGCR_VCC0 | HD64461_PCCSCR_VCC1, HD64461_PCC0GCR); |
| 43 | |
| 44 | #ifndef CONFIG_HD64461_ENABLER |
| 45 | outw(HD64461_PCCGCR_VCC0 | HD64461_PCCSCR_VCC1, HD64461_PCC1GCR); |
| 46 | #endif |
| 47 | |
| 48 | sh_dac_output(0, DAC_SPEAKER_VOLUME); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 49 | sh_dac_disable(DAC_SPEAKER_VOLUME); |
Paul Mundt | 0025835 | 2006-01-16 22:14:08 -0800 | [diff] [blame^] | 50 | v8 = ctrl_inb(DACR); |
| 51 | v8 &= ~DACR_DAE; |
| 52 | ctrl_outb(v8,DACR); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 53 | |
| 54 | return 0; |
| 55 | } |