diff options
-rw-r--r-- | syna_tcm2.c | 15 | ||||
-rw-r--r-- | syna_tcm2.h | 11 | ||||
-rw-r--r-- | syna_tcm2_platform.h | 1 | ||||
-rw-r--r-- | syna_tcm2_platform_spi.c | 31 |
4 files changed, 45 insertions, 13 deletions
diff --git a/syna_tcm2.c b/syna_tcm2.c index 96f4606..cbbc153 100644 --- a/syna_tcm2.c +++ b/syna_tcm2.c @@ -77,17 +77,6 @@ static unsigned char custom_touch_format[] = { #endif /** - * @section: STARTUP_REFLASH_DELAY_TIME_MS - * The delayed time to start fw update during the startup time. - * This configuration depends on STARTUP_REFLASH. - */ -#ifdef STARTUP_REFLASH -#define STARTUP_REFLASH_DELAY_TIME_MS (200) - -#define FW_IMAGE_NAME "synaptics.img" -#endif - -/** * @section: RESET_ON_RESUME_DELAY_MS * The delayed time to issue a reset on resume state. * This configuration depends on RESET_ON_RESUME. @@ -876,10 +865,10 @@ static void syna_dev_reflash_startup_work(struct work_struct *work) /* get firmware image */ retval = request_firmware(&fw_entry, - FW_IMAGE_NAME, + tcm->hw_if->fw_name, tcm->pdev->dev.parent); if (retval < 0) { - LOGE("Fail to request %s\n", FW_IMAGE_NAME); + LOGE("Fail to request %s\n", tcm->hw_if->fw_name); return; } diff --git a/syna_tcm2.h b/syna_tcm2.h index 39def51..22bdf42 100644 --- a/syna_tcm2.h +++ b/syna_tcm2.h @@ -159,6 +159,17 @@ #endif /** + * @section: STARTUP_REFLASH_DELAY_TIME_MS + * The delayed time to start fw update during the startup time. + * This configuration depends on STARTUP_REFLASH. + */ +#ifdef STARTUP_REFLASH +#define STARTUP_REFLASH_DELAY_TIME_MS (200) + +#define FW_IMAGE_NAME "synaptics.img" +#endif + +/** * @brief ENABLE_DISP_NOTIFIER * Open if having display notification event and willing to listen * the event from display driver. diff --git a/syna_tcm2_platform.h b/syna_tcm2_platform.h index 23d2661..d6d5a68 100644 --- a/syna_tcm2_platform.h +++ b/syna_tcm2_platform.h @@ -145,6 +145,7 @@ struct syna_hw_interface { struct syna_hw_attn_data bdata_attn; struct syna_hw_rst_data bdata_rst; struct syna_hw_pwr_data bdata_pwr; + const char *fw_name; /* Operation to do power on/off, if supported * diff --git a/syna_tcm2_platform_spi.c b/syna_tcm2_platform_spi.c index ba1e23b..547b798 100644 --- a/syna_tcm2_platform_spi.c +++ b/syna_tcm2_platform_spi.c @@ -37,6 +37,7 @@ */ #include <linux/spi/spi.h> +#include <drm/drm_panel.h> #include "syna_tcm2.h" #include "syna_tcm2_platform.h" @@ -443,6 +444,7 @@ static int syna_spi_parse_dt(struct syna_hw_interface *hw_if, struct device *dev) { int retval; + int index; u32 value; struct property *prop; struct device_node *np = dev->of_node; @@ -451,6 +453,35 @@ static int syna_spi_parse_dt(struct syna_hw_interface *hw_if, struct syna_hw_pwr_data *pwr = &hw_if->bdata_pwr; struct syna_hw_rst_data *rst = &hw_if->bdata_rst; struct syna_hw_bus_data *bus = &hw_if->bdata_io; + struct of_phandle_args panelmap; + struct drm_panel *panel = NULL; + + if (of_property_read_bool(np, "synaptics,panel_map")) { + for (index = 0 ;; index++) { + retval = of_parse_phandle_with_fixed_args(np, + "synaptics,panel_map", + 0, + index, + &panelmap); + if (retval) + return -EPROBE_DEFER; + panel = of_drm_find_panel(panelmap.np); + of_node_put(panelmap.np); + if (!IS_ERR_OR_NULL(panel)) { + retval = of_property_read_string_index(np, + "synaptics,firmware_names", + index, &name); + if (retval < 0) + hw_if->fw_name = FW_IMAGE_NAME; + else + hw_if->fw_name = name; + LOGI("Firmware name %s", hw_if->fw_name); + break; + } + } + } else { + hw_if->fw_name = FW_IMAGE_NAME; + } prop = of_find_property(np, "synaptics,irq-gpio", NULL); if (prop && prop->length) { |