mirror of
https://github.com/genesi/linux-legacy.git
synced 2026-09-21 06:04:29 +00:00
poweroff: refine power off function to properly merge SB and MX differences (not many) - also correct missing IOMUX_TO_GPIO, and make sure we actually toggle the state (power off line responds to the rising edge)
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/spi/spi.h>
|
||||
#include <linux/err.h>
|
||||
@@ -514,15 +515,22 @@ int mx51_efikamx_reboot(void)
|
||||
}
|
||||
|
||||
#define EFIKAMX_POWEROFF MX51_PIN_CSI2_VSYNC
|
||||
#define EFIKAMX_USB_PHY_RESET MX51_PIN_EIM_D27
|
||||
|
||||
void mx51_efikamx_power_off(void)
|
||||
{
|
||||
/* hold USB phy to ransom */
|
||||
/* TODO: put this back into _usb.c */
|
||||
gpio_direction_output(IOMUX_TO_GPIO(EFIKAMX_USB_PHY_RESET), 0);
|
||||
|
||||
/* Set the power gate bits to power down */
|
||||
pmic_write_reg(REG_POWER_MISC, (PWGT1SPIEN|PWGT2SPIEN), (PWGT1SPIEN|PWGT2SPIEN));
|
||||
|
||||
mxc_request_iomux(EFIKAMX_POWEROFF, IOMUX_CONFIG_GPIO);
|
||||
mxc_request_iomux(IOMUX_TO_GPIO(EFIKAMX_POWEROFF), IOMUX_CONFIG_GPIO);
|
||||
gpio_request(IOMUX_TO_GPIO(EFIKAMX_POWEROFF), "sys:poweroff");
|
||||
gpio_direction_output(IOMUX_TO_GPIO(EFIKAMX_POWEROFF), 1);
|
||||
gpio_direction_output(IOMUX_TO_GPIO(EFIKAMX_POWEROFF), 0);
|
||||
msleep(10);
|
||||
gpio_set_value(IOMUX_TO_GPIO(EFIKAMX_POWEROFF), 1);
|
||||
|
||||
/* just in case */
|
||||
mxc_wd_reset();
|
||||
|
||||
Reference in New Issue
Block a user