7a6db373f5c83db6525c620d24e66a5470659a91
[mplayer/glamo.git] / drivers / libglamo / glamo.h
blob7a6db373f5c83db6525c620d24e66a5470659a91
1 /*
2 * Glamo chip access library (for graphics).
4 * Copyright (C) 2007 OpenMoko, Inc.
5 * Author: Chia-I Wu <olv@openmoko.org>
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 or
10 * (at your option) version 3 of the License.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20 * MA 02111-1307 USA
22 #ifndef _GLAMO_H_
23 #define _GLAMO_H_
25 #define GLAMO_OUT_REG(reg, val) (*((volatile unsigned short *) ((glamo_mmio) + (reg))) = (val))
26 #define GLAMO_IN_REG(reg) (*((volatile unsigned short *) ((glamo_mmio) + (reg))))
28 extern volatile unsigned char *glamo_fb;
29 extern volatile unsigned char *glamo_mmio;
30 extern int glamo_pitch;
32 extern int mydiv(int n, int d);
33 extern int myrem(int n, int d);
35 inline static void glamo_set_bit_mask(int reg, int mask, int val)
37 int old;
39 old = GLAMO_IN_REG(reg);
40 old &= ~mask;
41 old |= val & mask;
42 GLAMO_OUT_REG(reg, old);
45 int glamo_os_init(const char *fb_path);
46 void glamo_os_finish(void);
48 #endif /* _GLAMO_H_ */