FreeBSD Bugzilla – Attachment 212824 Details for
Bug 245159
[PATCH] am335x pmic option ti,pmic-shutdown-controller
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Honor ti,pmic-shutdown-controller option in DTS
patch-sys_arm_ti_am335x_am335x__pmic.c (text/plain), 1.50 KB, created by
Oskar Holmlund
on 2020-03-29 10:19:23 UTC
(
hide
)
Description:
Honor ti,pmic-shutdown-controller option in DTS
Filename:
MIME Type:
Creator:
Oskar Holmlund
Created:
2020-03-29 10:19:23 UTC
Size:
1.50 KB
patch
obsolete
>--- sys/arm/ti/am335x/am335x_pmic.c.orig 2020-03-29 11:43:45.721157000 +0200 >+++ sys/arm/ti/am335x/am335x_pmic.c 2020-03-29 13:30:09.696336000 +0200 >@@ -208,6 +208,7 @@ > char name[20]; > char pwr[4][11] = {"Battery", "USB", "AC", "USB and AC"}; > int rv; >+ phandle_t node; > > dev = sc->sc_dev; > am335x_pmic_read(dev, TPS65217_CHIPID_REG, (uint8_t *)&chipid_reg, 1); >@@ -232,6 +233,16 @@ > device_printf(dev, "%s powered by %s\n", name, > pwr[status_reg.usbpwr | (status_reg.acpwr << 1)]); > >+ /* Check devicetree for ti,pmic-shutdown-controller >+ * if present; PMIC will go to shutdown state on PWR_EN toggle >+ * if not present; PMIC will enter sleep state on PWR_EN toggle (default on reset) >+ */ >+ node = ofw_bus_get_node(dev); >+ if (OF_hasprop(node, "ti,pmic-shutdown-controller")) { >+ status_reg.off = 1; >+ am335x_pmic_write(dev, TPS65217_STATUS_REG, (uint8_t *)&status_reg, 1); >+ } >+ > if (am335x_pmic_vo[0] != '\0') { > for (vo = 0; vo < 4; vo++) { > if (strcmp(tps65217_voreg_c[vo], am335x_pmic_vo) == 0) >@@ -291,16 +302,9 @@ > static void > am335x_pmic_shutdown(void *xdev, int howto) > { >- device_t dev; >- struct tps65217_status_reg reg; >- > if (!(howto & RB_POWEROFF)) > return; >- dev = (device_t)xdev; >- am335x_pmic_read(dev, TPS65217_STATUS_REG, (uint8_t *)®, 1); >- /* Set the OFF bit on status register to start the shutdown sequence. */ >- reg.off = 1; >- am335x_pmic_write(dev, TPS65217_STATUS_REG, (uint8_t *)®, 1); >+ > /* Toggle pmic_pwr_enable to shutdown the PMIC. */ > am335x_rtc_pmic_pwr_toggle(); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 245159
: 212824