Somewhat improve HDMI event API

- Pass device_t for HDMI framer as an argument for event hook
- Use #define for event values, instead of opaque (and unused) 0
This commit is contained in:
Oleksandr Tymoshenko 2015-11-14 21:01:35 +00:00
parent 21daf914a1
commit 6f79d9e96c
3 changed files with 6 additions and 4 deletions

View File

@ -35,8 +35,10 @@ INTERFACE hdmi;
HEADER {
#include <sys/eventhandler.h>
typedef void (*hdmi_event_hook)(void *, int);
typedef void (*hdmi_event_hook)(void *, device_t, int);
EVENTHANDLER_DECLARE(hdmi_event, hdmi_event_hook);
#define HDMI_EVENT_CONNECTED 0
}
#

View File

@ -800,7 +800,7 @@ am335x_lcd_configure(struct am335x_lcd_softc *sc)
}
static void
am335x_lcd_hdmi_event(void *arg)
am335x_lcd_hdmi_event(void *arg, device_t hdmi, int event)
{
struct am335x_lcd_softc *sc;
const struct videomode *videomode;
@ -1001,7 +1001,7 @@ am335x_lcd_attach(device_t dev)
am335x_lcd_configure(sc);
else
sc->sc_hdmi_evh = EVENTHANDLER_REGISTER(hdmi_event,
am335x_lcd_hdmi_event, sc, 0);
am335x_lcd_hdmi_event, sc, EVENTHANDLER_PRI_ANY);
return (0);
}

View File

@ -635,7 +635,7 @@ tda19988_read_edid(struct tda19988_softc *sc)
}
}
EVENTHANDLER_INVOKE(hdmi_event, 0);
EVENTHANDLER_INVOKE(hdmi_event, sc->sc_dev, HDMI_EVENT_CONNECTED);
done:
if (sc->sc_version == TDA19988)
tda19988_reg_set(sc, TDA_TX4, TX4_PD_RAM);