aboutsummaryrefslogtreecommitdiffstats
path: root/samsung-ipc/device/xmm6260/xmm6260_modemctl.h
diff options
context:
space:
mode:
authorPaul Kocialkowski <contact@paulk.fr>2012-07-05 17:54:25 +0200
committerPaul Kocialkowski <contact@paulk.fr>2012-07-05 19:14:37 +0200
commit84cd42f10be74c0a60545c2035876e3beca644a3 (patch)
treeb78334b1d9ba9ce2ff6d5ac65cd4b2c6b0130bd9 /samsung-ipc/device/xmm6260/xmm6260_modemctl.h
parent2eea520884474f4eefcf03815d52dfaac9e03cce (diff)
downloadexternal_libsamsung-ipc-84cd42f10be74c0a60545c2035876e3beca644a3.zip
external_libsamsung-ipc-84cd42f10be74c0a60545c2035876e3beca644a3.tar.gz
external_libsamsung-ipc-84cd42f10be74c0a60545c2035876e3beca644a3.tar.bz2
XMM6260: Split code into galaxys2, maguro and xmm2620 (shared code) devices
* Moved maguro and galaxys2 loaders to proper folders * Renamed i9100 to galaxys2 and i9250 to maguro * Device-specific ops, handlers, gprs_specs and nv_data_specs on XMM2620 devices though most data/functions are still shared in xmm2620_ipc * Removed radio_parts from modemctl_io_data * Moved CRC calculate function to xmm2620_loader * Moved io_helpers functions to xmm2620_loader * Listed include headers in each file instead of using common.h * Prefixed remaining xmm2620 files Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Diffstat (limited to 'samsung-ipc/device/xmm6260/xmm6260_modemctl.h')
-rw-r--r--samsung-ipc/device/xmm6260/xmm6260_modemctl.h123
1 files changed, 123 insertions, 0 deletions
diff --git a/samsung-ipc/device/xmm6260/xmm6260_modemctl.h b/samsung-ipc/device/xmm6260/xmm6260_modemctl.h
new file mode 100644
index 0000000..d71a13a
--- /dev/null
+++ b/samsung-ipc/device/xmm6260/xmm6260_modemctl.h
@@ -0,0 +1,123 @@
+/*
+ * XMM6260 Modem Control functions
+ * Copyright (C) 2012 Alexander Tarasikov <alexander.tarasikov@gmail.com>
+ * Copyright (C) 2012 Paul Kocialkowski <contact@paulk.fr>
+ *
+ * based on the incomplete C++ implementation which is
+ * Copyright (C) 2012 Sergey Gridasov <grindars@gmail.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __XMM6260_MODEMCTL_H__
+#define __XMM6260_MODEMCTL_H__
+
+#include <radio.h>
+
+#define MODEM_DEVICE(x) ("/dev/" #x)
+#define LINK_PM MODEM_DEVICE(link_pm)
+#define MODEM_DEV MODEM_DEVICE(modem_br)
+#define BOOT_DEV MODEM_DEVICE(umts_boot0)
+#define IPC_DEV MODEM_DEVICE(umts_ipc0)
+#define RFS_DEV MODEM_DEVICE(umts_rfs0)
+
+#define LINK_POLL_DELAY_US (50 * 1000)
+#define LINK_TIMEOUT_MS 2000
+
+struct modemctl_io_data {
+ int link_fd;
+ int boot_fd;
+
+ int radio_fd;
+ char *radio_data;
+ struct stat radio_stat;
+};
+
+/*
+ * Function prototypes
+ */
+
+/*
+ * @brief Activates the modem <-> cpu link data transfer
+ *
+ * @param client [in] ipc client
+ * @param io_data [in] modemctl-specific data
+ * @param enabled [in] whether to enable or disable link data transport
+ * @return Negative value indicating error code
+ * @return ioctl call result
+ */
+int modemctl_link_set_active(struct ipc_client *client,
+ struct modemctl_io_data *io_data, bool enabled);
+
+/*
+ * @brief Activates the modem <-> cpu link connection
+ *
+ * @param client [in] ipc client
+ * @param io_data [in] modemctl-specific data
+ * @param enabled [in] the state to set link to
+ * @return Negative value indicating error code
+ * @return ioctl call result
+ */
+int modemctl_link_set_enabled(struct ipc_client *client,
+ struct modemctl_io_data *io_data, bool enabled);
+
+/*
+ * @brief Poll the link until it gets ready or times out
+ *
+ * @param client [in] ipc client
+ * @param io_data [in] modemctl-specific data
+ * @return Negative value indicating error code
+ * @return ioctl call result
+ */
+int modemctl_wait_link_ready(struct ipc_client *client,
+ struct modemctl_io_data *io_data);
+
+/*
+ * @brief Poll the modem until it gets online or times out
+ *
+ * @param client [in] ipc client
+ * @param io_data [in] modemctl-specific data
+ * @return Negative value indicating error code
+ * @return ioctl call result
+ */
+int modemctl_wait_modem_online(struct ipc_client *client,
+ struct modemctl_io_data *io_data);
+
+/*
+ * @brief Sets the modem power
+ *
+ * @param client [in] ipc client
+ * @param io_data [in] modemctl-specific data
+ * @param enabled [in] whether to enable or disable modem power
+ * @return Negative value indicating error code
+ * @return ioctl call result
+ */
+int modemctl_modem_power(struct ipc_client *client,
+ struct modemctl_io_data *io_data, bool enabled);
+
+/*
+ * @brief Sets the modem bootloader power/UART configuration
+ *
+ * @param client [in] ipc client
+ * @param io_data [in] modemctl-specific data
+ * @param enabled [in] whether to enable or disable power
+ * @return Negative value indicating error code
+ * @return ioctl call result
+ */
+int modemctl_modem_boot_power(struct ipc_client *client,
+ struct modemctl_io_data *io_data, bool enabled);
+
+#endif
+
+// vim:ts=4:sw=4:expandtab