blob: 514d40b625a4604c16c179b9562aa54b84f4d27e [file] [log] [blame]
Srinidhi Kasagaraa44ef42009-11-28 08:17:18 +01001/*
Linus Walleija3a6c6a2012-10-01 09:37:39 +02002 * Copyright (C) 2008-2012 ST-Ericsson
Srinidhi Kasagaraa44ef42009-11-28 08:17:18 +01003 *
4 * Author: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2, as
8 * published by the Free Software Foundation.
9 *
10 */
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/interrupt.h>
14#include <linux/platform_device.h>
Lee Jones265c3c02013-03-27 14:13:53 +000015#include <linux/clk.h>
Srinidhi Kasagaraa44ef42009-11-28 08:17:18 +010016#include <linux/io.h>
hongbo.zhangdc1956b2012-11-15 18:56:43 +080017#include <linux/platform_data/db8500_thermal.h>
Srinidhi Kasagaraa44ef42009-11-28 08:17:18 +010018#include <linux/amba/bus.h>
19#include <linux/amba/pl022.h>
Linus Walleijee66e652011-12-02 14:16:33 +010020#include <linux/mfd/abx500/ab8500.h>
Bengt Jonsson79568b942011-03-11 11:54:46 +010021#include <linux/regulator/ab8500.h>
Lee Jones0b5ea1e2012-09-03 14:33:39 +010022#include <linux/regulator/fixed.h>
Lee Jonescd2fa6d2013-01-31 11:31:16 +000023#include <linux/regulator/driver.h>
Linus Walleijfe67dfc2011-03-07 11:48:15 +010024#include <linux/mfd/tps6105x.h>
Milo(Woogyom) Kimdf4094d2013-02-05 19:26:59 +090025#include <linux/platform_data/leds-lp55xx.h>
Philippe Langlaisa71b8192011-01-14 10:53:59 +010026#include <linux/input.h>
Shreshtha Kumar Sahu1a7d4362011-06-13 10:11:44 +020027#include <linux/delay.h>
Robert Marklund350abe02011-06-20 15:55:46 +020028#include <linux/leds.h>
Linus Walleija0980662012-05-07 01:33:24 +020029#include <linux/pinctrl/consumer.h>
Linus Walleijbb16bd92012-10-10 14:27:58 +020030#include <linux/platform_data/pinctrl-nomadik.h>
Linus Walleij865fab62012-10-18 14:20:16 +020031#include <linux/platform_data/dma-ste-dma40.h>
Linus Walleija0980662012-05-07 01:33:24 +020032
Srinidhi Kasagaraa44ef42009-11-28 08:17:18 +010033#include <asm/mach-types.h>
Srinidhi Kasagaraa44ef42009-11-28 08:17:18 +010034
Arnd Bergmanne657bcf2013-03-21 22:51:12 +010035#include "setup.h"
36#include "devices.h"
Arnd Bergmanneba52742013-03-21 22:51:08 +010037#include "irqs.h"
Srinidhi Kasagaraa44ef42009-11-28 08:17:18 +010038
Linus Walleij5d7b8462010-10-14 13:57:59 +020039#include "ste-dma40-db8500.h"
Linus Walleij174e7792013-03-19 15:41:55 +010040#include "db8500-regs.h"
Rabin Vincentfbf1eadf2010-09-29 19:46:32 +053041#include "devices-db8500.h"
Hanumath Prasad008f8a22010-08-19 12:06:32 +010042#include "board-mop500.h"
Bengt Jonssona1e516e2010-12-10 11:08:48 +010043#include "board-mop500-regulators.h"
Rabin Vincentea05a572010-06-03 07:58:42 +010044
Linus Walleij05ec2602013-02-07 10:17:31 +010045struct ab8500_platform_data ab8500_platdata = {
Rabin Vincent39ae7022010-07-26 11:12:15 +010046 .irq_base = MOP500_AB8500_IRQ_BASE,
Lee Jonesc4e67bb2013-04-02 13:24:19 +010047 .regulator = &ab8500_regulator_plat_data,
Rabin Vincent39ae7022010-07-26 11:12:15 +010048};
49
Linus Walleij5d7b8462010-10-14 13:57:59 +020050#ifdef CONFIG_STE_DMA40
51static struct stedma40_chan_cfg ssp0_dma_cfg_rx = {
52 .mode = STEDMA40_MODE_LOGICAL,
Lee Jones98b68ab2013-05-15 10:51:53 +010053 .dir = DMA_DEV_TO_MEM,
Lee Jones26955c07d2013-05-03 15:31:56 +010054 .dev_type = DB8500_DMA_DEV8_SSP0,
Linus Walleij5d7b8462010-10-14 13:57:59 +020055};
56
57static struct stedma40_chan_cfg ssp0_dma_cfg_tx = {
58 .mode = STEDMA40_MODE_LOGICAL,
Lee Jones98b68ab2013-05-15 10:51:53 +010059 .dir = DMA_MEM_TO_DEV,
Lee Jones26955c07d2013-05-03 15:31:56 +010060 .dev_type = DB8500_DMA_DEV8_SSP0,
Linus Walleij5d7b8462010-10-14 13:57:59 +020061};
62#endif
63
Lee Jonesfa86a762012-09-27 10:17:36 +010064struct pl022_ssp_controller ssp0_plat = {
Linus Walleij5d7b8462010-10-14 13:57:59 +020065 .bus_id = 0,
66#ifdef CONFIG_STE_DMA40
67 .enable_dma = 1,
68 .dma_filter = stedma40_filter,
69 .dma_rx_param = &ssp0_dma_cfg_rx,
70 .dma_tx_param = &ssp0_dma_cfg_tx,
71#else
72 .enable_dma = 0,
73#endif
74 /* on this platform, gpio 31,142,144,214 &
75 * 224 are connected as chip selects
76 */
77 .num_chipselect = 5,
78};