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

« back to all changes in this revision

Viewing changes to arch/arm/mach-exynos4/mach-nuri.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:
12
12
#include <linux/serial_core.h>
13
13
#include <linux/input.h>
14
14
#include <linux/i2c.h>
 
15
#include <linux/i2c/atmel_mxt_ts.h>
15
16
#include <linux/gpio_keys.h>
16
17
#include <linux/gpio.h>
17
18
#include <linux/regulator/machine.h>
30
31
#include <plat/cpu.h>
31
32
#include <plat/devs.h>
32
33
#include <plat/sdhci.h>
 
34
#include <plat/ehci.h>
 
35
#include <plat/clock.h>
 
36
#include <plat/gpio-cfg.h>
 
37
#include <plat/iic.h>
33
38
 
34
39
#include <mach/map.h>
35
40
 
257
262
        /* Gyro, To be updated */
258
263
};
259
264
 
 
265
/* TSP */
 
266
static u8 mxt_init_vals[] = {
 
267
        /* MXT_GEN_COMMAND(6) */
 
268
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
269
        /* MXT_GEN_POWER(7) */
 
270
        0x20, 0xff, 0x32,
 
271
        /* MXT_GEN_ACQUIRE(8) */
 
272
        0x0a, 0x00, 0x05, 0x00, 0x00, 0x00, 0x09, 0x23,
 
273
        /* MXT_TOUCH_MULTI(9) */
 
274
        0x00, 0x00, 0x00, 0x13, 0x0b, 0x00, 0x00, 0x00, 0x02, 0x00,
 
275
        0x00, 0x01, 0x01, 0x0e, 0x0a, 0x0a, 0x0a, 0x0a, 0x00, 0x00,
 
276
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
277
        0x00,
 
278
        /* MXT_TOUCH_KEYARRAY(15) */
 
279
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00,
 
280
        0x00,
 
281
        /* MXT_SPT_GPIOPWM(19) */
 
282
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
283
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
284
        /* MXT_PROCI_GRIPFACE(20) */
 
285
        0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x28, 0x04,
 
286
        0x0f, 0x0a,
 
287
        /* MXT_PROCG_NOISE(22) */
 
288
        0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x23, 0x00,
 
289
        0x00, 0x05, 0x0f, 0x19, 0x23, 0x2d, 0x03,
 
290
        /* MXT_TOUCH_PROXIMITY(23) */
 
291
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
292
        0x00, 0x00, 0x00, 0x00, 0x00,
 
293
        /* MXT_PROCI_ONETOUCH(24) */
 
294
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
295
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
296
        /* MXT_SPT_SELFTEST(25) */
 
297
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
298
        0x00, 0x00, 0x00, 0x00,
 
299
        /* MXT_PROCI_TWOTOUCH(27) */
 
300
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
301
        /* MXT_SPT_CTECONFIG(28) */
 
302
        0x00, 0x00, 0x02, 0x08, 0x10, 0x00,
 
303
};
 
304
 
 
305
static struct mxt_platform_data mxt_platform_data = {
 
306
        .config                 = mxt_init_vals,
 
307
        .config_length          = ARRAY_SIZE(mxt_init_vals),
 
308
 
 
309
        .x_line                 = 18,
 
310
        .y_line                 = 11,
 
311
        .x_size                 = 1024,
 
312
        .y_size                 = 600,
 
313
        .blen                   = 0x1,
 
314
        .threshold              = 0x28,
 
315
        .voltage                = 2800000,              /* 2.8V */
 
316
        .orient                 = MXT_DIAGONAL_COUNTER,
 
317
        .irqflags               = IRQF_TRIGGER_FALLING,
 
318
};
 
319
 
 
320
static struct s3c2410_platform_i2c i2c3_data __initdata = {
 
321
        .flags          = 0,
 
322
        .bus_num        = 3,
 
323
        .slave_addr     = 0x10,
 
324
        .frequency      = 400 * 1000,
 
325
        .sda_delay      = 100,
 
326
};
 
327
 
 
328
static struct i2c_board_info i2c3_devs[] __initdata = {
 
329
        {
 
330
                I2C_BOARD_INFO("atmel_mxt_ts", 0x4a),
 
331
                .platform_data  = &mxt_platform_data,
 
332
                .irq            = IRQ_EINT(4),
 
333
        },
 
334
};
 
335
 
 
336
static void __init nuri_tsp_init(void)
 
337
{
 
338
        int gpio;
 
339
 
 
340
        /* TOUCH_INT: XEINT_4 */
 
341
        gpio = EXYNOS4_GPX0(4);
 
342
        gpio_request(gpio, "TOUCH_INT");
 
343
        s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf));
 
344
        s3c_gpio_setpull(gpio, S3C_GPIO_PULL_UP);
 
345
}
 
346
 
260
347
/* GPIO I2C 5 (PMIC) */
261
348
static struct i2c_board_info i2c5_devs[] __initdata = {
262
349
        /* max8997, To be updated */
263
350
};
264
351
 
 
352
/* USB EHCI */
 
353
static struct s5p_ehci_platdata nuri_ehci_pdata;
 
354
 
 
355
static void __init nuri_ehci_init(void)
 
356
{
 
357
        struct s5p_ehci_platdata *pdata = &nuri_ehci_pdata;
 
358
 
 
359
        s5p_ehci_set_platdata(pdata);
 
360
}
 
361
 
265
362
static struct platform_device *nuri_devices[] __initdata = {
266
363
        /* Samsung Platform Devices */
267
364
        &emmc_fixed_voltage,
270
367
        &s3c_device_hsmmc3,
271
368
        &s3c_device_wdt,
272
369
        &s3c_device_timer[0],
 
370
        &s5p_device_ehci,
 
371
        &s3c_device_i2c3,
273
372
 
274
373
        /* NURI Devices */
275
374
        &nuri_gpio_keys,
287
386
static void __init nuri_machine_init(void)
288
387
{
289
388
        nuri_sdhci_init();
 
389
        nuri_tsp_init();
290
390
 
291
391
        i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs));
 
392
        s3c_i2c3_set_platdata(&i2c3_data);
 
393
        i2c_register_board_info(3, i2c3_devs, ARRAY_SIZE(i2c3_devs));
292
394
        i2c_register_board_info(5, i2c5_devs, ARRAY_SIZE(i2c5_devs));
293
395
 
 
396
        nuri_ehci_init();
 
397
        clk_xusbxti.rate = 24000000;
 
398
 
294
399
        /* Last */
295
400
        platform_add_devices(nuri_devices, ARRAY_SIZE(nuri_devices));
296
401
}