aboutsummaryrefslogtreecommitdiffstats
path: root/samsung-ipc
diff options
context:
space:
mode:
authorAlexander Tarasikov <alexander.tarasikov@gmail.com>2012-07-26 14:07:54 +0400
committerAlexander Tarasikov <alexander.tarasikov@gmail.com>2012-07-26 14:07:54 +0400
commit4bd59903ac2a4697241730d1d30476f2be088414 (patch)
tree502c9de9a7af565ce74674f7c3d929bb68d80464 /samsung-ipc
parent62c5b2423eb3da2b13350583c66bd031b297196d (diff)
downloadexternal_libsamsung-ipc-4bd59903ac2a4697241730d1d30476f2be088414.zip
external_libsamsung-ipc-4bd59903ac2a4697241730d1d30476f2be088414.tar.gz
external_libsamsung-ipc-4bd59903ac2a4697241730d1d30476f2be088414.tar.bz2
Implement maguro poweroff
Diffstat (limited to 'samsung-ipc')
-rw-r--r--samsung-ipc/device/maguro/maguro_ipc.c2
-rw-r--r--samsung-ipc/device/maguro/maguro_loader.c22
-rw-r--r--samsung-ipc/device/maguro/maguro_loader.h1
3 files changed, 24 insertions, 1 deletions
diff --git a/samsung-ipc/device/maguro/maguro_ipc.c b/samsung-ipc/device/maguro/maguro_ipc.c
index fb4121d..19b5ba4 100644
--- a/samsung-ipc/device/maguro/maguro_ipc.c
+++ b/samsung-ipc/device/maguro/maguro_ipc.c
@@ -48,7 +48,7 @@ struct ipc_handlers maguro_default_handlers = {
.open = xmm6260_ipc_open,
.close = xmm6260_ipc_close,
.power_on = xmm6260_ipc_power_on,
- .power_off = xmm6260_ipc_power_off,
+ .power_off = maguro_power_off,
.common_data = NULL,
.common_data_create = xmm6260_ipc_common_data_create,
.common_data_destroy = xmm6260_ipc_common_data_destroy,
diff --git a/samsung-ipc/device/maguro/maguro_loader.c b/samsung-ipc/device/maguro/maguro_loader.c
index 4d15e04..062d4c5 100644
--- a/samsung-ipc/device/maguro/maguro_loader.c
+++ b/samsung-ipc/device/maguro/maguro_loader.c
@@ -620,6 +620,28 @@ fail:
return ret;
}
+int maguro_power_off(void *io_data_unused) {
+ int ret = -1;
+ struct modemctl_io_data io_data;
+
+ io_data.boot_fd = open(BOOT_DEV, O_RDWR | O_NOCTTY | O_NONBLOCK);
+ if (io_data.boot_fd < 0) {
+ ret = io_data.boot_fd;
+ goto fail;
+ }
+
+ if ((ret = modemctl_modem_power(NULL, &io_data, false)) < 0) {
+ goto fail_pwr;
+ }
+
+ ret = 0;
+
+fail_pwr:
+ close(io_data.boot_fd);
+fail:
+ return ret;
+}
+
int maguro_modem_bootstrap(struct ipc_client *client)
{
int ret = -1;
diff --git a/samsung-ipc/device/maguro/maguro_loader.h b/samsung-ipc/device/maguro/maguro_loader.h
index 7a47635..cb059fc 100644
--- a/samsung-ipc/device/maguro/maguro_loader.h
+++ b/samsung-ipc/device/maguro/maguro_loader.h
@@ -98,6 +98,7 @@ struct maguro_boot_tail_header name = {\
}
int maguro_modem_bootstrap(struct ipc_client *client);
+int maguro_power_off(void *io_data);
#endif