Remove use of intr_config_hook from the am335x_pmic and tda19988 drivers.
Long ago this was needed, but now low-level i2c controller drivers cleverly defer attachment of the bus until interrupts are enabled (if they require interrupts to function), so that every i2c slave device doesn't have to.
This commit is contained in:
parent
a51f005289
commit
2a002a0549
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=350849
@ -60,7 +60,6 @@ __FBSDID("$FreeBSD$");
|
||||
struct am335x_pmic_softc {
|
||||
device_t sc_dev;
|
||||
uint32_t sc_addr;
|
||||
struct intr_config_hook enum_hook;
|
||||
struct resource *sc_irq_res;
|
||||
void *sc_intrhand;
|
||||
struct task intr_task;
|
||||
@ -210,10 +209,9 @@ am335x_pmic_setvo(device_t dev, uint8_t vo)
|
||||
}
|
||||
|
||||
static void
|
||||
am335x_pmic_start(void *xdev)
|
||||
am335x_pmic_start(struct am335x_pmic_softc *sc)
|
||||
{
|
||||
struct am335x_pmic_softc *sc;
|
||||
device_t dev = (device_t)xdev;
|
||||
device_t dev;
|
||||
struct tps65217_status_reg status_reg;
|
||||
struct tps65217_chipid_reg chipid_reg;
|
||||
uint8_t reg, vo;
|
||||
@ -221,8 +219,7 @@ am335x_pmic_start(void *xdev)
|
||||
char pwr[4][11] = {"Battery", "USB", "AC", "USB and AC"};
|
||||
int rv;
|
||||
|
||||
sc = device_get_softc(dev);
|
||||
|
||||
dev = sc->sc_dev;
|
||||
am335x_pmic_read(dev, TPS65217_CHIPID_REG, (uint8_t *)&chipid_reg, 1);
|
||||
switch (chipid_reg.chip) {
|
||||
case TPS65217A:
|
||||
@ -265,8 +262,6 @@ am335x_pmic_start(void *xdev)
|
||||
EVENTHANDLER_REGISTER(shutdown_final, am335x_pmic_shutdown, dev,
|
||||
SHUTDOWN_PRI_LAST);
|
||||
|
||||
config_intrhook_disestablish(&sc->enum_hook);
|
||||
|
||||
/* Unmask all interrupts and clear pending status */
|
||||
reg = 0;
|
||||
am335x_pmic_write(dev, TPS65217_INT_REG, ®, 1);
|
||||
@ -300,11 +295,7 @@ am335x_pmic_attach(device_t dev)
|
||||
/* return (ENXIO); */
|
||||
}
|
||||
|
||||
sc->enum_hook.ich_func = am335x_pmic_start;
|
||||
sc->enum_hook.ich_arg = dev;
|
||||
|
||||
if (config_intrhook_establish(&sc->enum_hook) != 0)
|
||||
return (ENOMEM);
|
||||
am335x_pmic_start(sc);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
@ -243,7 +243,6 @@ struct tda19988_softc {
|
||||
uint32_t sc_addr;
|
||||
uint32_t sc_cec_addr;
|
||||
uint16_t sc_version;
|
||||
struct intr_config_hook enum_hook;
|
||||
int sc_current_page;
|
||||
uint8_t *sc_edid;
|
||||
uint32_t sc_edid_len;
|
||||
@ -645,15 +644,14 @@ tda19988_read_edid(struct tda19988_softc *sc)
|
||||
}
|
||||
|
||||
static void
|
||||
tda19988_start(void *xdev)
|
||||
tda19988_start(struct tda19988_softc *sc)
|
||||
{
|
||||
struct tda19988_softc *sc;
|
||||
device_t dev = (device_t)xdev;
|
||||
device_t dev;
|
||||
uint8_t data;
|
||||
uint16_t version;
|
||||
|
||||
sc = device_get_softc(dev);
|
||||
|
||||
dev = sc->sc_dev;
|
||||
|
||||
tda19988_cec_write(sc, TDA_CEC_ENAMODS, ENAMODS_RXSENS | ENAMODS_HDMI);
|
||||
DELAY(1000);
|
||||
tda19988_cec_read(sc, 0xfe, &data);
|
||||
@ -699,7 +697,7 @@ tda19988_start(void *xdev)
|
||||
break;
|
||||
default:
|
||||
device_printf(dev, "Unknown device: %04x\n", sc->sc_version);
|
||||
goto done;
|
||||
return;
|
||||
}
|
||||
|
||||
tda19988_reg_write(sc, TDA_DDC_CTRL, DDC_ENABLE);
|
||||
@ -710,16 +708,13 @@ tda19988_start(void *xdev)
|
||||
|
||||
if (tda19988_read_edid(sc) < 0) {
|
||||
device_printf(dev, "failed to read EDID\n");
|
||||
goto done;
|
||||
return;
|
||||
}
|
||||
|
||||
/* Default values for RGB 4:4:4 mapping */
|
||||
tda19988_reg_write(sc, TDA_VIP_CNTRL_0, 0x23);
|
||||
tda19988_reg_write(sc, TDA_VIP_CNTRL_1, 0x01);
|
||||
tda19988_reg_write(sc, TDA_VIP_CNTRL_2, 0x45);
|
||||
|
||||
done:
|
||||
config_intrhook_disestablish(&sc->enum_hook);
|
||||
}
|
||||
|
||||
static int
|
||||
@ -738,15 +733,11 @@ tda19988_attach(device_t dev)
|
||||
|
||||
device_set_desc(dev, "NXP TDA19988 HDMI transmitter");
|
||||
|
||||
sc->enum_hook.ich_func = tda19988_start;
|
||||
sc->enum_hook.ich_arg = dev;
|
||||
|
||||
if (config_intrhook_establish(&sc->enum_hook) != 0)
|
||||
return (ENOMEM);
|
||||
|
||||
node = ofw_bus_get_node(dev);
|
||||
OF_device_register_xref(OF_xref_from_node(node), dev);
|
||||
|
||||
tda19988_start(sc);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user