Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/terasic/mtl/terasic_mtl.h
Show All 27 Lines | |||||
* SUCH DAMAGE. | * SUCH DAMAGE. | ||||
* | * | ||||
* $FreeBSD$ | * $FreeBSD$ | ||||
*/ | */ | ||||
#ifndef _DEV_TERASIC_MTL_H_ | #ifndef _DEV_TERASIC_MTL_H_ | ||||
#define _DEV_TERASIC_MTL_H_ | #define _DEV_TERASIC_MTL_H_ | ||||
#include "opt_syscons.h" | |||||
struct terasic_mtl_softc { | struct terasic_mtl_softc { | ||||
#if defined(DEV_SC) | |||||
/* | /* | ||||
* syscons requires that its video_adapter_t be at the front of the | * syscons requires that its video_adapter_t be at the front of the | ||||
* softc, so place syscons fields first, which we otherwise would | * softc, so place syscons fields first, which we otherwise would | ||||
* probably not do. | * probably not do. | ||||
*/ | */ | ||||
video_adapter_t mtl_va; | video_adapter_t mtl_va; | ||||
#endif | |||||
/* | /* | ||||
* Bus-related fields. | * Bus-related fields. | ||||
*/ | */ | ||||
device_t mtl_dev; | device_t mtl_dev; | ||||
int mtl_unit; | int mtl_unit; | ||||
/* | /* | ||||
* The MTL driver doesn't require a lot of synchronisation; however, | * The MTL driver doesn't require a lot of synchronisation; however, | ||||
* the lock is used to protect read-modify-write operations on MTL | * the lock is used to protect read-modify-write operations on MTL | ||||
* registers. | * registers. | ||||
*/ | */ | ||||
struct mtx mtl_lock; | struct mtx mtl_lock; | ||||
/* | /* | ||||
* Control register device -- mappable from userspace. | * Control register device -- mappable from userspace. | ||||
*/ | */ | ||||
struct cdev *mtl_reg_cdev; | struct cdev *mtl_reg_cdev; | ||||
struct resource *mtl_reg_res; | struct resource *mtl_reg_res; | ||||
int mtl_reg_rid; | int mtl_reg_rid; | ||||
/* | /* | ||||
* Graphics frame buffer device -- mappable from userspace. | * Graphics frame buffer device -- mappable from userspace, and used | ||||
* by the vt framebuffer interface. | |||||
*/ | */ | ||||
struct cdev *mtl_pixel_cdev; | struct cdev *mtl_pixel_cdev; | ||||
struct resource *mtl_pixel_res; | struct resource *mtl_pixel_res; | ||||
int mtl_pixel_rid; | int mtl_pixel_rid; | ||||
/* | /* | ||||
* Text frame buffer device -- mappable from userspace, and syscons | * Text frame buffer device -- mappable from userspace, and syscons | ||||
* hookup. | * hookup. | ||||
*/ | */ | ||||
struct cdev *mtl_text_cdev; | struct cdev *mtl_text_cdev; | ||||
struct resource *mtl_text_res; | struct resource *mtl_text_res; | ||||
int mtl_text_rid; | int mtl_text_rid; | ||||
uint16_t *mtl_text_soft; | uint16_t *mtl_text_soft; | ||||
/* | |||||
* Framebuffer hookup for vt(4). | |||||
*/ | |||||
struct fb_info mtl_fb_info; | |||||
}; | }; | ||||
#define TERASIC_MTL_LOCK(sc) mtx_lock(&(sc)->mtl_lock) | #define TERASIC_MTL_LOCK(sc) mtx_lock(&(sc)->mtl_lock) | ||||
#define TERASIC_MTL_LOCK_ASSERT(sc) mtx_assert(&(sc)->mtl_lock, MA_OWNED) | #define TERASIC_MTL_LOCK_ASSERT(sc) mtx_assert(&(sc)->mtl_lock, MA_OWNED) | ||||
#define TERASIC_MTL_LOCK_DESTROY(sc) mtx_destroy(&(sc)->mtl_lock) | #define TERASIC_MTL_LOCK_DESTROY(sc) mtx_destroy(&(sc)->mtl_lock) | ||||
#define TERASIC_MTL_LOCK_INIT(sc) mtx_init(&(sc)->mtl_lock, \ | #define TERASIC_MTL_LOCK_INIT(sc) mtx_init(&(sc)->mtl_lock, \ | ||||
"terasic_mtl", NULL, MTX_DEF) | "terasic_mtl", NULL, MTX_DEF) | ||||
#define TERASIC_MTL_UNLOCK(sc) mtx_unlock(&(sc)->mtl_lock) | #define TERASIC_MTL_UNLOCK(sc) mtx_unlock(&(sc)->mtl_lock) | ||||
▲ Show 20 Lines • Show All 72 Lines • ▼ Show 20 Lines | |||||
int terasic_mtl_attach(struct terasic_mtl_softc *sc); | int terasic_mtl_attach(struct terasic_mtl_softc *sc); | ||||
void terasic_mtl_detach(struct terasic_mtl_softc *sc); | void terasic_mtl_detach(struct terasic_mtl_softc *sc); | ||||
extern devclass_t terasic_mtl_devclass; | extern devclass_t terasic_mtl_devclass; | ||||
/* | /* | ||||
* Sub-driver setup routines. | * Sub-driver setup routines. | ||||
*/ | */ | ||||
int terasic_mtl_fbd_attach(struct terasic_mtl_softc *sc); | |||||
void terasic_mtl_fbd_detach(struct terasic_mtl_softc *sc); | |||||
int terasic_mtl_pixel_attach(struct terasic_mtl_softc *sc); | int terasic_mtl_pixel_attach(struct terasic_mtl_softc *sc); | ||||
void terasic_mtl_pixel_detach(struct terasic_mtl_softc *sc); | void terasic_mtl_pixel_detach(struct terasic_mtl_softc *sc); | ||||
int terasic_mtl_reg_attach(struct terasic_mtl_softc *sc); | int terasic_mtl_reg_attach(struct terasic_mtl_softc *sc); | ||||
void terasic_mtl_reg_detach(struct terasic_mtl_softc *sc); | void terasic_mtl_reg_detach(struct terasic_mtl_softc *sc); | ||||
int terasic_mtl_syscons_attach(struct terasic_mtl_softc *sc); | int terasic_mtl_syscons_attach(struct terasic_mtl_softc *sc); | ||||
void terasic_mtl_syscons_detach(struct terasic_mtl_softc *sc); | void terasic_mtl_syscons_detach(struct terasic_mtl_softc *sc); | ||||
int terasic_mtl_text_attach(struct terasic_mtl_softc *sc); | int terasic_mtl_text_attach(struct terasic_mtl_softc *sc); | ||||
void terasic_mtl_text_detach(struct terasic_mtl_softc *sc); | void terasic_mtl_text_detach(struct terasic_mtl_softc *sc); | ||||
Show All 38 Lines |