Firmware loading option
Subsystems (5)
cover Firmware loading option
Add option to prevent firmware/configuration loading during each boot.
Andrej Valek (3):
Input: goodix - add option to disable firmware loading
dt-bindings: goodix
Input: atmel_mxt_ts - add option to disable firmware loading
.../bindings/input/touchscreen/goodix.yaml | 1 + drivers/input/touchscreen/atmel_mxt_ts.c | 17 ++++++++++++++--- drivers/input/touchscreen/goodix.c | 4 +++- 3 files changed, 18 insertions(+), 4 deletions(-)
Signature · 1 line
2.20.1
PATCH 1/3 Input: goodix - add option to disable firmware loading
Firmware file loadind for GT911 controller takes too much time (~60s). There is no check that configuration is the same which is already present. This happens always during boot, which makes touchscreen unusable.
Add there an option to prevent firmware file loading, but keep it enabled by default.
--- drivers/input/touchscreen/goodix.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/input/touchscreen/goodix.c +3 -1
@@ -941,7 +941,9 @@ static int goodix_get_gpio_config(struct goodix_ts_data *ts)default :if (ts->gpiod_int && ts->gpiod_rst) { ts->reset_controller_at_probe = true; - ts->load_cfg_from_disk = true; +/* Prevent cfg loading for each start */ + ts->load_cfg_from_disk = !device_property_read_bool (dev, +"touchscreen-do-not-load-fw" ); ts->irq_pin_access_method =IRQ_PIN_ACCESS_GPIO ; } }
Signature · 1 line
2.20.1
Dmitry Torokhov
maintainerRe: [PATCH 1/3] Input: goodix - add option to disable firmware loading
Hi Andrej,
Quoted 6 lines · Andrej Valek
Firmware file loadind for GT911 controller takes too much time (~60s). There is no check that configuration is the same which is already present. This happens always during boot, which makes touchscreen unusable.
Add there an option to prevent firmware file loading, but keep it enabled by default.
I thought that Goodix was losing firmware loading at poweroff. Is this not the case with this model?
Adding Hans as he was working with this driver/code.
Quoted 24 lines
Signed-off-by Andrej Valek <[email protected]>--- drivers/input/touchscreen/goodix.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/input/touchscreen/goodix.c +3
-1@@ -941,7 +941,9 @@ static int goodix_get_gpio_config(struct goodix_ts_data *ts)default :if (ts->gpiod_int && ts->gpiod_rst) { ts->reset_controller_at_probe = true; - ts->load_cfg_from_disk = true; +/* Prevent cfg loading for each start */ + ts->load_cfg_from_disk = !device_property_read_bool (dev, +"touchscreen-do-not-load-fw" ); ts->irq_pin_access_method =IRQ_PIN_ACCESS_GPIO ; } }Signature · 1 line
2.20.1
Thanks.
Signature · 1 line
Dmitry
RE: [PATCH 1/3] Input: goodix - add option to disable firmware loading
Hello Dmitry,
No, I don't think so, that this is the case. Because, when I disabled the FW configuration loading device is working as well. To be honest, I don't need a new configuration for each boot 😊.
Regards,
Andrej
Quoted 44 lines
Hi Andrej,
Quoted 6 lines · Andrej Valek
Firmware file loadind for GT911 controller takes too much time (~60s). There is no check that configuration is the same which is already present. This happens always during boot, which makes touchscreen unusable.
Add there an option to prevent firmware file loading, but keep it enabled by default.
I thought that Goodix was losing firmware loading at poweroff. Is this not the case with this model?
Adding Hans as he was working with this driver/code.
Quoted 23 lines
Signed-off-by Andrej Valek <[email protected]>--- drivers/input/touchscreen/goodix.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/input/touchscreen/goodix.c +3
-2@@ -941,7 +941,9 @@ static int goodix_get_gpio_config(struct goodix_ts_data *ts)default :if (ts->gpiod_int && ts->gpiod_rst) { ts->reset_controller_at_probe = true; - ts->load_cfg_from_disk = true; +/* Prevent cfg loading for each start */ + ts->load_cfg_from_disk = !device_property_read_bool (dev, +"touchscreen-do-not-load-fw" ); ts->irq_pin_access_method =IRQ_PIN_ACCESS_GPIO ; } } --Quoted 2 lines
2.20.1
Thanks.
--
Dmitry
Re: [PATCH 1/3] Input: goodix - add option to disable firmware loading
In reply to Dmitry TorokhovHi,
Quoted 7 lines · Dmitry Torokhov
Hi Andrej,
Quoted 4 lines · Andrej Valek
Firmware file loadind for GT911 controller takes too much time (~60s). There is no check that configuration is the same which is already present. This happens always during boot, which makes touchscreen unusable.
Quoted 5 lines
Quoted 2 lines
Add there an option to prevent firmware file loading, but keep it enabled by default.
I thought that Goodix was losing firmware loading at poweroff. Is this not the case with this model?
So first of all there are 2 sorts of firmware involved with the Goodix touchscreen controllers, the actual firmware and a block of config data for that firmware which I presume adjusts it for the specific (model of) the digitizer which is attached.
ATM the mainline Linux driver does not support models where the actual firmware itself needs to be loaded (because they only have RAM, so they come up without firmware).
I do have one model tablet with a ROM-less goodix touchpad controller, so if I ever find the time I might add support for loading the actual firmware.
So what we are talking about here is just loading the config data and I'm a bit surprised that this take so long.
Quoted 1 line
Adding Hans as he was working with this driver/code.
With all that said I have no objection to this change.
Regards,
Hans
Quoted 28 lines
Quoted 25 lines
Signed-off-by Andrej Valek <[email protected]>--- drivers/input/touchscreen/goodix.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/input/touchscreen/goodix.c +3
-1@@ -941,7 +941,9 @@ static int goodix_get_gpio_config(struct goodix_ts_data *ts)default :if (ts->gpiod_int && ts->gpiod_rst) { ts->reset_controller_at_probe = true; - ts->load_cfg_from_disk = true; +/* Prevent cfg loading for each start */ + ts->load_cfg_from_disk = !device_property_read_bool (dev, +"touchscreen-do-not-load-fw" ); ts->irq_pin_access_method =IRQ_PIN_ACCESS_GPIO ; } }Signature · 1 line
2.20.1Thanks.
RE: [PATCH 1/3] Input: goodix - add option to disable firmware loading
Hi Hans,
I am not saying, that just configuration loading took such a long time. Thu full process including configuration and FW loading takes it.
Means that I would like to prevent this situation, but keep the old scenario as a default behavior.
Regards,
Andrej
Quoted 63 lines
Hi,
Quoted 2 lines · Dmitry Torokhov
Hi Andrej,
Quoted 9 lines · Andrej Valek
Quoted 6 lines
Firmware file loadind for GT911 controller takes too much time (~60s). There is no check that configuration is the same which is already present. This happens always during boot, which makes touchscreen unusable.
Add there an option to prevent firmware file loading, but keep it enabled by default.
I thought that Goodix was losing firmware loading at poweroff. Is this not the case with this model?
So first of all there are 2 sorts of firmware involved with the Goodix touchscreen controllers, the actual firmware and a > block of config data for that firmware which I presume adjusts it for the specific (model of) the digitizer which is attached.
ATM the mainline Linux driver does not support models where the actual firmware itself needs to be loaded (because they only have RAM, so they come up without firmware).
I do have one model tablet with a ROM-less goodix touchpad controller, so if I ever find the time I might add support for loading the actual firmware.
So what we are talking about here is just loading the config data and I'm a bit surprised that this take so long.
Quoted 1 line
Adding Hans as he was working with this driver/code.
With all that said I have no objection to this change.
Regards,
Hans
Quoted 29 lines
Quoted 24 lines
Signed-off-by Andrej Valek <[email protected]>--- drivers/input/touchscreen/goodix.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/input/touchscreen/goodix.c +3
-2@@ -941,7 +941,9 @@ static int goodix_get_gpio_config(struct goodix_ts_data *ts)default :if (ts->gpiod_int && ts->gpiod_rst) { ts->reset_controller_at_probe = true; - ts->load_cfg_from_disk = true; +/* Prevent cfg loading for each start */ + ts->load_cfg_from_disk = !device_property_read_bool (dev, +"touchscreen-do-not-load-fw" ); ts->irq_pin_access_method =IRQ_PIN_ACCESS_GPIO ; } } --Quoted 2 lines
2.20.1
Thanks.
Dmitry Torokhov
maintainerRe: [PATCH 1/3] Input: goodix - add option to disable firmware loading
In reply to Hans de GoedeQuoted 25 lines · Hans de Goede
Hi,
Quoted 7 lines · Dmitry Torokhov
Hi Andrej,
Quoted 4 lines · Andrej Valek
Firmware file loadind for GT911 controller takes too much time (~60s). There is no check that configuration is the same which is already present. This happens always during boot, which makes touchscreen unusable.
Quoted 5 lines
Quoted 2 lines
Add there an option to prevent firmware file loading, but keep it enabled by default.
I thought that Goodix was losing firmware loading at poweroff. Is this not the case with this model?
So first of all there are 2 sorts of firmware involved with the Goodix touchscreen controllers, the actual firmware and a block of config data for that firmware which I presume adjusts it for the specific (model of) the digitizer which is attached.
ATM the mainline Linux driver does not support models where the actual firmware itself needs to be loaded (because they only have RAM, so they come up without firmware).
Quoted 6 lines
I do have one model tablet with a ROM-less goodix touchpad controller, so if I ever find the time I might add support for loading the actual firmware.
So what we are talking about here is just loading the config data and I'm a bit surprised that this take so long.
So I am still confused about this: is the config stored in RAM or NVRAM? I.e. do we actually need to re-load it every time on boot, or it supposed to be flashed only when it is changed (or lost)?
Thanks.
Signature · 1 line
Dmitry
Re: [PATCH 1/3] Input: goodix - add option to disable firmware loading
Hi,
Quoted 30 lines · Dmitry Torokhov
Quoted 29 lines · Hans de Goede
Hi,
Quoted 7 lines · Dmitry Torokhov
Hi Andrej,
Quoted 4 lines · Andrej Valek
Firmware file loadind for GT911 controller takes too much time (~60s). There is no check that configuration is the same which is already present. This happens always during boot, which makes touchscreen unusable.
Quoted 5 lines
Quoted 2 lines
Add there an option to prevent firmware file loading, but keep it enabled by default.
I thought that Goodix was losing firmware loading at poweroff. Is this not the case with this model?
So first of all there are 2 sorts of firmware involved with the Goodix touchscreen controllers, the actual firmware and a block of config data for that firmware which I presume adjusts it for the specific (model of) the digitizer which is attached.
ATM the mainline Linux driver does not support models where the actual firmware itself needs to be loaded (because they only have RAM, so they come up without firmware).
I do have one model tablet with a ROM-less goodix touchpad controller, so if I ever find the time I might add support for loading the actual firmware.
Quoted 6 lines
Quoted 2 lines
So what we are talking about here is just loading the config data and I'm a bit surprised that this take so long.
So I am still confused about this: is the config stored in RAM or NVRAM? I.e. do we actually need to re-load it every time on boot, or it supposed to be flashed only when it is changed (or lost)?
I only know about these touchscreens on x86, where we have a BIOS muddling the waters.
We have seen devices which loose the config over suspend/resume, which suggests it is in RAM. I recently added a fix for these which saves the config at boot, which suggests that at least on the device model with the suspend/resume issue the config is loaded into the chip by the BIOS.
But I'm not sure that this is the case everywhere. Most other models likely have the config in NVRAM.
I guess this is the same as with the firmware, and it differs per model. I know for sure that their are RAM only models which need the firmware loaded at boot, these are mostly found on ARM devs, but I have one X86 devices (which currently does not work) which also has RAM only and thus needs Linux to load the firmware (which is not supported atm). These RAM only models, presumably also have only RAM for the config.
Regards,
Hans
PATCH v3 1/4 Input: goodix - add option to disable firmware loading
In reply to Andrej ValekFirmware file loadind for GT911 controller takes too much time (~60s). There is no check that configuration is the same which is already present. This happens always during boot, which makes touchscreen unusable.
Add there an option to prevent firmware file loading, but keep it enabled by default.
--- drivers/input/touchscreen/goodix.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/input/touchscreen/goodix.c +3 -1
@@ -941,7 +941,9 @@ static int goodix_get_gpio_config(struct goodix_ts_data *ts)default :if (ts->gpiod_int && ts->gpiod_rst) { ts->reset_controller_at_probe = true; - ts->load_cfg_from_disk = true; +/* Prevent cfg loading for each start */ + ts->load_cfg_from_disk = !device_property_read_bool (dev, +"goodix,do-not-load-fw" ); ts->irq_pin_access_method =IRQ_PIN_ACCESS_GPIO ; } }
Signature · 1 line
2.20.1
PATCH v4 1/4 Input: goodix - add option to disable firmware loading
In reply to Andrej ValekFirmware file loadind for GT911 controller takes too much time (~60s). There is no check that configuration is the same which is already present. This happens always during boot, which makes touchscreen unusable.
Add there an option to prevent firmware file loading, but keep it enabled by default.
--- drivers/input/touchscreen/goodix.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/input/touchscreen/goodix.c +3 -1
@@ -941,7 +941,9 @@ static int goodix_get_gpio_config(struct goodix_ts_data *ts)default :if (ts->gpiod_int && ts->gpiod_rst) { ts->reset_controller_at_probe = true; - ts->load_cfg_from_disk = true; +/* Prevent cfg loading for each start */ + ts->load_cfg_from_disk = !device_property_read_bool (dev, +"goodix,do-not-load-fw" ); ts->irq_pin_access_method =IRQ_PIN_ACCESS_GPIO ; } }
Signature · 1 line
2.20.1
PATCH 2/3 dt-bindings: goodix
In reply to Andrej ValekAdd information about option how to disable FW loading for each boot.
--- Documentation/devicetree/bindings/input/touchscreen/goodix.yaml | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/input/touchscreen/goodix.yaml +1 -0
@@ -53,6 +53,7 @@ properties: touchscreen-size-x: true touchscreen-size-y: true touchscreen-swapped-x-y: true + touchscreen-do-not-load-fw: false additionalProperties: false
Signature · 1 line
2.20.1
Rob Herring
maintainerRe: [PATCH 2/3] dt-bindings: goodix
Quoted 1 line · Andrej Valek
Add information about option how to disable FW loading for each boot.
Please fix your subject.
Quoted 11 lines
Signed-off-by Andrej Valek <[email protected]>--- Documentation/devicetree/bindings/input/touchscreen/goodix.yaml | 1 + 1 file changed, 1 insertion(+)Documentation/devicetree/bindings/input/touchscreen/goodix.yaml +0
-0
Documentation/devicetree/bindings/input/touchscreen/goodix.yaml properties: · line 56
Quoted 4 lines
Documentation/devicetree/bindings/input/touchscreen/goodix.yaml +1
-0@@ -53,6 +53,7 @@ properties: touchscreen-size-x: true touchscreen-size-y: true touchscreen-swapped-x-y: true + touchscreen-do-not-load-fw: false
This is not a generic touchscreen property. It needs a vendor prefix.
Quoted 6 lines
Documentation/devicetree/bindings/input/touchscreen/goodix.yaml +0
-0additionalProperties: falseSignature · 1 line
2.20.1
PATCH v3 2/4 dt-bindings: touchscreen: goodix: add info about disabling FW loading
In reply to Andrej ValekAdd information about option how to disable FW loading for each boot.
--- Documentation/devicetree/bindings/input/touchscreen/goodix.yaml | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/input/touchscreen/goodix.yaml +1 -0
@@ -53,6 +53,7 @@ properties: touchscreen-size-x: true touchscreen-size-y: true touchscreen-swapped-x-y: true + goodix,do-not-load-fw: false additionalProperties: false
Signature · 1 line
2.20.1
Rob Herring
maintainerRe: [PATCH v3 2/4] dt-bindings: touchscreen: goodix: add info about disabling FW loading
Quoted 7 lines · Andrej Valek
Add information about option how to disable FW loading for each boot.
Signed-off-by Andrej Valek <[email protected]>--- Documentation/devicetree/bindings/input/touchscreen/goodix.yaml | 1 + 1 file changed, 1 insertion(+)
My bot found errors running 'make dt_binding_check' on your patch:
yamllint warnings/errors:
dtschema/dtc warnings/errors:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/input/touchscreen/goodix.yaml: properties:goodix,do-not-load-fw: False is not of type 'object' /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/input/touchscreen/goodix.yaml: ignoring, error in schema: properties: goodix,do-not-load-fw
warning: no schema found in file: ./Documentation/devicetree/bindings/input/touchscreen/goodix.yaml
See https://patchwork.ozlabs.org/patch/1397438
The base for the patch is generally the last rc1. Any dependencies should be noted.
If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:
pip3 install dtschema --upgrade
Please check and re-submit.
PATCH v4 2/4 dt-bindings: touchscreen: goodix: add info about disabling FW loading
In reply to Andrej ValekAdd information about option how to disable FW loading for each boot.
--- .../devicetree/bindings/input/touchscreen/goodix.yaml | 4 ++++ 1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/input/touchscreen/goodix.yaml +4 -0
@@ -54,6 +54,10 @@ properties: touchscreen-size-y: true touchscreen-swapped-x-y: true + goodix,do-not-load-fw: + description: Disable FW/CFG loading + type: boolean + additionalProperties: false required:
Signature · 1 line
2.20.1
Re: [PATCH v4 2/4] dt-bindings: touchscreen: goodix: add info about disabling FW loading
Quoted 7 lines · Andrej Valek
Add information about option how to disable FW loading for each boot.
Signed-off-by Andrej Valek <[email protected]>--- .../devicetree/bindings/input/touchscreen/goodix.yaml | 4 ++++ 1 file changed, 4 insertions(+)
PATCH 3/3 Input: atmel_mxt_ts - add option to disable firmware loading
In reply to Andrej ValekFirmware file loadind for mXT336U controller takes too much time (~60s). There is no check that configuration is the same which is already present. This happens always during boot, which makes touchscreen unusable.
Add there an option to prevent firmware file loading, but keep it enabled by default.
--- drivers/input/touchscreen/atmel_mxt_ts.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)
drivers/input/touchscreen/atmel_mxt_ts.c +14 -3
@@ -311,6 +311,7 @@ struct mxt_data {struct mxt_dbg dbg;struct gpio_desc *reset_gpio;bool use_retrigen_workaround; +bool cfg_loading_disabled;/* Cached parameters from object table */ u16 T5_address;
@@ -2191,9 +2192,15 @@ static int mxt_initialize(struct mxt_data *data)if (error)return error; - error =request_firmware_nowait (THIS_MODULE , true,MXT_CFG_NAME , - &client->dev,GFP_KERNEL , data, - mxt_config_cb); +/* Load firmware if enabled */ +if (!data->cfg_loading_disabled) { + error =request_firmware_nowait (THIS_MODULE , true,MXT_CFG_NAME , + &client->dev,GFP_KERNEL , data, + mxt_config_cb); + }else { +mxt_config_cb (NULL , data); + } +if (error) {dev_err (&client->dev,"Failed to invoke firmware loader: %d\n" , error);
@@ -3158,6 +3165,10 @@ static int mxt_probe(struct i2c_client *client, const struct i2c_device_id *id)msleep (MXT_RESET_INVALID_CHG ); } +/* prevent firmware flashing for each start */ + data->cfg_loading_disabled =device_property_read_bool (&client->dev, +"touchscreen-do-not-load-fw" ); + error =mxt_initialize (data);if (error)return error;
Signature · 1 line
2.20.1
PATCH v3 3/4 Input: atmel_mxt_ts - add option to disable firmware loading
Firmware file loadind for mXT336U controller takes too much time (~60s). There is no check that configuration is the same which is already present. This happens always during boot, which makes touchscreen unusable.
Add there an option to prevent firmware file loading, but keep it enabled by default.
--- drivers/input/touchscreen/atmel_mxt_ts.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)
drivers/input/touchscreen/atmel_mxt_ts.c +14 -3
@@ -311,6 +311,7 @@ struct mxt_data {struct mxt_dbg dbg;struct gpio_desc *reset_gpio;bool use_retrigen_workaround; +bool cfg_loading_disabled;/* Cached parameters from object table */ u16 T5_address;
@@ -2191,9 +2192,15 @@ static int mxt_initialize(struct mxt_data *data)if (error)return error; - error =request_firmware_nowait (THIS_MODULE , true,MXT_CFG_NAME , - &client->dev,GFP_KERNEL , data, - mxt_config_cb); +/* Load firmware if enabled */ +if (!data->cfg_loading_disabled) { + error =request_firmware_nowait (THIS_MODULE , true,MXT_CFG_NAME , + &client->dev,GFP_KERNEL , data, + mxt_config_cb); + }else { +mxt_config_cb (NULL , data); + } +if (error) {dev_err (&client->dev,"Failed to invoke firmware loader: %d\n" , error);
@@ -3158,6 +3165,10 @@ static int mxt_probe(struct i2c_client *client, const struct i2c_device_id *id)msleep (MXT_RESET_INVALID_CHG ); } +/* prevent firmware flashing for each start */ + data->cfg_loading_disabled =device_property_read_bool (&client->dev, +"atmel,do-not-load-fw" ); + error =mxt_initialize (data);if (error)return error;
Signature · 1 line
2.20.1
PATCH v4 3/4 Input: atmel_mxt_ts - add option to disable firmware loading
In reply to Andrej ValekFirmware file loadind for mXT336U controller takes too much time (~60s). There is no check that configuration is the same which is already present. This happens always during boot, which makes touchscreen unusable.
Add there an option to prevent firmware file loading, but keep it enabled by default.
--- drivers/input/touchscreen/atmel_mxt_ts.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)
drivers/input/touchscreen/atmel_mxt_ts.c +14 -3
@@ -311,6 +311,7 @@ struct mxt_data {struct mxt_dbg dbg;struct gpio_desc *reset_gpio;bool use_retrigen_workaround; +bool cfg_loading_disabled;/* Cached parameters from object table */ u16 T5_address;
@@ -2191,9 +2192,15 @@ static int mxt_initialize(struct mxt_data *data)if (error)return error; - error =request_firmware_nowait (THIS_MODULE , true,MXT_CFG_NAME , - &client->dev,GFP_KERNEL , data, - mxt_config_cb); +/* Load firmware if enabled */ +if (!data->cfg_loading_disabled) { + error =request_firmware_nowait (THIS_MODULE , true,MXT_CFG_NAME , + &client->dev,GFP_KERNEL , data, + mxt_config_cb); + }else { +mxt_config_cb (NULL , data); + } +if (error) {dev_err (&client->dev,"Failed to invoke firmware loader: %d\n" , error);
@@ -3158,6 +3165,10 @@ static int mxt_probe(struct i2c_client *client, const struct i2c_device_id *id)msleep (MXT_RESET_INVALID_CHG ); } +/* prevent firmware flashing for each start */ + data->cfg_loading_disabled =device_property_read_bool (&client->dev, +"atmel,do-not-load-fw" ); + error =mxt_initialize (data);if (error)return error;
Signature · 1 line
2.20.1
Dmitry Torokhov
maintainerRe: [PATCH v4 3/4] Input: atmel_mxt_ts - add option to disable firmware loading
Hi Andrej,
Quoted 6 lines · Andrej Valek
Firmware file loadind for mXT336U controller takes too much time (~60s). There is no check that configuration is the same which is already present. This happens always during boot, which makes touchscreen unusable.
Add there an option to prevent firmware file loading, but keep it enabled by default.
Automatically updating firmware and config on driver probe was a mistake, and I am planning on removing the code altogether and expect userspace to determine if flashing is needed and request it explicitly, so this option is not really needed.
Thanks.
Signature · 1 line
Dmitry
PATCH v2 1/3 Input: st1232 - add support resolution reading
In reply to Andrej ValekHard-coding resolution for st1633 device was wrong. Some of LCDs like YTS700TLBC-02-100C has assembled Sitronix st1633 touchcontroller too. But the resolution is not 320x480 as was hard-coded.
Add new function which reads correct resolution directly from register.
--- drivers/input/touchscreen/st1232.c | 52 +++++++++++++++++++++--------- 1 file changed, 36 insertions(+), 16 deletions(-)
drivers/input/touchscreen/st1232.c +36 -16
@@ -26,15 +26,14 @@#define ST1232_TS_NAME "st1232-ts"#define ST1633_TS_NAME "st1633-ts" +#define REG_XY_RESOLUTION 0x04 +#define REG_XY_COORDINATES 0x12#define ST_TS_MAX_FINGERS 10struct st_chip_info {bool have_z; -u16 max_x; -u16 max_y;u16 max_area;u16 max_fingers; -u8 start_reg; };struct st1232_ts_data {
@@ -48,15 +47,14 @@ struct st1232_ts_data {u8 *read_buf; }; -static int st1232_ts_read_data (struct st1232_ts_data *ts) +static int st1232_ts_read_data (struct st1232_ts_data *ts,u8 reg) {struct i2c_client *client = ts->client; -u8 start_reg = ts->chip_info->start_reg;struct i2c_msg msg[] = { { .addr = client->addr, - .len =sizeof (start_reg), - .buf = &start_reg, + .len =sizeof (reg), + .buf = ®, }, { .addr = client->addr,
@@ -74,6 +72,25 @@ static int st1232_ts_read_data(struct st1232_ts_data *ts)return 0 ; } +static int st1232_ts_read_resolution (struct st1232_ts_data *ts,u16 *max_x, +u16 *max_y) +{ +u8 *buf; +int error; + +/* select resolution register */ + error =st1232_ts_read_data (ts,REG_XY_RESOLUTION ); +if (error) +return error; + + buf = ts->read_buf; + + *max_x = ((buf[0 ] &0x0070 ) <<4 ) | buf[1 ]; + *max_y = ((buf[0 ] &0x0007 ) <<8 ) | buf[2 ]; + +return 0 ; +} +static int st1232_ts_parse_and_report (struct st1232_ts_data *ts) {struct input_dev *input = ts->input_dev;
@@ -123,7 +140,7 @@ static irqreturn_t st1232_ts_irq_handler(int irq, void *dev_id)int count;int error; - error =st1232_ts_read_data (ts); + error =st1232_ts_read_data (ts,REG_XY_COORDINATES );if (error) goto out;
@@ -157,20 +174,14 @@ static void st1232_ts_power_off(void *data)static const struct st_chip_info st1232_chip_info = { .have_z = true, - .max_x =0x31f ,/* 800 - 1 */ - .max_y =0x1df ,/* 480 -1 */ .max_area =0xff , .max_fingers =2 , - .start_reg =0x12 , };static const struct st_chip_info st1633_chip_info = { .have_z = false, - .max_x =0x13f ,/* 320 - 1 */ - .max_y =0x1df ,/* 480 -1 */ .max_area =0x00 , .max_fingers =5 , - .start_reg =0x12 , }; static int st1232_ts_probe(struct i2c_client *client,
@@ -179,6 +190,7 @@ static int st1232_ts_probe(struct i2c_client *client,const struct st_chip_info *match;struct st1232_ts_data *ts;struct input_dev *input_dev; +u16 max_x, max_y;int error; match =device_get_match_data (&client->dev);
@@ -239,14 +251,22 @@ static int st1232_ts_probe(struct i2c_client *client, input_dev->name ="st1232-touchscreen" ; input_dev->id.bustype =BUS_I2C ; +/* read resolution from chip */ + error =st1232_ts_read_resolution (ts, &max_x, &max_y); +if (error) { +dev_err (&client->dev, +"Failed to read resolution: %d\n" , error); +return error; + } +if (ts->chip_info->have_z)input_set_abs_params (input_dev,ABS_MT_TOUCH_MAJOR ,0 , ts->chip_info->max_area,0 ,0 );input_set_abs_params (input_dev,ABS_MT_POSITION_X , -0 , ts->chip_info->max_x,0 ,0 ); +0 , max_x,0 ,0 );input_set_abs_params (input_dev,ABS_MT_POSITION_Y , -0 , ts->chip_info->max_y,0 ,0 ); +0 , max_y,0 ,0 );touchscreen_parse_properties (input_dev, true, &ts->prop);
Signature · 1 line
2.20.1
PATCH v3 4/4 Input: st1232 - add support resolution reading
Hard-coding resolution for st1633 device was wrong. Some of LCDs like YTS700TLBC-02-100C has assembled Sitronix st1633 touchcontroller too. But the resolution is not 320x480 as was hard-coded.
Add new function which reads correct resolution directly from register.
--- drivers/input/touchscreen/st1232.c | 52 +++++++++++++++++++++--------- 1 file changed, 36 insertions(+), 16 deletions(-)
drivers/input/touchscreen/st1232.c +36 -16
@@ -26,15 +26,14 @@#define ST1232_TS_NAME "st1232-ts"#define ST1633_TS_NAME "st1633-ts" +#define REG_XY_RESOLUTION 0x04 +#define REG_XY_COORDINATES 0x12#define ST_TS_MAX_FINGERS 10struct st_chip_info {bool have_z; -u16 max_x; -u16 max_y;u16 max_area;u16 max_fingers; -u8 start_reg; };struct st1232_ts_data {
@@ -48,15 +47,14 @@ struct st1232_ts_data {u8 *read_buf; }; -static int st1232_ts_read_data (struct st1232_ts_data *ts) +static int st1232_ts_read_data (struct st1232_ts_data *ts,u8 reg) {struct i2c_client *client = ts->client; -u8 start_reg = ts->chip_info->start_reg;struct i2c_msg msg[] = { { .addr = client->addr, - .len =sizeof (start_reg), - .buf = &start_reg, + .len =sizeof (reg), + .buf = ®, }, { .addr = client->addr,
@@ -74,6 +72,25 @@ static int st1232_ts_read_data(struct st1232_ts_data *ts)return 0 ; } +static int st1232_ts_read_resolution (struct st1232_ts_data *ts,u16 *max_x, +u16 *max_y) +{ +u8 *buf; +int error; + +/* select resolution register */ + error =st1232_ts_read_data (ts,REG_XY_RESOLUTION ); +if (error) +return error; + + buf = ts->read_buf; + + *max_x = ((buf[0 ] &0x0070 ) <<4 ) | buf[1 ]; + *max_y = ((buf[0 ] &0x0007 ) <<8 ) | buf[2 ]; + +return 0 ; +} +static int st1232_ts_parse_and_report (struct st1232_ts_data *ts) {struct input_dev *input = ts->input_dev;
@@ -123,7 +140,7 @@ static irqreturn_t st1232_ts_irq_handler(int irq, void *dev_id)int count;int error; - error =st1232_ts_read_data (ts); + error =st1232_ts_read_data (ts,REG_XY_COORDINATES );if (error) goto out;
@@ -157,20 +174,14 @@ static void st1232_ts_power_off(void *data)static const struct st_chip_info st1232_chip_info = { .have_z = true, - .max_x =0x31f ,/* 800 - 1 */ - .max_y =0x1df ,/* 480 -1 */ .max_area =0xff , .max_fingers =2 , - .start_reg =0x12 , };static const struct st_chip_info st1633_chip_info = { .have_z = false, - .max_x =0x13f ,/* 320 - 1 */ - .max_y =0x1df ,/* 480 -1 */ .max_area =0x00 , .max_fingers =5 , - .start_reg =0x12 , }; static int st1232_ts_probe(struct i2c_client *client,
@@ -179,6 +190,7 @@ static int st1232_ts_probe(struct i2c_client *client,const struct st_chip_info *match;struct st1232_ts_data *ts;struct input_dev *input_dev; +u16 max_x, max_y;int error; match =device_get_match_data (&client->dev);
@@ -239,14 +251,22 @@ static int st1232_ts_probe(struct i2c_client *client, input_dev->name ="st1232-touchscreen" ; input_dev->id.bustype =BUS_I2C ; +/* read resolution from chip */ + error =st1232_ts_read_resolution (ts, &max_x, &max_y); +if (error) { +dev_err (&client->dev, +"Failed to read resolution: %d\n" , error); +return error; + } +if (ts->chip_info->have_z)input_set_abs_params (input_dev,ABS_MT_TOUCH_MAJOR ,0 , ts->chip_info->max_area,0 ,0 );input_set_abs_params (input_dev,ABS_MT_POSITION_X , -0 , ts->chip_info->max_x,0 ,0 ); +0 , max_x,0 ,0 );input_set_abs_params (input_dev,ABS_MT_POSITION_Y , -0 , ts->chip_info->max_y,0 ,0 ); +0 , max_y,0 ,0 );touchscreen_parse_properties (input_dev, true, &ts->prop);
Signature · 1 line
2.20.1
PATCH v4 4/4 Input: st1232 - add support resolution reading
In reply to Andrej ValekHard-coding resolution for st1633 device was wrong. Some of LCDs like YTS700TLBC-02-100C has assembled Sitronix st1633 touchcontroller too. But the resolution is not 320x480 as was hard-coded.
Add new function which reads correct resolution directly from register.
--- drivers/input/touchscreen/st1232.c | 52 +++++++++++++++++++++--------- 1 file changed, 36 insertions(+), 16 deletions(-)
drivers/input/touchscreen/st1232.c +36 -16
@@ -26,15 +26,14 @@#define ST1232_TS_NAME "st1232-ts"#define ST1633_TS_NAME "st1633-ts" +#define REG_XY_RESOLUTION 0x04 +#define REG_XY_COORDINATES 0x12#define ST_TS_MAX_FINGERS 10struct st_chip_info {bool have_z; -u16 max_x; -u16 max_y;u16 max_area;u16 max_fingers; -u8 start_reg; };struct st1232_ts_data {
@@ -48,15 +47,14 @@ struct st1232_ts_data {u8 *read_buf; }; -static int st1232_ts_read_data (struct st1232_ts_data *ts) +static int st1232_ts_read_data (struct st1232_ts_data *ts,u8 reg) {struct i2c_client *client = ts->client; -u8 start_reg = ts->chip_info->start_reg;struct i2c_msg msg[] = { { .addr = client->addr, - .len =sizeof (start_reg), - .buf = &start_reg, + .len =sizeof (reg), + .buf = ®, }, { .addr = client->addr,
@@ -74,6 +72,25 @@ static int st1232_ts_read_data(struct st1232_ts_data *ts)return 0 ; } +static int st1232_ts_read_resolution (struct st1232_ts_data *ts,u16 *max_x, +u16 *max_y) +{ +u8 *buf; +int error; + +/* select resolution register */ + error =st1232_ts_read_data (ts,REG_XY_RESOLUTION ); +if (error) +return error; + + buf = ts->read_buf; + + *max_x = ((buf[0 ] &0x0070 ) <<4 ) | buf[1 ]; + *max_y = ((buf[0 ] &0x0007 ) <<8 ) | buf[2 ]; + +return 0 ; +} +static int st1232_ts_parse_and_report (struct st1232_ts_data *ts) {struct input_dev *input = ts->input_dev;
@@ -123,7 +140,7 @@ static irqreturn_t st1232_ts_irq_handler(int irq, void *dev_id)int count;int error; - error =st1232_ts_read_data (ts); + error =st1232_ts_read_data (ts,REG_XY_COORDINATES );if (error) goto out;
@@ -157,20 +174,14 @@ static void st1232_ts_power_off(void *data)static const struct st_chip_info st1232_chip_info = { .have_z = true, - .max_x =0x31f ,/* 800 - 1 */ - .max_y =0x1df ,/* 480 -1 */ .max_area =0xff , .max_fingers =2 , - .start_reg =0x12 , };static const struct st_chip_info st1633_chip_info = { .have_z = false, - .max_x =0x13f ,/* 320 - 1 */ - .max_y =0x1df ,/* 480 -1 */ .max_area =0x00 , .max_fingers =5 , - .start_reg =0x12 , }; static int st1232_ts_probe(struct i2c_client *client,
@@ -179,6 +190,7 @@ static int st1232_ts_probe(struct i2c_client *client,const struct st_chip_info *match;struct st1232_ts_data *ts;struct input_dev *input_dev; +u16 max_x, max_y;int error; match =device_get_match_data (&client->dev);
@@ -239,14 +251,22 @@ static int st1232_ts_probe(struct i2c_client *client, input_dev->name ="st1232-touchscreen" ; input_dev->id.bustype =BUS_I2C ; +/* read resolution from chip */ + error =st1232_ts_read_resolution (ts, &max_x, &max_y); +if (error) { +dev_err (&client->dev, +"Failed to read resolution: %d\n" , error); +return error; + } +if (ts->chip_info->have_z)input_set_abs_params (input_dev,ABS_MT_TOUCH_MAJOR ,0 , ts->chip_info->max_area,0 ,0 );input_set_abs_params (input_dev,ABS_MT_POSITION_X , -0 , ts->chip_info->max_x,0 ,0 ); +0 , max_x,0 ,0 );input_set_abs_params (input_dev,ABS_MT_POSITION_Y , -0 , ts->chip_info->max_y,0 ,0 ); +0 , max_y,0 ,0 );touchscreen_parse_properties (input_dev, true, &ts->prop);
Signature · 1 line
2.20.1
v2 cover Firmware loading option
In reply to Andrej ValekAdd option to prevent firmware/configuration loading during each boot.
Andrej Valek (3):
Input: st1232 - add support resolution reading
dt-bindings: goodix
Input: goodix - add option to disable firmware loading
.../bindings/input/touchscreen/goodix.yaml | 2 +- drivers/input/touchscreen/goodix.c | 2 +- drivers/input/touchscreen/st1232.c | 52 +++++++++++++------ 3 files changed, 38 insertions(+), 18 deletions(-)
Signature · 1 line
2.20.1
PATCH v2 2/3 dt-bindings: goodix
In reply to Andrej ValekAdd information about option how to disable FW loading for each boot.
--- Documentation/devicetree/bindings/input/touchscreen/goodix.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/input/touchscreen/goodix.yaml +1 -1
@@ -53,7 +53,7 @@ properties: touchscreen-size-x: true touchscreen-size-y: true touchscreen-swapped-x-y: true - touchscreen-do-not-load-fw: false + goodix-do-not-load-fw: false additionalProperties: false
Signature · 1 line
2.20.1
Rob Herring
maintainerRe: [PATCH v2 2/3] dt-bindings: goodix
Quoted 1 line · Andrej Valek
Add information about option how to disable FW loading for each boot.
Again, fix your subject.
Quoted 11 lines
Signed-off-by Andrej Valek <[email protected]>--- Documentation/devicetree/bindings/input/touchscreen/goodix.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Documentation/devicetree/bindings/input/touchscreen/goodix.yaml +0
-0
Documentation/devicetree/bindings/input/touchscreen/goodix.yaml properties: · line 56
Quoted 5 lines
Documentation/devicetree/bindings/input/touchscreen/goodix.yaml +1
-1@@ -53,7 +53,7 @@ properties: touchscreen-size-x: true touchscreen-size-y: true touchscreen-swapped-x-y: true - touchscreen-do-not-load-fw: false + goodix-do-not-load-fw: false
Why is this incremental on v1?
And that's not how vendor prefixes on properties work.
PATCH v2 3/3 Input: goodix - add option to disable firmware loading
In reply to Andrej ValekFirmware file loadind for GT911 controller takes too much time (~60s). There is no check that configuration is the same which is already present. This happens always during boot, which makes touchscreen unusable.
Add there an option to prevent firmware file loading, but keep it enabled by default.
--- drivers/input/touchscreen/goodix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/touchscreen/goodix.c +1 -1
@@ -943,7 +943,7 @@ static int goodix_get_gpio_config(struct goodix_ts_data *ts) ts->reset_controller_at_probe = true;/* Prevent cfg loading for each start */ ts->load_cfg_from_disk = !device_property_read_bool (dev, -"touchscreen-do-not-load-fw" ); +"goodix-do-not-load-fw" ); ts->irq_pin_access_method =IRQ_PIN_ACCESS_GPIO ; } }
Signature · 1 line
2.20.1
v3 cover Firmware loading option
In reply to Andrej ValekAdd option to prevent firmware/configuration loading during each boot.
Andrej Valek (4):
Input: goodix - add option to disable firmware loading
dt-bindings: touchscreen: goodix: add info about disabling FW loading
Input: atmel_mxt_ts - add option to disable firmware loading
Input: st1232 - add support resolution reading
.../bindings/input/touchscreen/goodix.yaml | 1 + drivers/input/touchscreen/atmel_mxt_ts.c | 17 ++++-- drivers/input/touchscreen/goodix.c | 4 +- drivers/input/touchscreen/st1232.c | 52 +++++++++++++------ 4 files changed, 54 insertions(+), 20 deletions(-)
Signature · 1 line
2.20.1
v4 cover Firmware loading option
In reply to Andrej ValekAdd option to prevent firmware/configuration loading during each boot.
Andrej Valek (4):
Input: goodix - add option to disable firmware loading
dt-bindings: touchscreen: goodix: add info about disabling FW loading
Input: atmel_mxt_ts - add option to disable firmware loading
Input: st1232 - add support resolution reading
.../bindings/input/touchscreen/goodix.yaml | 4 ++ drivers/input/touchscreen/atmel_mxt_ts.c | 17 ++++-- drivers/input/touchscreen/goodix.c | 4 +- drivers/input/touchscreen/st1232.c | 52 +++++++++++++------ 4 files changed, 57 insertions(+), 20 deletions(-)
Signature · 1 line
2.20.1