28c28
< __FBSDID("$FreeBSD: head/sys/arm/ti/am335x/am335x_pmic.c 253025 2013-07-08 05:06:32Z gonzo $");
---
> __FBSDID("$FreeBSD: head/sys/arm/ti/am335x/am335x_pmic.c 277042 2015-01-12 03:23:16Z loos $");
33a34
> #include <sys/eventhandler.h>
38a40
> #include <sys/reboot.h>
48a51,52
> #include <arm/ti/am335x/am335x_rtcvar.h>
>
58a63,66
> #define TPS65217_STATUS_OFF (1U << 7)
> #define TPS65217_STATUS_ACPWR (1U << 3)
> #define TPS65217_STATUS_USBPWR (1U << 2)
> #define TPS65217_STATUS_BT (1U << 0)
68a77,78
> static void am335x_pmic_shutdown(void *, int);
>
80d89
< #ifdef notyet
98d106
< #endif
148a157,159
> EVENTHANDLER_REGISTER(shutdown_final, am335x_pmic_shutdown, dev,
> SHUTDOWN_PRI_LAST);
>
167a179,194
> static void
> am335x_pmic_shutdown(void *xdev, int howto)
> {
> device_t dev;
> uint8_t reg;
>
> if (!(howto & RB_POWEROFF))
> return;
> dev = (device_t)xdev;
> /* Set the OFF bit on status register to start the shutdown sequence. */
> reg = TPS65217_STATUS_OFF;
> am335x_pmic_write(dev, TPS65217_STATUS_REG, ®, 1);
> /* Toggle pmic_pwr_enable to shutdown the PMIC. */
> am335x_rtc_pmic_pwr_toggle();
> }
>
< __FBSDID("$FreeBSD: head/sys/arm/ti/am335x/am335x_pmic.c 253025 2013-07-08 05:06:32Z gonzo $");
---
> __FBSDID("$FreeBSD: head/sys/arm/ti/am335x/am335x_pmic.c 277042 2015-01-12 03:23:16Z loos $");
33a34
> #include <sys/eventhandler.h>
38a40
> #include <sys/reboot.h>
48a51,52
> #include <arm/ti/am335x/am335x_rtcvar.h>
>
58a63,66
> #define TPS65217_STATUS_OFF (1U << 7)
> #define TPS65217_STATUS_ACPWR (1U << 3)
> #define TPS65217_STATUS_USBPWR (1U << 2)
> #define TPS65217_STATUS_BT (1U << 0)
68a77,78
> static void am335x_pmic_shutdown(void *, int);
>
80d89
< #ifdef notyet
98d106
< #endif
148a157,159
> EVENTHANDLER_REGISTER(shutdown_final, am335x_pmic_shutdown, dev,
> SHUTDOWN_PRI_LAST);
>
167a179,194
> static void
> am335x_pmic_shutdown(void *xdev, int howto)
> {
> device_t dev;
> uint8_t reg;
>
> if (!(howto & RB_POWEROFF))
> return;
> dev = (device_t)xdev;
> /* Set the OFF bit on status register to start the shutdown sequence. */
> reg = TPS65217_STATUS_OFF;
> am335x_pmic_write(dev, TPS65217_STATUS_REG, ®, 1);
> /* Toggle pmic_pwr_enable to shutdown the PMIC. */
> am335x_rtc_pmic_pwr_toggle();
> }
>