Lines Matching +full:bcm2835 +full:- +full:firmware

1 /*-
57 #include <arm/broadcom/bcm2835/bcm2835_mbox.h>
58 #include <arm/broadcom/bcm2835/bcm2835_mbox_prop.h>
59 #include <arm/broadcom/bcm2835/bcm2835_vcbus.h>
73 mtx_lock(&(_sc)->sc_mtx)
75 mtx_unlock(&(_sc)->sc_mtx)
77 mtx_init(&_sc->sc_mtx, device_get_nameunit(_sc->sc_dev), \
80 mtx_destroy(&_sc->sc_mtx);
82 mtx_assert(&(_sc)->sc_mtx, MA_OWNED)
107 #define MAX_TOUCH_ID (10 - 1)
143 memcpy(sc->sc_window, sc->touch_buf, FT5406_WINDOW_SIZE); in ft5406ts_callout()
144 sc->touch_buf[FT5406_NUM_POINTS] = NO_POINTS; in ft5406ts_callout()
146 points = GET_NUM_POINTS(sc->sc_window); in ft5406ts_callout()
148 * No update from VC - do nothing. in ft5406ts_callout()
154 id = GET_TOUCH_ID(sc->sc_window, i); in ft5406ts_callout()
155 x = GET_X(sc->sc_window, i); in ft5406ts_callout()
156 y = GET_Y(sc->sc_window, i); in ft5406ts_callout()
159 device_printf(sc->sc_dev, "bad touch id: %d", id); in ft5406ts_callout()
162 evdev_push_event(sc->sc_evdev, EV_ABS, ABS_MT_SLOT, id); in ft5406ts_callout()
163 evdev_push_event(sc->sc_evdev, EV_ABS, ABS_MT_TRACKING_ID, id); in ft5406ts_callout()
164 evdev_push_event(sc->sc_evdev, EV_ABS, ABS_MT_POSITION_X, x); in ft5406ts_callout()
165 evdev_push_event(sc->sc_evdev, EV_ABS, ABS_MT_POSITION_Y, y); in ft5406ts_callout()
167 evdev_sync(sc->sc_evdev); in ft5406ts_callout()
169 callout_reset(&sc->sc_callout, sc->sc_tick, ft5406ts_callout, sc); in ft5406ts_callout()
179 callout_stop(&sc->sc_callout); in ft5406ts_ev_close()
191 callout_reset(&sc->sc_callout, sc->sc_tick, ft5406ts_callout, sc); in ft5406ts_ev_open()
205 config_intrhook_disestablish(&sc->sc_init_hook); in ft5406ts_init()
218 device_printf(sc->sc_dev, "failed to get touchbuf address\n"); in ft5406ts_init()
223 device_printf(sc->sc_dev, "touchscreen not detected\n"); in ft5406ts_init()
228 sc->touch_buf = (uint8_t*)pmap_mapdev(touchbuf, FT5406_WINDOW_SIZE); in ft5406ts_init()
231 sc->sc_tick = hz * 17 / 1000; in ft5406ts_init()
232 if (sc->sc_tick == 0) in ft5406ts_init()
233 sc->sc_tick = 1; in ft5406ts_init()
235 sc->sc_evdev = evdev_alloc(); in ft5406ts_init()
236 evdev_set_name(sc->sc_evdev, device_get_desc(sc->sc_dev)); in ft5406ts_init()
237 evdev_set_phys(sc->sc_evdev, device_get_nameunit(sc->sc_dev)); in ft5406ts_init()
238 evdev_set_id(sc->sc_evdev, BUS_HOST, 0, 0, 0); in ft5406ts_init()
239 evdev_set_methods(sc->sc_evdev, sc, &ft5406ts_evdev_methods); in ft5406ts_init()
240 evdev_set_flag(sc->sc_evdev, EVDEV_FLAG_MT_STCOMPAT); in ft5406ts_init()
241 evdev_set_flag(sc->sc_evdev, EVDEV_FLAG_MT_AUTOREL); in ft5406ts_init()
242 evdev_support_prop(sc->sc_evdev, INPUT_PROP_DIRECT); in ft5406ts_init()
243 evdev_support_event(sc->sc_evdev, EV_SYN); in ft5406ts_init()
244 evdev_support_event(sc->sc_evdev, EV_ABS); in ft5406ts_init()
246 evdev_support_abs(sc->sc_evdev, ABS_MT_SLOT, 0, in ft5406ts_init()
248 evdev_support_abs(sc->sc_evdev, ABS_MT_TRACKING_ID, -1, in ft5406ts_init()
250 evdev_support_abs(sc->sc_evdev, ABS_MT_POSITION_X, 0, in ft5406ts_init()
252 evdev_support_abs(sc->sc_evdev, ABS_MT_POSITION_Y, 0, in ft5406ts_init()
255 err = evdev_register_mtx(sc->sc_evdev, &sc->sc_mtx); in ft5406ts_init()
257 evdev_free(sc->sc_evdev); in ft5406ts_init()
258 sc->sc_evdev = NULL; /* Avoid double free */ in ft5406ts_init()
262 sc->touch_buf[FT5406_NUM_POINTS] = NO_POINTS; in ft5406ts_init()
263 callout_init_mtx(&sc->sc_callout, &sc->sc_mtx, 0); in ft5406ts_init()
270 if (!ofw_bus_is_compatible(dev, "raspberrypi,firmware-ts")) in ft5406ts_probe()
285 sc->sc_dev = dev; in ft5406ts_attach()
288 sc->sc_init_hook.ich_func = ft5406ts_init; in ft5406ts_attach()
289 sc->sc_init_hook.ich_arg = sc; in ft5406ts_attach()
293 if (config_intrhook_establish(&sc->sc_init_hook) != 0) { in ft5406ts_attach()
309 evdev_free(sc->sc_evdev); in ft5406ts_detach()