From f5f5466f80047e90757a6cb74abd6a4d9d0e321d Mon Sep 17 00:00:00 2001 From: SuperKali Date: Thu, 26 Sep 2024 15:01:07 +0200 Subject: [PATCH] WIP: adding some fixes in the drivers (#248) * input: touchscreen: focaltech touch: Removing invalid function calls * Implement missing things on drivers * drm: panel: radxa 8hd display: Fix some wrong definitions * Rename reference for enable both modules --- drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c | 8 +++----- drivers/gpu/drm/panel/panel-radxa-display-8hd.c | 5 ++--- drivers/iio/magnetometer/Makefile | 2 +- drivers/iio/magnetometer/{ak8975.c => ak8975_magn.c} | 2 +- drivers/input/sensors/compass/Makefile | 2 +- drivers/input/sensors/compass/{ak8975.c => ak8975_comp.c} | 6 +++--- .../input/touchscreen/focaltech_touch/focaltech_flash.c | 4 ---- .../focaltech_touch/focaltech_test/focaltech_test.c | 4 ---- 8 files changed, 11 insertions(+), 22 deletions(-) rename drivers/iio/magnetometer/{ak8975.c => ak8975_magn.c} (99%) rename drivers/input/sensors/compass/{ak8975.c => ak8975_comp.c} (99%) diff --git a/drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c b/drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c index 6d9cd18af8e8..b3bab4884b0d 100644 --- a/drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c +++ b/drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c @@ -616,7 +616,7 @@ static int jadard_dsi_probe(struct mipi_dsi_device *dsi) desc = of_device_get_match_data(dev); dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | - MIPI_DSI_MODE_EOT_PACKET; + MIPI_DSI_MODE_NO_EOT_PACKET; dsi->format = desc->format; dsi->lanes = desc->lanes; @@ -658,14 +658,12 @@ static int jadard_dsi_probe(struct mipi_dsi_device *dsi) return ret; } -static int jadard_dsi_remove(struct mipi_dsi_device *dsi) +static void jadard_dsi_remove(struct mipi_dsi_device *dsi) { struct jadard *jadard = mipi_dsi_get_drvdata(dsi); mipi_dsi_detach(dsi); drm_panel_remove(&jadard->panel); - - return 0; } static const struct of_device_id jadard_of_match[] = { @@ -688,4 +686,4 @@ module_mipi_dsi_driver(jadard_driver); MODULE_AUTHOR("Jagan Teki "); MODULE_AUTHOR("Stephen Chen "); MODULE_DESCRIPTION("Jadard JD9365DA-H3 WXGA DSI panel"); -MODULE_LICENSE("GPL"); +MODULE_LICENSE("GPL"); \ No newline at end of file diff --git a/drivers/gpu/drm/panel/panel-radxa-display-8hd.c b/drivers/gpu/drm/panel/panel-radxa-display-8hd.c index ef3b8fb6d463..fe5e889b7192 100644 --- a/drivers/gpu/drm/panel/panel-radxa-display-8hd.c +++ b/drivers/gpu/drm/panel/panel-radxa-display-8hd.c @@ -368,7 +368,7 @@ static int radxa_display_8hd_probe(struct mipi_dsi_device *dsi) desc = of_device_get_match_data(dev); dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | - MIPI_DSI_MODE_EOT_PACKET; + MIPI_DSI_MODE_NO_EOT_PACKET; dsi->format = desc->format; dsi->lanes = desc->lanes; @@ -410,14 +410,13 @@ static int radxa_display_8hd_probe(struct mipi_dsi_device *dsi) return ret; } -static int radxa_display_8hd_remove(struct mipi_dsi_device *dsi) +static void radxa_display_8hd_remove(struct mipi_dsi_device *dsi) { struct jadard_jd9365da *jadard_jd9365da = mipi_dsi_get_drvdata(dsi); mipi_dsi_detach(dsi); drm_panel_remove(&jadard_jd9365da->panel); - return 0; } static const struct of_device_id radxa_display_8hd_of_match[] = { diff --git a/drivers/iio/magnetometer/Makefile b/drivers/iio/magnetometer/Makefile index b9f45b7fafc3..df759d3eedce 100644 --- a/drivers/iio/magnetometer/Makefile +++ b/drivers/iio/magnetometer/Makefile @@ -5,7 +5,7 @@ # When adding new entries keep the list in alphabetical order obj-$(CONFIG_AK8974) += ak8974.o -obj-$(CONFIG_AK8975) += ak8975.o +obj-$(CONFIG_AK8975) += ak8975_magn.o obj-$(CONFIG_BMC150_MAGN) += bmc150_magn.o obj-$(CONFIG_BMC150_MAGN_I2C) += bmc150_magn_i2c.o obj-$(CONFIG_BMC150_MAGN_SPI) += bmc150_magn_spi.o diff --git a/drivers/iio/magnetometer/ak8975.c b/drivers/iio/magnetometer/ak8975_magn.c similarity index 99% rename from drivers/iio/magnetometer/ak8975.c rename to drivers/iio/magnetometer/ak8975_magn.c index 13929b77f8c8..6f7a6e76657d 100644 --- a/drivers/iio/magnetometer/ak8975.c +++ b/drivers/iio/magnetometer/ak8975_magn.c @@ -1088,7 +1088,7 @@ MODULE_DEVICE_TABLE(of, ak8975_of_match); static struct i2c_driver ak8975_driver = { .driver = { - .name = "ak8975", + .name = "ak8975_magn", .pm = pm_ptr(&ak8975_dev_pm_ops), .of_match_table = ak8975_of_match, .acpi_match_table = ak_acpi_match, diff --git a/drivers/input/sensors/compass/Makefile b/drivers/input/sensors/compass/Makefile index f42c2aa2dd17..9789c1b01e29 100644 --- a/drivers/input/sensors/compass/Makefile +++ b/drivers/input/sensors/compass/Makefile @@ -2,7 +2,7 @@ # # Makefile for industrial I/O Magnetometer sensors # -obj-$(CONFIG_COMPASS_AK8975) += ak8975.o +obj-$(CONFIG_COMPASS_AK8975) += ak8975_comp.o obj-$(CONFIG_COMPASS_AK8963) += ak8963.o obj-$(CONFIG_COMPASS_AK09911) += ak09911.o obj-$(CONFIG_COMPASS_AK09918) += ak09918.o diff --git a/drivers/input/sensors/compass/ak8975.c b/drivers/input/sensors/compass/ak8975_comp.c similarity index 99% rename from drivers/input/sensors/compass/ak8975.c rename to drivers/input/sensors/compass/ak8975_comp.c index 3202f35123ce..666addd24732 100644 --- a/drivers/input/sensors/compass/ak8975.c +++ b/drivers/input/sensors/compass/ak8975_comp.c @@ -244,7 +244,7 @@ static int sensor_report_value(struct i2c_client *client) return -3; } - /* »¥³âµØ»º´æÊý¾Ý. */ + /* ����ػ�������. */ mutex_lock(&sensor->data_mutex); memcpy(sensor->sensor_data, buffer, sensor->ops->read_len); mutex_unlock(&sensor->data_mutex); @@ -593,7 +593,7 @@ static struct miscdevice compass_dev_device = }; static struct sensor_operate compass_akm8975_ops = { - .name = "akm8975", + .name = "akm8975_comp", .type = SENSOR_TYPE_COMPASS, //it is important .id_i2c = COMPASS_ID_AK8975, .read_reg = AK8975_REG_ST1, //read data @@ -624,7 +624,7 @@ static void compass_akm8975_remove(struct i2c_client *client) } static const struct i2c_device_id compass_akm8975_id[] = { - {"ak8975", COMPASS_ID_AK8975}, + {"ak8975_comp", COMPASS_ID_AK8975}, {} }; diff --git a/drivers/input/touchscreen/focaltech_touch/focaltech_flash.c b/drivers/input/touchscreen/focaltech_touch/focaltech_flash.c index 1ea7fecc0592..7e60b1b64b87 100644 --- a/drivers/input/touchscreen/focaltech_touch/focaltech_flash.c +++ b/drivers/input/touchscreen/focaltech_touch/focaltech_flash.c @@ -1073,7 +1073,6 @@ static int fts_read_file(char *file_name, u8 **file_buf) char file_path[FILE_NAME_LENGTH] = { 0 }; struct file *filp = NULL; struct inode *inode; - mm_segment_t old_fs; loff_t pos; loff_t file_len = 0; @@ -1103,15 +1102,12 @@ static int fts_read_file(char *file_name, u8 **file_buf) filp_close(filp, NULL); return -ENOMEM; } - old_fs = get_fs(); - set_fs(KERNEL_DS); pos = 0; ret = vfs_read(filp, *file_buf, file_len , &pos); if (ret < 0) FTS_ERROR("read file fail"); FTS_INFO("file len:%d read len:%d pos:%d", (u32)file_len, ret, (u32)pos); filp_close(filp, NULL); - set_fs(old_fs); return ret; } diff --git a/drivers/input/touchscreen/focaltech_touch/focaltech_test/focaltech_test.c b/drivers/input/touchscreen/focaltech_touch/focaltech_test/focaltech_test.c index 991bbba87c70..94752916458a 100644 --- a/drivers/input/touchscreen/focaltech_touch/focaltech_test/focaltech_test.c +++ b/drivers/input/touchscreen/focaltech_touch/focaltech_test/focaltech_test.c @@ -1181,7 +1181,6 @@ static int fts_test_save_test_data(char *file_name, char *data_buf, int len) struct file *pfile = NULL; char filepath[128]; loff_t pos; - mm_segment_t old_fs; FTS_TEST_FUNC_ENTER(); memset(filepath, 0, sizeof(filepath)); @@ -1194,12 +1193,9 @@ static int fts_test_save_test_data(char *file_name, char *data_buf, int len) return -EIO; } - old_fs = get_fs(); - set_fs(KERNEL_DS); pos = 0; vfs_write(pfile, data_buf, len, &pos); filp_close(pfile, NULL); - set_fs(old_fs); FTS_TEST_FUNC_EXIT(); return 0;