aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-pca-platform.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/i2c/busses/i2c-pca-platform.c b/drivers/i2c/busses/i2c-pca-platform.c
index df5e593a1d76..7b23891b7d59 100644
--- a/drivers/i2c/busses/i2c-pca-platform.c
+++ b/drivers/i2c/busses/i2c-pca-platform.c
@@ -177,10 +177,20 @@ static int __devinit i2c_pca_pf_probe(struct platform_device *pdev)
177 (unsigned long) res->start); 177 (unsigned long) res->start);
178 i2c->adap.algo_data = &i2c->algo_data; 178 i2c->adap.algo_data = &i2c->algo_data;
179 i2c->adap.dev.parent = &pdev->dev; 179 i2c->adap.dev.parent = &pdev->dev;
180 i2c->adap.timeout = platform_data->timeout;
181 180
182 i2c->algo_data.i2c_clock = platform_data->i2c_clock_speed; 181 if (platform_data) {
182 i2c->adap.timeout = platform_data->timeout;
183 i2c->algo_data.i2c_clock = platform_data->i2c_clock_speed;
184 i2c->gpio = platform_data->gpio;
185 } else {
186 i2c->adap.timeout = HZ;
187 i2c->algo_data.i2c_clock = 59000;
188 i2c->gpio = -1;
189 }
190
183 i2c->algo_data.data = i2c; 191 i2c->algo_data.data = i2c;
192 i2c->algo_data.wait_for_completion = i2c_pca_pf_waitforcompletion;
193 i2c->algo_data.reset_chip = i2c_pca_pf_dummyreset;
184 194
185 switch (res->flags & IORESOURCE_MEM_TYPE_MASK) { 195 switch (res->flags & IORESOURCE_MEM_TYPE_MASK) {
186 case IORESOURCE_MEM_32BIT: 196 case IORESOURCE_MEM_32BIT:
@@ -198,11 +208,6 @@ static int __devinit i2c_pca_pf_probe(struct platform_device *pdev)
198 break; 208 break;
199 } 209 }
200 210
201 i2c->algo_data.wait_for_completion = i2c_pca_pf_waitforcompletion;
202
203 i2c->gpio = platform_data->gpio;
204 i2c->algo_data.reset_chip = i2c_pca_pf_dummyreset;
205
206 /* Use gpio_is_valid() when in mainline */ 211 /* Use gpio_is_valid() when in mainline */
207 if (i2c->gpio > -1) { 212 if (i2c->gpio > -1) {
208 ret = gpio_request(i2c->gpio, i2c->adap.name); 213 ret = gpio_request(i2c->gpio, i2c->adap.name);