{
struct nouveau_gpio *gpio = nouveau_gpio(event->priv);
const struct nouveau_gpio_impl *impl = (void *)nv_object(gpio)->oclass;
- impl->intr_mask(gpio, NVKM_GPIO_TOGGLED, 1 << index, 0);
+ impl->intr_mask(gpio, type, 1 << index, 0);
}
static void
{
struct nouveau_gpio *gpio = nouveau_gpio(event->priv);
const struct nouveau_gpio_impl *impl = (void *)nv_object(gpio)->oclass;
- impl->intr_mask(gpio, NVKM_GPIO_TOGGLED, 1 << index, 1 << index);
+ impl->intr_mask(gpio, type, 1 << index, 1 << index);
}
static void
{
struct nouveau_gpio *gpio = nouveau_gpio(subdev);
const struct nouveau_gpio_impl *impl = (void *)nv_object(gpio)->oclass;
- u32 hi, lo, i;
+ u32 hi, lo, e, i;
impl->intr_stat(gpio, &hi, &lo);
- for (i = 0; (hi | lo) && i < impl->lines; i++) {
- if ((hi | lo) & (1 << i))
- nouveau_event_trigger(gpio->events, 1, i);
+ for (i = 0; e = 0, (hi | lo) && i < impl->lines; i++) {
+ if (hi & (1 << i))
+ e |= NVKM_GPIO_HI;
+ if (lo & (1 << i))
+ e |= NVKM_GPIO_LO;
+ nouveau_event_trigger(gpio->events, e, i);
}
}
gpio->get = nouveau_gpio_get;
gpio->reset = impl->reset;
- ret = nouveau_event_create(1, impl->lines, &gpio->events);
+ ret = nouveau_event_create(2, impl->lines, &gpio->events);
if (ret)
return ret;
int _nouveau_gpio_init(struct nouveau_object *);
int _nouveau_gpio_fini(struct nouveau_object *, bool);
-enum nvkm_gpio_event {
- NVKM_GPIO_HI = 1,
- NVKM_GPIO_LO = 2,
- NVKM_GPIO_TOGGLED = (NVKM_GPIO_HI | NVKM_GPIO_LO),
-};
-
struct nouveau_gpio_impl {
struct nouveau_oclass base;
int lines;
nv_connector->hpd.func = DCB_GPIO_UNUSED;
if (nv_connector->hpd.func != DCB_GPIO_UNUSED) {
- nouveau_event_new(gpio->events, 1,
+ nouveau_event_new(gpio->events, NVKM_GPIO_TOGGLED,
nv_connector->hpd.line,
nouveau_connector_hotplug,
nv_connector,