^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) // SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Copyright (c) 2019, Fuzhou Rockchip Electronics Co., Ltd.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Rockchip rm310 driver for 4g modem
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #include <linux/module.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #include <linux/kernel.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #include <linux/kthread.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #include <linux/i2c.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #include <linux/irq.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #include <linux/gpio.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #include <linux/input.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #include <linux/platform_device.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #include <linux/fs.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #include <linux/uaccess.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #include <linux/miscdevice.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #include <linux/circ_buf.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) #include <linux/miscdevice.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #include <linux/gpio.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) #include <dt-bindings/gpio/gpio.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) #include <linux/delay.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #include <linux/poll.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) #include <linux/wait.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) #include <linux/wakelock.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) #include <linux/workqueue.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) #include <linux/lte.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) #include <linux/slab.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) #include <linux/of.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) #include <linux/of_device.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) #include <linux/of_gpio.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) #define LOG(x...) pr_info("[4g_modem]: " x)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) static struct lte_data *gpdata;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) static struct class *modem_class;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) static int modem_status = 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) static int modem_poweron_off(int on_off)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) struct lte_data *pdata = gpdata;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) if (pdata) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) if (on_off) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) LOG("%s: 4g modem power up.\n", __func__);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) if (pdata->vbat_gpio) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) gpiod_direction_output(pdata->vbat_gpio, 1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) msleep(2000);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) if (pdata->power_gpio) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) gpiod_direction_output(pdata->power_gpio, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) msleep(50);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) gpiod_direction_output(pdata->power_gpio, 1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) msleep(400);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) gpiod_direction_output(pdata->power_gpio, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) } else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) LOG("%s: 4g modem power down.\n", __func__);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) if (pdata->power_gpio) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) gpiod_direction_output(pdata->power_gpio, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) msleep(100);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) gpiod_direction_output(pdata->power_gpio, 1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) msleep(1000);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) gpiod_direction_output(pdata->power_gpio, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) msleep(400);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) if (pdata->vbat_gpio)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) gpiod_direction_output(pdata->vbat_gpio, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) static ssize_t modem_status_store(struct class *cls,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) struct class_attribute *attr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) const char *buf, size_t count)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) int new_state, ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) ret = kstrtoint(buf, 10, &new_state);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) if (ret) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) LOG("%s: kstrtoint error return %d\n", __func__, ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) if (new_state == modem_status)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) return count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) if (new_state == 1) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) LOG("%s, c(%d), open modem.\n", __func__, new_state);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) modem_poweron_off(1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) } else if (new_state == 0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) LOG("%s, c(%d), close modem.\n", __func__, new_state);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) modem_poweron_off(0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) } else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) LOG("%s, invalid parameter.\n", __func__);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) modem_status = new_state;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) return count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) static ssize_t modem_status_show(struct class *cls,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) struct class_attribute *attr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) char *buf)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) return sprintf(buf, "%d\n", modem_status);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) static CLASS_ATTR_RW(modem_status);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) static int modem_platdata_parse_dt(struct device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) struct lte_data *data)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) struct device_node *node = dev->of_node;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) if (!node)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) return -ENODEV;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) memset(data, 0, sizeof(*data));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) LOG("%s: LTE modem power controlled by gpio.\n", __func__);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) data->vbat_gpio = devm_gpiod_get_optional(dev, "4G,vbat",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) GPIOD_OUT_HIGH);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) if (IS_ERR(data->vbat_gpio)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) ret = PTR_ERR(data->vbat_gpio);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) dev_err(dev, "failed to request 4G,vbat GPIO: %d\n", ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) data->power_gpio = devm_gpiod_get_optional(dev, "4G,power",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) GPIOD_OUT_HIGH);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) if (IS_ERR(data->power_gpio)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) ret = PTR_ERR(data->power_gpio);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) dev_err(dev, "failed to request 4G,power GPIO: %d\n", ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) data->reset_gpio = devm_gpiod_get_optional(dev, "4G,reset",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) GPIOD_OUT_LOW);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) if (IS_ERR(data->reset_gpio)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) ret = PTR_ERR(data->reset_gpio);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) dev_err(dev, "failed to request 4G,reset GPIO: %d\n", ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) static int modem_power_on_thread(void *data)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) modem_poweron_off(1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) static int lte_probe(struct platform_device *pdev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) struct lte_data *pdata;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) struct task_struct *kthread;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) int ret = -1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) if (!pdata)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) return -ENOMEM;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) ret = modem_platdata_parse_dt(&pdev->dev, pdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) if (ret < 0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) LOG("%s: No lte platform data specified\n", __func__);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) goto err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) gpdata = pdata;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) pdata->dev = &pdev->dev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) if (pdata->reset_gpio)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) gpiod_direction_output(pdata->reset_gpio, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) kthread = kthread_run(modem_power_on_thread, NULL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) "modem_power_on_thread");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) if (IS_ERR(kthread)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) LOG("%s: create modem_power_on_thread failed.\n", __func__);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) ret = PTR_ERR(kthread);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) goto err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) err:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) gpdata = NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) static int lte_suspend(struct platform_device *pdev, pm_message_t state)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) static int lte_resume(struct platform_device *pdev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) static int lte_remove(struct platform_device *pdev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) struct lte_data *pdata = gpdata;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) if (pdata->power_gpio) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) msleep(100);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) gpiod_direction_output(pdata->power_gpio, 1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) msleep(750);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) gpiod_direction_output(pdata->power_gpio, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) if (pdata->vbat_gpio)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) gpiod_direction_output(pdata->vbat_gpio, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) gpdata = NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) static const struct of_device_id modem_platdata_of_match[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) { .compatible = "4g-modem-platdata" },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) { }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) MODULE_DEVICE_TABLE(of, modem_platdata_of_match);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) static struct platform_driver rm310_driver = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) .probe = lte_probe,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) .remove = lte_remove,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) .suspend = lte_suspend,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) .resume = lte_resume,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) .driver = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) .name = "4g-modem-platdata",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) .of_match_table = of_match_ptr(modem_platdata_of_match),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) static int __init rm310_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) modem_class = class_create(THIS_MODULE, "rk_modem");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) ret = class_create_file(modem_class, &class_attr_modem_status);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) if (ret)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) LOG("Fail to create class modem_status.\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) return platform_driver_register(&rm310_driver);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) static void __exit rm310_exit(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) platform_driver_unregister(&rm310_driver);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) late_initcall(rm310_init);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) module_exit(rm310_exit);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) MODULE_AUTHOR("xuxuehui <xxh@rock-chips.com>");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) MODULE_AUTHOR("Alex Zhao <zzc@rock-chips.com>");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) MODULE_DESCRIPTION("RM310 lte modem driver");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) MODULE_LICENSE("GPL");