summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/include
diff options
context:
space:
mode:
authorMarcel Ziswiler <marcel.ziswiler@toradex.com>2012-09-10 14:53:27 +0200
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2012-09-10 15:04:19 +0200
commitd5bbf34613a877dbe3da847fa0432da8c6721e73 (patch)
tree902a90fd7eda61aad7abae9c35b0da2e7a786995 /arch/arm/mach-tegra/include
parentc6c1f7a2c194f1a2291a15c6691c0d6785f8976e (diff)
parent336961dd3cf9c39456dd9657e8f205718740c797 (diff)
Merge branch 'l4t/l4t-r16' into colibri
Merge with latest NVIDIA L4T R16. Only real conflict concerning inverted VBUS gpio support.
Diffstat (limited to 'arch/arm/mach-tegra/include')
-rw-r--r--arch/arm/mach-tegra/include/mach/clk.h12
-rw-r--r--arch/arm/mach-tegra/include/mach/dc.h23
-rw-r--r--arch/arm/mach-tegra/include/mach/iomap.h9
-rw-r--r--arch/arm/mach-tegra/include/mach/iovmm.h67
-rw-r--r--arch/arm/mach-tegra/include/mach/latency_allowance.h4
-rw-r--r--arch/arm/mach-tegra/include/mach/legacy_irq.h2
-rw-r--r--arch/arm/mach-tegra/include/mach/nvmap.h158
-rw-r--r--arch/arm/mach-tegra/include/mach/sdhci.h9
-rw-r--r--arch/arm/mach-tegra/include/mach/tegra_p1852_pdata.h7
-rw-r--r--arch/arm/mach-tegra/include/mach/tegra_usb_modem_power.h12
-rw-r--r--arch/arm/mach-tegra/include/mach/thermal.h91
-rw-r--r--arch/arm/mach-tegra/include/mach/usb_phy.h239
12 files changed, 318 insertions, 315 deletions
diff --git a/arch/arm/mach-tegra/include/mach/clk.h b/arch/arm/mach-tegra/include/mach/clk.h
index 0fbbf24d5959..01d322a448d1 100644
--- a/arch/arm/mach-tegra/include/mach/clk.h
+++ b/arch/arm/mach-tegra/include/mach/clk.h
@@ -6,7 +6,7 @@
* Author:
* Erik Gilling <konkers@google.com>
*
- * Copyright (C) 2010-2011 NVIDIA Corporation
+ * Copyright (C) 2010-2012 NVIDIA Corporation
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
@@ -47,10 +47,20 @@ static inline int tegra_dvfs_set_rate(struct clk *c, unsigned long rate)
unsigned long clk_get_rate_all_locked(struct clk *c);
#ifdef CONFIG_ARCH_TEGRA_2x_SOC
void tegra_sdmmc_tap_delay(struct clk *c, int delay);
+
+static inline int tegra_emc_enable_eack(void) {
+ return 0;
+}
+
+static inline int tegra_emc_disable_eack(void) {
+ return 0;
+}
#else
static inline void tegra_sdmmc_tap_delay(struct clk *c, int delay)
{
}
+int tegra_emc_enable_eack(void);
+int tegra_emc_disable_eack(void);
#endif
int tegra_dvfs_rail_disable_by_name(const char *reg_id);
int tegra_clk_cfg_ex(struct clk *c, enum tegra_clk_ex_param p, u32 setting);
diff --git a/arch/arm/mach-tegra/include/mach/dc.h b/arch/arm/mach-tegra/include/mach/dc.h
index 3b9b431dea82..97f02ce6e95d 100644
--- a/arch/arm/mach-tegra/include/mach/dc.h
+++ b/arch/arm/mach-tegra/include/mach/dc.h
@@ -128,6 +128,13 @@ struct dsi_phy_timing_ns {
u16 t_tago_ns;
};
+/* Aggressiveness level of DSI suspend. The higher, the more aggressive. */
+#define DSI_NO_SUSPEND 0
+#define DSI_HOST_SUSPEND_LV0 1
+#define DSI_HOST_SUSPEND_LV1 2
+#define DSI_HOST_SUSPEND_LV2 3
+#define DSI_SUSPEND_FULL 4
+
struct tegra_dsi_out {
u8 n_data_lanes; /* required */
u8 pixel_format; /* required */
@@ -140,6 +147,7 @@ struct tegra_dsi_out {
u8 chip_rev;
bool panel_has_frame_buffer; /* required*/
+ bool panel_send_dc_frames;
struct tegra_dsi_cmd *dsi_init_cmd; /* required */
u16 n_init_cmd; /* required */
@@ -157,6 +165,8 @@ struct tegra_dsi_out {
u8 video_clock_mode;
u8 video_burst_mode;
+ u8 suspend_aggr;
+
u16 panel_buffer_size_byte;
u16 panel_reset_timeout_msec;
@@ -361,6 +371,7 @@ struct tegra_dc_out {
int (*enable)(void);
int (*postpoweron)(void);
+ int (*prepoweroff)(void);
int (*disable)(void);
int (*hotplug_init)(void);
@@ -377,6 +388,7 @@ struct tegra_dc_out {
#define TEGRA_DC_OUT_CONTINUOUS_MODE (0 << 3)
#define TEGRA_DC_OUT_ONE_SHOT_MODE (1 << 3)
#define TEGRA_DC_OUT_N_SHOT_MODE (1 << 4)
+#define TEGRA_DC_OUT_ONE_SHOT_LP_MODE (1 << 5)
#define TEGRA_DC_ALIGN_MSB 0
#define TEGRA_DC_ALIGN_LSB 1
@@ -384,6 +396,9 @@ struct tegra_dc_out {
#define TEGRA_DC_ORDER_RED_BLUE 0
#define TEGRA_DC_ORDER_BLUE_RED 1
+#define V_BLANK_FLIP 0
+#define V_BLANK_NVSD 1
+
struct tegra_dc;
struct nvmap_handle_ref;
@@ -426,6 +441,7 @@ struct tegra_dc_win {
unsigned out_w;
unsigned out_h;
unsigned z;
+ u8 global_alpha;
struct tegra_dc_csc csc;
@@ -502,6 +518,7 @@ struct tegra_dc_platform_data {
#define TEGRA_DC_FLAG_ENABLED (1 << 0)
+int tegra_dc_get_stride(struct tegra_dc *dc, unsigned win);
struct tegra_dc *tegra_dc_get_dc(unsigned idx);
struct tegra_dc_win *tegra_dc_get_window(struct tegra_dc *dc, unsigned win);
bool tegra_dc_get_connected(struct tegra_dc *);
@@ -538,7 +555,6 @@ unsigned tegra_dc_get_out_max_pixclock(const struct tegra_dc *dc);
struct tegra_dc_pwm_params {
int which_pwm;
- void (*switch_to_sfio)(int);
int gpio_conf_to_sfio;
unsigned int period;
unsigned int clk_div;
@@ -549,7 +565,10 @@ struct tegra_dc_pwm_params {
void tegra_dc_config_pwm(struct tegra_dc *dc, struct tegra_dc_pwm_params *cfg);
int tegra_dsi_send_panel_short_cmd(struct tegra_dc *dc, u8 *pdata, u8 data_len);
-void tegra_dc_host_trigger(struct tegra_dc *dc);
+void tegra_dc_host_suspend(struct tegra_dc *dc);
+void tegra_dc_host_resume(struct tegra_dc *dc);
+int tegra_dsi_host_suspend(struct tegra_dc *dc);
+int tegra_dsi_host_resume(struct tegra_dc *dc);
int tegra_dc_update_csc(struct tegra_dc *dc, int win_index);
diff --git a/arch/arm/mach-tegra/include/mach/iomap.h b/arch/arm/mach-tegra/include/mach/iomap.h
index c491abafb8b9..2e205db063dd 100644
--- a/arch/arm/mach-tegra/include/mach/iomap.h
+++ b/arch/arm/mach-tegra/include/mach/iomap.h
@@ -2,7 +2,7 @@
* arch/arm/mach-tegra/include/mach/iomap.h
*
* Copyright (C) 2010 Google, Inc.
- * Copyright (C) 2011 NVIDIA Corporation.
+ * Copyright (C) 2011-2012, NVIDIA Corporation.
*
* Author:
* Colin Cross <ccross@google.com>
@@ -92,6 +92,8 @@
#define TEGRA_GART_BASE 0x58000000
#define TEGRA_GART_SIZE SZ_32M
+#define TEGRA_IOMMU_BASE TEGRA_GART_BASE
+#define TEGRA_IOMMU_SIZE TEGRA_GART_SIZE
#else
@@ -99,6 +101,8 @@
#define TEGRA_SMMU_SIZE_TEGRA3_A01 SZ_256M
#define TEGRA_SMMU_BASE 0x00001000
#define TEGRA_SMMU_SIZE (SZ_1G - SZ_4K * 2)
+#define TEGRA_IOMMU_BASE TEGRA_SMMU_BASE
+#define TEGRA_IOMMU_SIZE TEGRA_SMMU_SIZE
#endif
@@ -263,6 +267,9 @@
#define TEGRA_TSENSOR_BASE 0x70014000
#define TEGRA_TSENSOR_SIZE SZ_4K
+#define TEGRA_CEC_BASE 0x70015000
+#define TEGRA_CEC_SIZE SZ_4K
+
#define TEGRA_HDA_BASE 0x70030000
#define TEGRA_HDA_SIZE SZ_64K
diff --git a/arch/arm/mach-tegra/include/mach/iovmm.h b/arch/arm/mach-tegra/include/mach/iovmm.h
index fd83a326e129..cd56bd835592 100644
--- a/arch/arm/mach-tegra/include/mach/iovmm.h
+++ b/arch/arm/mach-tegra/include/mach/iovmm.h
@@ -1,7 +1,7 @@
/*
* arch/arm/mach-tegra/include/mach/iovmm.h
*
- * Copyright (c) 2010-2011, NVIDIA Corporation.
+ * Copyright (c) 2010-2012, NVIDIA Corporation.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -68,6 +68,8 @@ struct tegra_iovmm_domain {
struct iovmm_share_group;
+#if !defined(CONFIG_IOMMU_API)
+
struct tegra_iovmm_client {
const char *name;
unsigned long flags;
@@ -90,6 +92,25 @@ struct tegra_iovmm_area {
struct tegra_iovmm_area_ops *ops;
};
+#else /* CONFIG_IOMMU_API */
+
+/*
+ * To replace IOVMM with IOMMU backend
+ */
+
+struct tegra_iovmm_client {
+ struct device *dev;
+};
+
+struct tegra_iovmm_area {
+ dma_addr_t iovm_start;
+ size_t iovm_length;
+ pgprot_t pgprot;
+ struct device *dev;
+};
+
+#endif /* CONFIG_IOMMU_API */
+
struct tegra_iovmm_device_ops {
/* maps a VMA using the page residency functions provided by the VMA */
int (*map)(struct tegra_iovmm_domain *domain,
@@ -140,9 +161,16 @@ struct tegra_iovmm_area_ops {
* called by clients to allocate an I/O VMM client mapping context which
* will be shared by all clients in the same share_group
*/
-struct tegra_iovmm_client *tegra_iovmm_alloc_client(const char *name,
+struct tegra_iovmm_client *__tegra_iovmm_alloc_client(const char *name,
const char *share_group, struct miscdevice *misc_dev);
+static inline struct tegra_iovmm_client *tegra_iovmm_alloc_client(
+ struct device *dev, const char *share_group,
+ struct miscdevice *misc_dev)
+{
+ return __tegra_iovmm_alloc_client(dev_name(dev), share_group, misc_dev);
+}
+
size_t tegra_iovmm_get_vm_size(struct tegra_iovmm_client *client);
void tegra_iovmm_free_client(struct tegra_iovmm_client *client);
@@ -220,7 +248,8 @@ int tegra_iovmm_unregister(struct tegra_iovmm_device *dev);
#else /* CONFIG_TEGRA_IOVMM */
static inline struct tegra_iovmm_client *tegra_iovmm_alloc_client(
- const char *name, const char *share_group, struct miscdevice *misc_dev)
+ struct device *dev, const char *share_group,
+ struct miscdevice *misc_dev)
{
return NULL;
}
@@ -319,5 +348,37 @@ static inline void tegra_iovmm_resume(void)
{
}
+#ifdef CONFIG_IOMMU_API
+/*
+ * Replace tegra_iovmm_*() with tegra_iommu_*() helpers
+ */
+#include <linux/dma-mapping.h>
+#include <linux/dma-direction.h>
+
+#include <asm/dma-iommu.h>
+
+#define tegra_iovmm_alloc_client(d, s, m) tegra_iommu_alloc_client(d)
+#define tegra_iovmm_free_client(c) tegra_iommu_free_client(c)
+
+#define tegra_iovmm_create_vm(c, o, s, a, p, i) \
+ tegra_iommu_create_vm((c)->dev, i, s, p)
+#define tegra_iovmm_free_vm(v) tegra_iommu_free_vm(v)
+
+#define tegra_iovmm_get_vm_size(c) arm_iommu_iova_avail((c)->dev)
+#define tegra_iovmm_get_max_free(c) arm_iommu_iova_max_free((c)->dev)
+
+#define tegra_iovmm_vm_insert_pfn(a, v, n) \
+ dma_map_page_at((a)->dev, pfn_to_page(n), v, 0, PAGE_SIZE, DMA_NONE);
+
+struct tegra_iovmm_area *tegra_iommu_create_vm(struct device *dev,
+ dma_addr_t req, size_t size, pgprot_t prot);
+
+void tegra_iommu_free_vm(struct tegra_iovmm_area *area);
+
+struct tegra_iovmm_client *tegra_iommu_alloc_client(struct device *dev);
+
+void tegra_iommu_free_client(struct tegra_iovmm_client *client);
+
+#endif /* CONFIG_IOMMU_API */
#endif /* CONFIG_TEGRA_IOVMM */
#endif /* _MACH_TEGRA_IOVMM_H_*/
diff --git a/arch/arm/mach-tegra/include/mach/latency_allowance.h b/arch/arm/mach-tegra/include/mach/latency_allowance.h
index f0d27f0b8ba9..8644075a88b3 100644
--- a/arch/arm/mach-tegra/include/mach/latency_allowance.h
+++ b/arch/arm/mach-tegra/include/mach/latency_allowance.h
@@ -1,7 +1,7 @@
/*
* arch/arm/mach-tegra/include/mach/latency_allowance.h
*
- * Copyright (C) 2011, NVIDIA Corporation.
+ * Copyright (C) 2011-2012 NVIDIA Corporation.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
@@ -104,7 +104,7 @@ static inline int tegra_enable_latency_scaling(enum tegra_la_id id,
static inline void tegra_disable_latency_scaling(enum tegra_la_id id)
{
- return 0;
+ return;
}
#else
int tegra_set_latency_allowance(enum tegra_la_id id,
diff --git a/arch/arm/mach-tegra/include/mach/legacy_irq.h b/arch/arm/mach-tegra/include/mach/legacy_irq.h
index 86f1ff7d06b0..3cd2d82c342f 100644
--- a/arch/arm/mach-tegra/include/mach/legacy_irq.h
+++ b/arch/arm/mach-tegra/include/mach/legacy_irq.h
@@ -19,5 +19,7 @@
#define _ARCH_ARM_MACH_TEGRA_LEGARY_IRQ_H
void tegra_init_legacy_irq_cop(void);
+/* lp1 wake interrupts enabled or disabled using this API */
+int tegra_update_lp1_irq_wake(unsigned int irq, bool enable);
#endif
diff --git a/arch/arm/mach-tegra/include/mach/nvmap.h b/arch/arm/mach-tegra/include/mach/nvmap.h
deleted file mode 100644
index 88f913fc29dd..000000000000
--- a/arch/arm/mach-tegra/include/mach/nvmap.h
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * arch/arm/mach-tegra/include/mach/nvmap.h
- *
- * structure declarations for nvmem and nvmap user-space ioctls
- *
- * Copyright (c) 2009-2011, NVIDIA Corporation.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include <linux/ioctl.h>
-#include <linux/file.h>
-#include <linux/rbtree.h>
-
-#if !defined(__KERNEL__)
-#define __user
-#endif
-
-#ifndef __NVMAP_H
-#define __NVMAP_H
-
-#define NVMAP_HEAP_SYSMEM (1ul<<31)
-#define NVMAP_HEAP_IOVMM (1ul<<30)
-
-/* common carveout heaps */
-#define NVMAP_HEAP_CARVEOUT_IRAM (1ul<<29)
-#define NVMAP_HEAP_CARVEOUT_VPR (1ul<<28)
-#define NVMAP_HEAP_CARVEOUT_GENERIC (1ul<<0)
-
-#define NVMAP_HEAP_CARVEOUT_MASK (NVMAP_HEAP_IOVMM - 1)
-
-/* allocation flags */
-#define NVMAP_HANDLE_UNCACHEABLE (0x0ul << 0)
-#define NVMAP_HANDLE_WRITE_COMBINE (0x1ul << 0)
-#define NVMAP_HANDLE_INNER_CACHEABLE (0x2ul << 0)
-#define NVMAP_HANDLE_CACHEABLE (0x3ul << 0)
-#define NVMAP_HANDLE_CACHE_FLAG (0x3ul << 0)
-
-#define NVMAP_HANDLE_SECURE (0x1ul << 2)
-
-
-#if defined(__KERNEL__)
-
-#if defined(CONFIG_TEGRA_NVMAP)
-struct nvmap_handle;
-struct nvmap_client;
-struct nvmap_device;
-#define nvmap_ref_to_handle(_ref) (*(struct nvmap_handle **)(_ref))
-/* Convert User space handle to Kernel. */
-#define nvmap_convert_handle_u2k(h) (h)
-#elif defined(CONFIG_ION_TEGRA)
-/* For Ion Mem Manager support through nvmap_* API's. */
-#include "../../../../../drivers/gpu/ion/ion_priv.h"
-
-#define nvmap_client ion_client
-#define nvmap_device ion_device
-#define nvmap_handle ion_handle
-#define nvmap_handle_ref ion_handle
-#define nvmap_ref_to_handle(_ref) (struct ion_handle *)_ref
-/* Convert User space handle to Kernel. */
-#define nvmap_convert_handle_u2k(h) ({ \
- if ((u32)h >= TASK_SIZE) { \
- pr_err("Invalid user space handle."); \
- BUG(); \
- } \
- (*((u32 *)h)); })
-#endif
-
-#define nvmap_id_to_handle(_id) ((struct nvmap_handle *)(_id))
-
-
-struct nvmap_pinarray_elem {
- __u32 patch_mem;
- __u32 patch_offset;
- __u32 pin_mem;
- __u32 pin_offset;
- __u32 reloc_shift;
-};
-
-#if defined(CONFIG_TEGRA_NVMAP)
-/* handle_ref objects are client-local references to an nvmap_handle;
- * they are distinct objects so that handles can be unpinned and
- * unreferenced the correct number of times when a client abnormally
- * terminates */
-struct nvmap_handle_ref {
- struct nvmap_handle *handle;
- struct rb_node node;
- atomic_t dupes; /* number of times to free on file close */
- atomic_t pin; /* number of times to unpin on free */
-};
-#endif
-
-struct nvmap_client *nvmap_create_client(struct nvmap_device *dev,
- const char *name);
-
-struct nvmap_handle_ref *nvmap_alloc(struct nvmap_client *client, size_t size,
- size_t align, unsigned int flags,
- unsigned int heap_mask);
-
-void nvmap_free(struct nvmap_client *client, struct nvmap_handle_ref *r);
-
-void *nvmap_mmap(struct nvmap_handle_ref *r);
-
-void nvmap_munmap(struct nvmap_handle_ref *r, void *addr);
-
-struct nvmap_client *nvmap_client_get_file(int fd);
-
-struct nvmap_client *nvmap_client_get(struct nvmap_client *client);
-
-void nvmap_client_put(struct nvmap_client *c);
-
-phys_addr_t nvmap_pin(struct nvmap_client *c, struct nvmap_handle_ref *r);
-
-phys_addr_t nvmap_handle_address(struct nvmap_client *c, unsigned long id);
-
-void nvmap_unpin(struct nvmap_client *client, struct nvmap_handle_ref *r);
-
-int nvmap_pin_array(struct nvmap_client *client, struct nvmap_handle *gather,
- const struct nvmap_pinarray_elem *arr, int nr,
- struct nvmap_handle **unique);
-
-void nvmap_unpin_handles(struct nvmap_client *client,
- struct nvmap_handle **h, int nr);
-
-int nvmap_patch_word(struct nvmap_client *client,
- struct nvmap_handle *patch,
- u32 patch_offset, u32 patch_value);
-
-struct nvmap_platform_carveout {
- const char *name;
- unsigned int usage_mask;
- phys_addr_t base;
- size_t size;
- size_t buddy_size;
-};
-
-struct nvmap_platform_data {
- const struct nvmap_platform_carveout *carveouts;
- unsigned int nr_carveouts;
-};
-
-extern struct nvmap_device *nvmap_dev;
-
-#endif
-
-#endif
diff --git a/arch/arm/mach-tegra/include/mach/sdhci.h b/arch/arm/mach-tegra/include/mach/sdhci.h
index b48a92887070..e307506eb40b 100644
--- a/arch/arm/mach-tegra/include/mach/sdhci.h
+++ b/arch/arm/mach-tegra/include/mach/sdhci.h
@@ -20,6 +20,14 @@
#include <linux/mmc/host.h>
#include <asm/mach/mmc.h>
+/*
+ * MMC_OCR_1V8_MASK will be used in board sdhci file
+ * Example for cardhu it will be used in board-cardhu-sdhci.c
+ * for built_in = 0 devices enabling ocr_mask to MMC_OCR_1V8_MASK
+ * sets the voltage to 1.8V
+ */
+#define MMC_OCR_1V8_MASK 0x8
+
struct tegra_sdhci_platform_data {
int cd_gpio;
int wp_gpio;
@@ -28,6 +36,7 @@ struct tegra_sdhci_platform_data {
int pm_flags;
int pm_caps;
unsigned int max_clk_limit;
+ unsigned int ddr_clk_limit;
unsigned int tap_delay;
struct mmc_platform_data mmc_data;
};
diff --git a/arch/arm/mach-tegra/include/mach/tegra_p1852_pdata.h b/arch/arm/mach-tegra/include/mach/tegra_p1852_pdata.h
index bfd61c460051..501d815b881b 100644
--- a/arch/arm/mach-tegra/include/mach/tegra_p1852_pdata.h
+++ b/arch/arm/mach-tegra/include/mach/tegra_p1852_pdata.h
@@ -35,8 +35,15 @@ struct codec_info_s {
char *cpu_dai_name;
char *codec_name; /* Name of the Codec Driver */
char *name; /* Name of the Codec-Dai-Link */
+ char *pcm_driver; /* Name of the PCM driver */
enum i2s_data_format i2s_format;
int master; /* Codec is Master or Slave */
+ /* TDM format setttings */
+ int num_slots; /* Number of TDM slots */
+ int slot_width; /* Width of each slot */
+ int rx_mask; /* Number of Rx Enabled slots */
+ int tx_mask; /* Number of Tx Enabled slots */
+
};
struct tegra_p1852_platform_data {
diff --git a/arch/arm/mach-tegra/include/mach/tegra_usb_modem_power.h b/arch/arm/mach-tegra/include/mach/tegra_usb_modem_power.h
index 0ce7fa40eb2e..210b9f61ecb5 100644
--- a/arch/arm/mach-tegra/include/mach/tegra_usb_modem_power.h
+++ b/arch/arm/mach-tegra/include/mach/tegra_usb_modem_power.h
@@ -1,7 +1,7 @@
/*
* arch/arm/mach-tegra/include/mach/tegra_usb_modem_power.c
*
- * Copyright (c) 2011, NVIDIA Corporation.
+ * Copyright (c) 2011-2012, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -40,8 +40,14 @@ struct tegra_modem_operations {
/* tegra usb modem power platform data */
struct tegra_usb_modem_power_platform_data {
const struct tegra_modem_operations *ops;
- unsigned int wake_gpio; /* remote wakeup gpio */
- unsigned int flags; /* remote wakeup irq flags */
+ unsigned int wake_gpio; /* remote wakeup gpio */
+ unsigned long wake_irq_flags; /* remote wakeup irq flags */
+ unsigned int boot_gpio; /* modem boot gpio */
+ unsigned long boot_irq_flags; /* modem boot irq flags */
+ int autosuspend_delay; /* autosuspend delay in milliseconds */
+ int short_autosuspend_delay; /* short autosuspend delay in ms */
+ const struct platform_device *tegra_ehci_device;
+ const struct tegra_usb_platform_data *tegra_ehci_pdata;
};
#endif /* __MACH_TEGRA_USB_MODEM_POWER_H */
diff --git a/arch/arm/mach-tegra/include/mach/thermal.h b/arch/arm/mach-tegra/include/mach/thermal.h
index ab7b34492d9e..ed71d0340a96 100644
--- a/arch/arm/mach-tegra/include/mach/thermal.h
+++ b/arch/arm/mach-tegra/include/mach/thermal.h
@@ -1,7 +1,7 @@
/*
* arch/arm/mach-tegra/thermal.h
*
- * Copyright (C) 2010-2011 NVIDIA Corporation.
+ * Copyright (C) 2010-2012 NVIDIA Corporation.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
@@ -17,26 +17,62 @@
#ifndef __MACH_THERMAL_H
#define __MACH_THERMAL_H
+#include <linux/therm_est.h>
+
+enum thermal_device_id {
+ THERMAL_DEVICE_ID_NULL = 0x0,
+ THERMAL_DEVICE_ID_NCT_EXT = 0x1,
+ THERMAL_DEVICE_ID_NCT_INT = 0x2,
+ THERMAL_DEVICE_ID_TSENSOR = 0x4,
+ THERMAL_DEVICE_ID_SKIN = 0x8,
+};
+
+#define THERMAL_DEVICE_MAX (4)
+
+enum balanced_throttle_id {
+ BALANCED_THROTTLE_ID_TJ,
+ BALANCED_THROTTLE_ID_SKIN,
+};
+
+struct skin_therm_est_subdevice {
+ enum thermal_device_id id;
+ long coeffs[HIST_LEN];
+};
+
/* All units in millicelsius */
struct tegra_thermal_data {
- long temp_throttle;
+ enum thermal_device_id shutdown_device_id;
long temp_shutdown;
- long temp_offset;
+#if defined(CONFIG_TEGRA_EDP_LIMITS) || defined(CONFIG_TEGRA_THERMAL_THROTTLE)
+ enum thermal_device_id throttle_edp_device_id;
+#endif
#ifdef CONFIG_TEGRA_EDP_LIMITS
long edp_offset;
long hysteresis_edp;
#endif
-#ifdef CONFIG_TEGRA_THERMAL_SYSFS
+#ifdef CONFIG_TEGRA_THERMAL_THROTTLE
+ long temp_throttle;
int tc1;
int tc2;
long passive_delay;
-#else
- long hysteresis_throttle;
+#endif
+#ifdef CONFIG_TEGRA_SKIN_THROTTLE
+ enum thermal_device_id skin_device_id;
+ long temp_throttle_skin;
+ int tc1_skin;
+ int tc2_skin;
+ int passive_delay_skin;
+
+ long skin_temp_offset;
+ long skin_period;
+ int skin_devs_size;
+ struct skin_therm_est_subdevice skin_devs[];
#endif
};
struct tegra_thermal_device {
char *name;
+ enum thermal_device_id id;
void *data;
long offset;
int (*get_temp) (void *, long *);
@@ -44,16 +80,51 @@ struct tegra_thermal_device {
int (*set_limits) (void *, long, long);
int (*set_alert)(void *, void (*)(void *), void *);
int (*set_shutdown_temp)(void *, long);
+#ifdef CONFIG_TEGRA_THERMAL_THROTTLE
+ struct thermal_zone_device *thz;
+#endif
+ struct list_head node;
+};
+
+struct throttle_table {
+ unsigned int cpu_freq;
+ int core_cap_level;
};
+#define MAX_THROT_TABLE_SIZE (32)
+
+struct balanced_throttle {
+ enum balanced_throttle_id id;
+
+ int is_throttling;
+ int throttle_index;
+ struct thermal_cooling_device *cdev;
+
+ struct list_head node;
+
+ int throt_tab_size;
+ struct throttle_table throt_tab[MAX_THROT_TABLE_SIZE];
+};
+
+#ifdef CONFIG_TEGRA_THERMAL_THROTTLE
+int balanced_throttle_register(struct balanced_throttle *bthrot);
+#else
+static inline int balanced_throttle_register(struct balanced_throttle *bthrot)
+{ return 0; }
+#endif
+
#ifndef CONFIG_ARCH_TEGRA_2x_SOC
-int tegra_thermal_init(struct tegra_thermal_data *data);
-int tegra_thermal_set_device(struct tegra_thermal_device *device);
+int tegra_thermal_init(struct tegra_thermal_data *data,
+ struct balanced_throttle *throttle_list,
+ int throttle_list_size);
+int tegra_thermal_device_register(struct tegra_thermal_device *device);
int tegra_thermal_exit(void);
#else
-static inline int tegra_thermal_init(struct tegra_thermal_data *data)
+static inline int tegra_thermal_init(struct tegra_thermal_data *data,
+ struct balanced_throttle throttle_list,
+ int throttle_list_size);
{ return 0; }
-static inline int tegra_thermal_set_device(struct tegra_thermal_device *dev)
+static int tegra_thermal_device_register(struct tegra_thermal_device *device)
{ return 0; }
static inline int tegra_thermal_exit(void)
{ return 0; }
diff --git a/arch/arm/mach-tegra/include/mach/usb_phy.h b/arch/arm/mach-tegra/include/mach/usb_phy.h
index 46fe8c84a2f3..c721642c4417 100644
--- a/arch/arm/mach-tegra/include/mach/usb_phy.h
+++ b/arch/arm/mach-tegra/include/mach/usb_phy.h
@@ -18,151 +18,120 @@
#ifndef __MACH_USB_PHY_H
#define __MACH_USB_PHY_H
-#include <linux/clk.h>
-#include <linux/regulator/consumer.h>
-#include <linux/usb/otg.h>
-#include <linux/platform_data/tegra_usb.h>
-
-struct tegra_utmip_config {
- u8 hssync_start_delay;
- u8 elastic_limit;
- u8 idle_wait_delay;
- u8 term_range_adj;
- u8 xcvr_setup;
- signed char xcvr_setup_offset;
- u8 xcvr_use_fuses;
- u8 xcvr_lsfslew;
- u8 xcvr_lsrslew;
-};
-
-struct tegra_ulpi_trimmer {
- u8 shadow_clk_delay; /* 0 ~ 31 */
- u8 clock_out_delay; /* 0 ~ 31 */
- u8 data_trimmer; /* 0 ~ 7 */
- u8 stpdirnxt_trimmer; /* 0 ~ 7 */
-};
-
-struct tegra_ulpi_config {
- int enable_gpio;
- int reset_gpio;
- const char *clk;
- const struct tegra_ulpi_trimmer *trimmer;
- int (*pre_phy_on)(void);
- int (*post_phy_on)(void);
- int (*pre_phy_off)(void);
- int (*post_phy_off)(void);
- void (*phy_restore_start)(void);
- void (*phy_restore_end)(void);
- int phy_restore_gpio; /* null phy restore ack from device */
- int ulpi_dir_gpio; /* ulpi dir */
- int ulpi_d0_gpio; /* usb linestate[0] */
- int ulpi_d1_gpio; /* usb linestate[1] */
-};
-
-struct tegra_uhsic_config {
- int enable_gpio;
- int reset_gpio;
- u8 sync_start_delay;
- u8 idle_wait_delay;
- u8 term_range_adj;
- u8 elastic_underrun_limit;
- u8 elastic_overrun_limit;
- int (*postsuspend)(void);
- int (*preresume)(void);
- int (*usb_phy_ready)(void);
- int (*post_phy_off)(void);
-};
-
-enum tegra_usb_phy_port_speed {
- TEGRA_USB_PHY_PORT_SPEED_FULL = 0,
- TEGRA_USB_PHY_PORT_SPEED_LOW,
- TEGRA_USB_PHY_PORT_SPEED_HIGH,
-};
-
-enum tegra_usb_phy_mode {
- TEGRA_USB_PHY_MODE_DEVICE,
- TEGRA_USB_PHY_MODE_HOST,
-};
-
-struct usb_phy_plat_data {
- int instance;
- int vbus_irq;
- int vbus_gpio;
- int vbus_gpio_inverted;
- char * vbus_reg_supply;
-};
-
-struct tegra_xtal_freq;
-
-struct tegra_usb_phy {
- int instance;
- const struct tegra_xtal_freq *freq;
- void __iomem *regs;
- void __iomem *pad_regs;
- struct clk *clk;
- struct clk *pll_u;
- struct clk *pad_clk;
- enum tegra_usb_phy_mode mode;
- void *config;
- struct regulator *reg_vdd;
- struct regulator *reg_vbus;
- enum tegra_usb_phy_type usb_phy_type;
- bool regulator_on;
- struct otg_transceiver *ulpi;
- int initialized;
- bool power_on;
- bool remote_wakeup;
- int hotplug;
- unsigned int xcvr_setup_value;
-};
-
-typedef int (*tegra_phy_fp)(struct tegra_usb_phy *phy, bool is_dpd);
-typedef void (*tegra_phy_restore_start_fp)(struct tegra_usb_phy *phy,
- enum tegra_usb_phy_port_speed);
-typedef void (*tegra_phy_restore_end_fp)(struct tegra_usb_phy *phy);
-
-struct tegra_usb_phy *tegra_usb_phy_open(int instance, void __iomem *regs,
- void *config, enum tegra_usb_phy_mode phy_mode,
- enum tegra_usb_phy_type usb_phy_type);
-
-int tegra_usb_phy_power_on(struct tegra_usb_phy *phy, bool is_dpd);
-
-void tegra_usb_phy_clk_disable(struct tegra_usb_phy *phy);
-
-void tegra_usb_phy_clk_enable(struct tegra_usb_phy *phy);
-
-void tegra_usb_phy_power_off(struct tegra_usb_phy *phy, bool is_dpd);
-
-void tegra_usb_phy_postsuspend(struct tegra_usb_phy *phy, bool is_dpd);
-
-void tegra_usb_phy_preresume(struct tegra_usb_phy *phy, bool is_dpd);
-
-void tegra_usb_phy_postresume(struct tegra_usb_phy *phy, bool is_dpd);
-
-void tegra_ehci_pre_reset(struct tegra_usb_phy *phy, bool is_dpd);
-
-void tegra_ehci_post_reset(struct tegra_usb_phy *phy, bool is_dpd);
-
-void tegra_ehci_phy_restore_start(struct tegra_usb_phy *phy,
- enum tegra_usb_phy_port_speed port_speed);
-
-void tegra_ehci_phy_restore_end(struct tegra_usb_phy *phy);
+/**
+ * Tegra USB phy opaque handle
+ */
+struct tegra_usb_phy;
+
+/**
+ * Opens the usb phy associated to the USB platform device
+ * tegra usb phy open must be called before accessing any phy APIs
+ */
+struct tegra_usb_phy *tegra_usb_phy_open(struct platform_device *pdev);
+/**
+ * Closes the phy controller and its resources
+ */
void tegra_usb_phy_close(struct tegra_usb_phy *phy);
-int tegra_usb_phy_bus_connect(struct tegra_usb_phy *phy);
+/**
+ * Handles interrupts specific to the phy interface
+ * Note: udc or ehci driver will handle the controller interrupts
+ */
+int tegra_usb_phy_irq(struct tegra_usb_phy *phy);
+
+/**
+ * Initializes the phy specific functions after phy is power on
+ */
+int tegra_usb_phy_init(struct tegra_usb_phy *phy);
+
+/**
+ * Handles phy interface specific functionality after driver reset
+ */
+int tegra_usb_phy_reset(struct tegra_usb_phy *phy);
+
+/**
+ * Handles phy interface specific functionality before driver suspend
+ * Also, handles platform specific pre suspend functions
+ */
+int tegra_usb_phy_pre_suspend(struct tegra_usb_phy *phy);
+
+/**
+ * Handles phy interface specific suspend functionality
+ */
+int tegra_usb_phy_suspend(struct tegra_usb_phy *phy);
+
+/**
+ * Handles phy interface specific functionality after driver suspend
+ */
+int tegra_usb_phy_post_suspend(struct tegra_usb_phy *phy);
+
+/**
+ * Handles phy interface specific functionality before driver resume
+ * Also, handles platform specific pre resume functions
+ */
+int tegra_usb_phy_pre_resume(struct tegra_usb_phy *phy, bool remote_wakeup);
+
+/**
+ * Handles phy interface specific resume functionality
+ */
+int tegra_usb_phy_resume(struct tegra_usb_phy *phy);
+/**
+ * Handles phy interface specific functionality after driver resume
+ */
+int tegra_usb_phy_post_resume(struct tegra_usb_phy *phy);
+
+/**
+ * Handles phy interface specific functionality during port power on
+ */
+int tegra_usb_phy_port_power(struct tegra_usb_phy *phy);
+
+/**
+ * Handles phy interface specific functionality during bus reset
+ */
int tegra_usb_phy_bus_reset(struct tegra_usb_phy *phy);
-int tegra_usb_phy_bus_idle(struct tegra_usb_phy *phy);
+/**
+ * Handles phy interface specific functionality for turning off the phy to
+ * put the phy in low power mode
+ */
+int tegra_usb_phy_power_off(struct tegra_usb_phy *phy);
-bool tegra_usb_phy_is_device_connected(struct tegra_usb_phy *phy);
+/**
+ * Handles phy interface specific functionality for turning on the phy to
+ * bring phy out of low power mode
+ */
+int tegra_usb_phy_power_on(struct tegra_usb_phy *phy);
-bool tegra_usb_phy_charger_detect(struct tegra_usb_phy *phy);
+/**
+ * Indicates whether phy registers are accessible or not
+ * if phy is powered off then returns false else true
+ */
+bool tegra_usb_phy_hw_accessible(struct tegra_usb_phy *phy);
+
+/**
+ * Indicates whether compliance charger is connected or not
+ * if compliance charger is detected then returns true else false
+ */
+bool tegra_usb_phy_charger_detected(struct tegra_usb_phy *phy);
+
+/**
+ * Indicates whether phy resumed due to the remote wake event or not
+ * returns true if remote wake is detected.
+ */
+bool tegra_usb_phy_remote_wakeup(struct tegra_usb_phy *phy);
+
+/**
+ * Indicates controller has HOST PC register set or not
+ */
+bool tegra_usb_phy_has_hostpc(struct tegra_usb_phy *phy);
-int __init tegra_usb_phy_init(struct usb_phy_plat_data *pdata, int size);
+/**
+ * Indicates controller port supports OTG or not
+ */
+bool tegra_usb_phy_otg_supported(struct tegra_usb_phy *phy);
-bool tegra_usb_phy_is_remotewake_detected(struct tegra_usb_phy *phy);
void tegra_usb_phy_memory_prefetch_on(struct tegra_usb_phy *phy);