From: Leblanc f. <fle...@us...> - 2002-03-07 09:15:20
|
Update of /cvsroot/linux-mips/linux/include/asm-mips In directory usw-pr-cvs1:/tmp/cvs-serv3157/include/asm-mips Modified Files: io.h vr41xx-platdep.h Added Files: power.h Log Message: Adds more VR stuff for Cassiopeia E15 Support. --- NEW FILE: power.h --- /* * power.h - Common power management defines * * Copyright (C) 2000 Michael Klar * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * */ #ifndef __ASM_POWER_H #define __ASM_POWER_H #ifndef _LANGUAGE_ASSEMBLY extern unsigned int powerevent_queued; extern unsigned int hibernation_state; extern asmlinkage void do_wakeup(char *command); extern asmlinkage void do_hibernate(void *sp); #endif #define LOAD_MAGIC (('L'<<24) | ('O'<<16) | ('A'<<8) | 'D') #define HIB_MAGIC ((' '<<24) | ('H'<<16) | ('I'<<8) | 'B') #define RUN_MAGIC ((' '<<24) | ('R'<<16) | ('U'<<8) | 'N') #endif /* __ASM_POWER_H */ Index: io.h =================================================================== RCS file: /cvsroot/linux-mips/linux/include/asm-mips/io.h,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- io.h 12 Feb 2002 18:03:12 -0000 1.17 +++ io.h 7 Mar 2002 09:15:17 -0000 1.18 @@ -309,6 +309,39 @@ } } +#ifdef CONFIG_CASIO_E15 +#define __OUTS1(s) \ +extern inline void __outs##s(unsigned int port, const void * addr, unsigned long count) { + +#define __OUTS2(m) \ +if (count) \ +__asm__ __volatile__ ( \ + ".set\tnoreorder\n\t" \ + ".set\tnoat\n" \ + "1:\tl" #m "\t$1,(%0)\n\t" \ + "subu\t%1,1\n\t" \ + "s" #m "\t$1,%4(%5)\n\t" \ + "bne\t$0,%1,1b\n\t" \ + "addiu\t%0,%6\n\t" \ + ".set\tat\n\t" \ + ".set\treorder" + +#define __OUTS(m,s,i) \ +__OUTS1(s) __OUTS2(m) \ + : "=r" (addr), "=r" (count) \ + : "0" (addr), "1" (count), "i" (0), "r" (mips_io_port_base+port), "I" (i) \ + : "$1");} \ +__OUTS1(s##c) __OUTS2(m) \ + : "=r" (addr), "=r" (count) \ + : "0" (addr), "1" (count), "ir" (port), "r" (mips_io_port_base), "I" (i) \ + : "$1");} + +__OUTS(h,w,2) + +#define outsw(port,addr,count) \ + __outsw ((port),(addr),(count)) + +#else static inline void outsw(unsigned long port, void *addr, unsigned int count) { while (count--) { @@ -316,7 +349,41 @@ addr += 2; } } +#endif + +#ifdef CONFIG_CASIO_E15 +#define __INS1(s) \ +extern inline void __ins##s(unsigned int port, void * addr, unsigned long count) { + +#define __INS2(m) \ +if (count) \ +__asm__ __volatile__ ( \ + ".set\tnoreorder\n\t" \ + ".set\tnoat\n" \ + "1:\tl" #m "\t$1,%4(%5)\n\t" \ + "subu\t%1,1\n\t" \ + "s" #m "\t$1,(%0)\n\t" \ + "bne\t$0,%1,1b\n\t" \ + "addiu\t%0,%6\n\t" \ + ".set\tat\n\t" \ + ".set\treorder" +#define __INS(m,s,i) \ +__INS1(s) __INS2(m) \ + : "=r" (addr), "=r" (count) \ + : "0" (addr), "1" (count), "i" (0), "r" (mips_io_port_base+port), "I" (i) \ + : "$1");} \ +__INS1(s##c) __INS2(m) \ + : "=r" (addr), "=r" (count) \ + : "0" (addr), "1" (count), "ir" (port), "r" (mips_io_port_base), "I" (i) \ + : "$1");} + +__INS(h,w,2) + +#define insw(port,addr,count) \ + __insw((port),(addr),(count)) + +#else static inline void insw(unsigned long port, void *addr, unsigned int count) { while (count--) { @@ -324,6 +391,7 @@ addr += 2; } } +#endif static inline void outsl(unsigned long port, void *addr, unsigned int count) { Index: vr41xx-platdep.h =================================================================== RCS file: /cvsroot/linux-mips/linux/include/asm-mips/vr41xx-platdep.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- vr41xx-platdep.h 10 Dec 2001 17:39:09 -0000 1.1 +++ vr41xx-platdep.h 7 Mar 2002 09:15:17 -0000 1.2 @@ -67,7 +67,38 @@ #define FB_Y_RES 320 #define FB_BPP 4 #define FB_IS_GREY 1 -#define FB_IS_INVERSE 1 +#define FB_IS_INVERSE 0 //1 + +// GPIO[27] is speaker power on/off bit +#define VR41XX_ENABLE_SPEAKER() \ + { \ + int flags; \ + save_and_cli(flags); \ + *VR41XX_GIUPIODH |= VR41XX_GIUPIODH_GPIO27; \ + restore_flags(flags); \ + } +#define VR41XX_DISABLE_SPEAKER() \ + { \ + int flags; \ + save_and_cli(flags); \ + *VR41XX_GIUPIODH &= ~VR41XX_GIUPIODH_GPIO27; \ + restore_flags(flags); \ + } + +/* LCD control management */ +extern void gpiolcd_setup(void); +extern int gpiolcd_backlight(int n); +extern int get_gpiolcd_backlight(void); +extern int gpiolcd_contrast(int n); +extern int get_gpiolcd_contrast(void); +extern int gpiolcd_lcdpower(int on); +#define LCD_SETUP() gpiolcd_setup() +#define LCD_BACKLIGHT(n) gpiolcd_backlight(n) +#define GET_LCD_BACKLIGHT() get_gpiolcd_backlight() +#define LCD_CONTRAST(n) gpiolcd_contrast(n) +#define GET_LCD_CONTRAST() get_gpiolcd_contrast() +#define LCD_POWER(n) gpiolcd_lcdpower(n) + #endif #ifdef CONFIG_CASIO_E105 |