diff options
| author | Szymon Dziok <b0hoon@o2.pl> | 2014-06-14 19:01:44 +0000 |
|---|---|---|
| committer | Szymon Dziok <b0hoon@o2.pl> | 2014-06-18 18:06:17 +0000 |
| commit | 63632945914071b9481a29cdce7a415cfdcb7955 (patch) | |
| tree | c9a3c9c53c6bb26b253ee51a7e4c62bccb6ba398 | |
| parent | 81db2f5eb040f286f9184e2da9094b151be3c7c0 (diff) | |
| download | rockbox-63632945914071b9481a29cdce7a415cfdcb7955.zip rockbox-63632945914071b9481a29cdce7a415cfdcb7955.tar.gz rockbox-63632945914071b9481a29cdce7a415cfdcb7955.tar.bz2 rockbox-63632945914071b9481a29cdce7a415cfdcb7955.tar.xz | |
YH92x: Implement ATA power off.
Change-Id: If1f48df42ea7a150365c4ddbd3f9f7a85ae4b7dc
| -rw-r--r-- | firmware/export/config/samsungyh920.h | 2 | ||||
| -rw-r--r-- | firmware/export/config/samsungyh925.h | 2 | ||||
| -rw-r--r-- | firmware/target/arm/samsung/power-yh82x_yh92x.c | 18 |
3 files changed, 19 insertions, 3 deletions
diff --git a/firmware/export/config/samsungyh920.h b/firmware/export/config/samsungyh920.h index 8717cb7..7d6d590 100644 --- a/firmware/export/config/samsungyh920.h +++ b/firmware/export/config/samsungyh920.h @@ -113,7 +113,7 @@ #define HAVE_LBA48 /* We're able to shut off power to the HDD */ -/* todo #define HAVE_ATA_POWER_OFF */ +#define HAVE_ATA_POWER_OFF /* Software controlled LED */ #define CONFIG_LED LED_REAL diff --git a/firmware/export/config/samsungyh925.h b/firmware/export/config/samsungyh925.h index 098bfc8..26311cc 100644 --- a/firmware/export/config/samsungyh925.h +++ b/firmware/export/config/samsungyh925.h @@ -110,7 +110,7 @@ #define HAVE_LBA48 /* We're able to shut off power to the HDD */ -/* todo #define HAVE_ATA_POWER_OFF */ +#define HAVE_ATA_POWER_OFF /* Software controlled LED */ #define CONFIG_LED LED_REAL diff --git a/firmware/target/arm/samsung/power-yh82x_yh92x.c b/firmware/target/arm/samsung/power-yh82x_yh92x.c index a9b64a2..021ddad 100644 --- a/firmware/target/arm/samsung/power-yh82x_yh92x.c +++ b/firmware/target/arm/samsung/power-yh82x_yh92x.c @@ -52,15 +52,31 @@ unsigned int power_input_status(void) void ide_power_enable(bool on) { +#if defined(SAMSUNG_YH920) || defined(SAMSUNG_YH925) + if (on) + { + GPIO_CLEAR_BITWISE(GPIOF_OUTPUT_VAL, 0x10); + DEV_EN |= DEV_IDE0; + } + else + { + DEV_EN &= ~DEV_IDE0; + GPIO_SET_BITWISE(GPIOF_OUTPUT_VAL, 0x10); + } +#else (void)on; /* We do nothing */ +#endif } - bool ide_powered(void) { +#if defined(SAMSUNG_YH920) || defined(SAMSUNG_YH925) + return ((GPIOF_INPUT_VAL & 0x10) == 0); +#else /* pretend we are always powered - we don't turn it off */ return true; +#endif } void power_off(void) |