diff options
Diffstat (limited to 'syna_tcm2_platform_spi.c')
-rw-r--r-- | syna_tcm2_platform_spi.c | 31 |
1 files changed, 31 insertions, 0 deletions
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) { |