~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
#define SYNAPTICS_RMI4_DEVICE_CONTROL_FUNC_NUM  (0x01)
72
72
 
73
73
/**
74
 
 * struct synaptics_rmi4_fn_desc - contains the funtion descriptor information
 
74
 * struct synaptics_rmi4_fn_desc - contains the function descriptor information
75
75
 * @query_base_addr: base address for query
76
76
 * @cmd_base_addr: base address for command
77
77
 * @ctrl_base_addr: base address for control
92
92
};
93
93
 
94
94
/**
95
 
 * struct synaptics_rmi4_fn - contains the funtion information
 
95
 * struct synaptics_rmi4_fn - contains the function information
96
96
 * @fn_number: function number
97
97
 * @num_of_data_sources: number of data sources
98
98
 * @num_of_data_points: number of fingers touched
151
151
 * @input_dev: pointer for input device
152
152
 * @i2c_client: pointer for i2c client
153
153
 * @board: constant pointer for touch platform data
154
 
 * @fn_list_mutex: mutex for funtion list
 
154
 * @fn_list_mutex: mutex for function list
155
155
 * @rmi4_page_mutex: mutex for rmi4 page
156
156
 * @current_page: variable for integer
157
157
 * @number_of_interrupt_register: interrupt registers count
278
278
        txbuf[0]        = address & MASK_8BIT;
279
279
        txbuf[1]        = data;
280
280
        retval          = i2c_master_send(pdata->i2c_client, txbuf, 2);
281
 
        /* Add in retry on writes only in certian error return values */
 
281
        /* Add in retry on writes only in certain error return values */
282
282
        if (retval != 2) {
283
283
                dev_err(&i2c->dev, "%s:failed:%d\n", __func__, retval);
284
284
                retval = -EIO;
561
561
        }
562
562
        /*
563
563
         * 2D data sources have only 3 bits for the number of fingers
564
 
         * supported - so the encoding is a bit wierd.
 
564
         * supported - so the encoding is a bit weird.
565
565
         */
566
566
        if ((queries[1] & MASK_3BIT) <= 4)
567
567
                /* add 1 since zero based */
764
764
                                                                (pdata, rfi,
765
765
                                                                &rmi_fd,
766
766
                                                                intr_count);
767
 
                                        if (retval < 0)
 
767
                                        if (retval < 0) {
 
768
                                                kfree(rfi);
768
769
                                                return retval;
 
770
                                        }
769
771
                                }
770
772
                                break;
771
773
                        }
924
926
                goto err_input;
925
927
        }
926
928
 
927
 
        dev_set_name(&client->dev, platformdata->name);
928
 
 
929
929
        if (platformdata->regulator_en) {
930
 
                rmi4_data->regulator = regulator_get(&client->dev, "v-touch");
 
930
                rmi4_data->regulator = regulator_get(&client->dev, "vdd");
931
931
                if (IS_ERR(rmi4_data->regulator)) {
932
932
                        dev_err(&client->dev, "%s:get regulator failed\n",
933
933
                                                                __func__);
993
993
        retval = request_threaded_irq(platformdata->irq_number, NULL,
994
994
                                        synaptics_rmi4_irq,
995
995
                                        platformdata->irq_type,
996
 
                                        platformdata->name, rmi4_data);
 
996
                                        DRIVER_NAME, rmi4_data);
997
997
        if (retval) {
998
998
                dev_err(&client->dev, "%s:Unable to get attn irq %d\n",
999
999
                                __func__, platformdata->irq_number);
1000
 
                goto err_unset_clientdata;
 
1000
                goto err_query_dev;
1001
1001
        }
1002
1002
 
1003
1003
        retval = input_register_device(rmi4_data->input_dev);
1010
1010
 
1011
1011
err_free_irq:
1012
1012
        free_irq(platformdata->irq_number, rmi4_data);
1013
 
err_unset_clientdata:
1014
 
        i2c_set_clientdata(client, NULL);
1015
1013
err_query_dev:
1016
1014
        if (platformdata->regulator_en) {
1017
1015
                regulator_disable(rmi4_data->regulator);
1029
1027
 * synaptics_rmi4_remove() - Removes the i2c-client touchscreen driver
1030
1028
 * @client: i2c client structure pointer
1031
1029
 *
1032
 
 * This funtion uses to remove the i2c-client
 
1030
 * This function uses to remove the i2c-client
1033
1031
 * touchscreen driver and returns integer.
1034
1032
 */
1035
1033
static int __devexit synaptics_rmi4_remove(struct i2c_client *client)
1055
1053
 * synaptics_rmi4_suspend() - suspend the touch screen controller
1056
1054
 * @dev: pointer to device structure
1057
1055
 *
1058
 
 * This funtion is used to suspend the
 
1056
 * This function is used to suspend the
1059
1057
 * touch panel controller and returns integer
1060
1058
 */
1061
1059
static int synaptics_rmi4_suspend(struct device *dev)
1091
1089
 * synaptics_rmi4_resume() - resume the touch screen controller
1092
1090
 * @dev: pointer to device structure
1093
1091
 *
1094
 
 * This funtion is used to resume the touch panel
 
1092
 * This function is used to resume the touch panel
1095
1093
 * controller and returns integer.
1096
1094
 */
1097
1095
static int synaptics_rmi4_resume(struct device *dev)
1150
1148
/**
1151
1149
 * synaptics_rmi4_init() - Initialize the touchscreen driver
1152
1150
 *
1153
 
 * This funtion uses to initializes the synaptics
 
1151
 * This function uses to initializes the synaptics
1154
1152
 * touchscreen driver and returns integer.
1155
1153
 */
1156
1154
static int __init synaptics_rmi4_init(void)
1160
1158
/**
1161
1159
 * synaptics_rmi4_exit() - De-initialize the touchscreen driver
1162
1160
 *
1163
 
 * This funtion uses to de-initialize the synaptics
 
1161
 * This function uses to de-initialize the synaptics
1164
1162
 * touchscreen driver and returns none.
1165
1163
 */
1166
1164
static void __exit synaptics_rmi4_exit(void)