summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzymon Dziok <b0hoon@o2.pl>2014-06-14 19:01:44 +0000
committerSzymon Dziok <b0hoon@o2.pl>2014-06-18 18:06:17 +0000
commit63632945914071b9481a29cdce7a415cfdcb7955 (patch)
treec9a3c9c53c6bb26b253ee51a7e4c62bccb6ba398
parent81db2f5eb040f286f9184e2da9094b151be3c7c0 (diff)
downloadrockbox-63632945914071b9481a29cdce7a415cfdcb7955.tar.gz
rockbox-63632945914071b9481a29cdce7a415cfdcb7955.zip
YH92x: Implement ATA power off.
Change-Id: If1f48df42ea7a150365c4ddbd3f9f7a85ae4b7dc
-rw-r--r--firmware/export/config/samsungyh920.h2
-rw-r--r--firmware/export/config/samsungyh925.h2
-rw-r--r--firmware/target/arm/samsung/power-yh82x_yh92x.c18
3 files changed, 19 insertions, 3 deletions
diff --git a/firmware/export/config/samsungyh920.h b/firmware/export/config/samsungyh920.h
index 8717cb765c..7d6d590d96 100644
--- a/firmware/export/config/samsungyh920.h
+++ b/firmware/export/config/samsungyh920.h
@@ -113,7 +113,7 @@
113#define HAVE_LBA48 113#define HAVE_LBA48
114 114
115/* We're able to shut off power to the HDD */ 115/* We're able to shut off power to the HDD */
116/* todo #define HAVE_ATA_POWER_OFF */ 116#define HAVE_ATA_POWER_OFF
117 117
118/* Software controlled LED */ 118/* Software controlled LED */
119#define CONFIG_LED LED_REAL 119#define CONFIG_LED LED_REAL
diff --git a/firmware/export/config/samsungyh925.h b/firmware/export/config/samsungyh925.h
index 098bfc851d..26311cc5fb 100644
--- a/firmware/export/config/samsungyh925.h
+++ b/firmware/export/config/samsungyh925.h
@@ -110,7 +110,7 @@
110#define HAVE_LBA48 110#define HAVE_LBA48
111 111
112/* We're able to shut off power to the HDD */ 112/* We're able to shut off power to the HDD */
113/* todo #define HAVE_ATA_POWER_OFF */ 113#define HAVE_ATA_POWER_OFF
114 114
115/* Software controlled LED */ 115/* Software controlled LED */
116#define CONFIG_LED LED_REAL 116#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 a9b64a29f4..021ddade4d 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)
52 52
53void ide_power_enable(bool on) 53void ide_power_enable(bool on)
54{ 54{
55#if defined(SAMSUNG_YH920) || defined(SAMSUNG_YH925)
56 if (on)
57 {
58 GPIO_CLEAR_BITWISE(GPIOF_OUTPUT_VAL, 0x10);
59 DEV_EN |= DEV_IDE0;
60 }
61 else
62 {
63 DEV_EN &= ~DEV_IDE0;
64 GPIO_SET_BITWISE(GPIOF_OUTPUT_VAL, 0x10);
65 }
66#else
55 (void)on; 67 (void)on;
56 /* We do nothing */ 68 /* We do nothing */
69#endif
57} 70}
58 71
59
60bool ide_powered(void) 72bool ide_powered(void)
61{ 73{
74#if defined(SAMSUNG_YH920) || defined(SAMSUNG_YH925)
75 return ((GPIOF_INPUT_VAL & 0x10) == 0);
76#else
62 /* pretend we are always powered - we don't turn it off */ 77 /* pretend we are always powered - we don't turn it off */
63 return true; 78 return true;
79#endif
64} 80}
65 81
66void power_off(void) 82void power_off(void)