Add board level implementation to get the ON-OFF button
status for imx8q/imx8m.
Test: Get ON-OFF button status on imx7ulp/imx8m/imx8q.
Change-Id: I8e4ea61ec1c52ab7cfa20b5498756a25f3cd2f8d
Signed-off-by: Ji Luo <ji.luo@nxp.com>
(cherry picked from commit
44c6edfbd2607f1458220031467fc7de20dc46be)
#define SNVS_LPCR_DPEN (0x20)
#define SNVS_LPCR_SRTC_ENV (0x1)
+#define SNVS_BASE_REVB (0x41070000)
+#define SNVS_HPSR_REVB (SNVS_BASE_REVB + 0x14)
#define SRC_BASE_ADDR CMC1_RBASE
#define IRAM_BASE_ADDR OCRAM_0_BASE
#endif
return 0;
}
+
+#ifdef CONFIG_ANDROID_SUPPORT
+bool is_power_key_pressed(void) {
+ return (bool)(!!(readl(SNVS_HPSR) & (0x1 << 6)));
+}
+#endif
#endif
return 0;
}
+
+#ifdef CONFIG_ANDROID_SUPPORT
+bool is_power_key_pressed(void) {
+ return (bool)(!!(readl(SNVS_HPSR) & (0x1 << 6)));
+}
+#endif
}
#endif
+#ifdef CONFIG_ANDROID_SUPPORT
+bool is_power_key_pressed(void) {
+ return (bool)(!!(readl(SNVS_HPSR) & (0x1 << 6)));
+}
+#endif
+
#ifdef CONFIG_SPL_MMC_SUPPORT
#define UBOOT_RAW_SECTOR_OFFSET 0x40
unsigned long spl_mmc_get_uboot_raw_sector(struct mmc *mmc)
return 0;
}
+
+#ifdef CONFIG_ANDROID_SUPPORT
+bool is_power_key_pressed(void) {
+ return (bool)(!!(readl(SNVS_HPSR) & (0x1 << 6)));
+}
+#endif
return 0;
}
+
+#ifdef CONFIG_ANDROID_SUPPORT
+bool is_power_key_pressed(void) {
+ sc_bool_t status = SC_FALSE;
+
+ sc_misc_get_button_status(-1, &status);
+ return (bool)status;
+}
+#endif
return 0;
}
+
+#ifdef CONFIG_ANDROID_SUPPORT
+bool is_power_key_pressed(void) {
+ sc_bool_t status = SC_FALSE;
+
+ sc_misc_get_button_status(-1, &status);
+ return (bool)status;
+}
+#endif
return 0;
}
+
+#ifdef CONFIG_ANDROID_SUPPORT
+bool is_power_key_pressed(void) {
+ /* the onoff button is 'pressed' by default on evk board */
+ return (bool)(!(readl(SNVS_HPSR_REVB) & (0x1 << 6)));
+}
+#endif