@@ -1307,6 +1307,11 @@ static int __devinit qt602240_probe(struct i2c_client *client,
i2c_set_clientdata(client, data);
+ if (data->pdata->hw_setup) {
+ error = data->pdata->hw_setup(client);
+ if (error)
+ goto err_free_object;
+ }
error = qt602240_initialize(data);
if (error)
goto err_free_object;
@@ -1376,6 +1381,8 @@ static int __devexit qt602240_remove(struct i2c_client *client)
sysfs_remove_group(&client->dev.kobj, &qt602240_attr_group);
free_irq(data->irq, data);
input_unregister_device(data->input_dev);
+ if (data->pdata->hw_teardown)
+ data->pdata->hw_teardown(client);
kfree(data->object_table);
kfree(data);
@@ -41,6 +41,10 @@ struct qt602240_platform_data {
* platform_data).
*/
unsigned char trust_nvm;
+
+ /* Board-specific HW hooks; NULL if not needed */
+ int (*hw_setup) (struct i2c_client *client);
+ void (*hw_teardown) (struct i2c_client *client);
};
#endif /* __LINUX_QT602240_TS_H */