Re: [PATCH] OMAPDSS: HDMI: hot plug detect fix
On Mon, 2012-02-20 at 15:03 -0600, Rob Clark wrote: From: Rob Clark r...@ti.com The OMAPDSS: HDMI: PHY burnout fix commit switched the HDMI driver over to using a GPIO for plug detect. Unfortunately the -detect() method was not also updated, causing HDMI to no longer work for the omapdrm driver (because it would actually check if a connection was detected before attempting to enable display). Thanks, I totally missed that. Tomi signature.asc Description: This is a digitally signed message part
[PATCH] OMAPDSS: HDMI: Move Avi-infoframe struct to hdmi_ip_data
From: Mythri P K mythr...@ti.com With AVI infoframe various parameters of video stream such as aspect ratio, quantization range, videocode etc will be indicated from source to sink.Thus AVI information needs to be set/accessed by the middle ware based on the video content. Thus this parameter is now moved to the ip_data structure. Signed-off-by: Mythri P K mythr...@ti.com --- drivers/video/omap2/dss/ti_hdmi.h | 42 + drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c |8 +++--- drivers/video/omap2/dss/ti_hdmi_4xxx_ip.h | 40 --- 3 files changed, 46 insertions(+), 44 deletions(-) diff --git a/drivers/video/omap2/dss/ti_hdmi.h b/drivers/video/omap2/dss/ti_hdmi.h index 26ec6d1..46e776c 100644 --- a/drivers/video/omap2/dss/ti_hdmi.h +++ b/drivers/video/omap2/dss/ti_hdmi.h @@ -113,6 +113,47 @@ struct ti_hdmi_ip_ops { }; +/* + * Refer to section 8.2 in HDMI 1.3 specification for + * details about infoframe databytes + */ +struct hdmi_core_infoframe_avi { + /* Y0, Y1 rgb,yCbCr */ + u8 db1_format; + /* A0 Active information Present */ + u8 db1_active_info; + /* B0, B1 Bar info data valid */ + u8 db1_bar_info_dv; + /* S0, S1 scan information */ + u8 db1_scan_info; + /* C0, C1 colorimetry */ + u8 db2_colorimetry; + /* M0, M1 Aspect ratio (4:3, 16:9) */ + u8 db2_aspect_ratio; + /* R0...R3 Active format aspect ratio */ + u8 db2_active_fmt_ar; + /* ITC IT content. */ + u8 db3_itc; + /* EC0, EC1, EC2 Extended colorimetry */ + u8 db3_ec; + /* Q1, Q0 Quantization range */ + u8 db3_q_range; + /* SC1, SC0 Non-uniform picture scaling */ + u8 db3_nup_scaling; + /* VIC0..6 Video format identification */ + u8 db4_videocode; + /* PR0..PR3 Pixel repetition factor */ + u8 db5_pixel_repeat; + /* Line number end of top bar */ + u16 db6_7_line_eoftop; + /* Line number start of bottom bar */ + u16 db8_9_line_sofbottom; + /* Pixel number end of left bar */ + u16 db10_11_pixel_eofleft; + /* Pixel number start of right bar */ + u16 db12_13_pixel_sofright; +}; + struct hdmi_ip_data { void __iomem*base_wp; /* HDMI wrapper */ unsigned long core_sys_offset; @@ -122,6 +163,7 @@ struct hdmi_ip_data { const struct ti_hdmi_ip_ops *ops; struct hdmi_config cfg; struct hdmi_pll_info pll_data; + struct hdmi_core_infoframe_avi avi_cfg; }; int ti_hdmi_4xxx_phy_enable(struct hdmi_ip_data *ip_data); void ti_hdmi_4xxx_phy_disable(struct hdmi_ip_data *ip_data); diff --git a/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c b/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c index 9bbf961..6f93271 100644 --- a/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c +++ b/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c @@ -534,12 +534,12 @@ static void hdmi_core_video_config(struct hdmi_ip_data *ip_data, HDMI_CORE_SYS_TMDS_CTRL, cfg-tclk_sel_clkmult, 6, 5); } -static void hdmi_core_aux_infoframe_avi_config(struct hdmi_ip_data *ip_data, - struct hdmi_core_infoframe_avi info_avi) +static void hdmi_core_aux_infoframe_avi_config(struct hdmi_ip_data *ip_data) { u32 val; char sum = 0, checksum = 0; void __iomem *av_base = hdmi_av_base(ip_data); + struct hdmi_core_infoframe_avi info_avi = ip_data-avi_cfg; sum += 0x82 + 0x002 + 0x00D; hdmi_write_reg(av_base, HDMI_CORE_AV_AVI_TYPE, 0x082); @@ -718,7 +718,7 @@ void ti_hdmi_4xxx_basic_configure(struct hdmi_ip_data *ip_data) struct omap_video_timings video_timing; struct hdmi_video_format video_format; /* HDMI core */ - struct hdmi_core_infoframe_avi avi_cfg; + struct hdmi_core_infoframe_avi avi_cfg = ip_data-avi_cfg; struct hdmi_core_video_config v_core_cfg; struct hdmi_core_packet_enable_repeat repeat_cfg; struct hdmi_config *cfg = ip_data-cfg; @@ -780,7 +780,7 @@ void ti_hdmi_4xxx_basic_configure(struct hdmi_ip_data *ip_data) avi_cfg.db10_11_pixel_eofleft = 0; avi_cfg.db12_13_pixel_sofright = 0; - hdmi_core_aux_infoframe_avi_config(ip_data, avi_cfg); + hdmi_core_aux_infoframe_avi_config(ip_data); /* enable/repeat the infoframe */ repeat_cfg.avi_infoframe = HDMI_PACKETENABLE; diff --git a/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.h b/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.h index 004b418..a14d1a0 100644 --- a/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.h +++ b/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.h @@ -450,46 +450,6 @@ struct hdmi_core_video_config { * Refer to section 8.2 in HDMI 1.3 specification for * details about infoframe databytes */ -struct hdmi_core_infoframe_avi { - /* Y0, Y1 rgb,yCbCr */ - u8 db1_format; -
Re: [PATCH] OMAPDSS: HDMI: Move Avi-infoframe struct to hdmi_ip_data
On Tue, 2012-02-21 at 13:52 +0530, mythr...@ti.com wrote: From: Mythri P K mythr...@ti.com With AVI infoframe various parameters of video stream such as aspect ratio, quantization range, videocode etc will be indicated from source to sink.Thus AVI information needs to be set/accessed by the middle ware based on the video content. Thus this parameter is now moved to the ip_data structure. Signed-off-by: Mythri P K mythr...@ti.com I have already applied this patch. Have you made some new changes to it? Tomi signature.asc Description: This is a digitally signed message part
Re: SMP local timers and their CPUfreq notifiers setup on OMAP3
On Fri, Feb 17, 2012 at 05:58:34PM +0530, Santosh Shilimkar wrote: diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c index 4285daa..9834851 100644 --- a/arch/arm/kernel/smp_twd.c +++ b/arch/arm/kernel/smp_twd.c @@ -129,7 +129,7 @@ static struct notifier_block twd_cpufreq_nb = { static int twd_cpufreq_init(void) { - if (!IS_ERR(twd_clk)) + if (twd_evt *__this_cpu_ptr(twd_evt) !IS_ERR(twd_clk)) You seem to have an additional space before 'if'. -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: SMP local timers and their CPUfreq notifiers setup on OMAP3
On Tue, Feb 21, 2012 at 2:41 PM, Russell King - ARM Linux li...@arm.linux.org.uk wrote: On Fri, Feb 17, 2012 at 05:58:34PM +0530, Santosh Shilimkar wrote: diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c index 4285daa..9834851 100644 --- a/arch/arm/kernel/smp_twd.c +++ b/arch/arm/kernel/smp_twd.c @@ -129,7 +129,7 @@ static struct notifier_block twd_cpufreq_nb = { static int twd_cpufreq_init(void) { - if (!IS_ERR(twd_clk)) + if (twd_evt *__this_cpu_ptr(twd_evt) !IS_ERR(twd_clk)) You seem to have an additional space before 'if'. Yep. Fixed in the updated version in patch system. patch 7336/1 Regards Santosh -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v3 0/3] MFD: twl6040: Conversion to i2c driver
Hi Samuel, On 02/20/2012 09:47 PM, Samuel Ortiz wrote: Hi Peter, On Fri, Feb 10, 2012 at 12:00:15PM +0200, Peter Ujfalusi wrote: Hello, Changes since v2: - soc/codec/Kconfig: make twl6040 depend on I2C - Regulator related patches has been removed (to be sent as separate series) I applied all 3 patches. Patch #2 did not apply cleanly, due to the fact that several struct twl4030_codec_data omap4panda.c references are not upstream yet. This is my .rej: The Panda audio support is going via sound tree. It is in linux-next already for couple of weeks now. The reason you have this reject is that you don't have the audio support for Panda series, and a such upstream does not have it either :( It is for 3.4 also. --- arch/arm/mach-omap2/board-omap4panda.c +++ arch/arm/mach-omap2/board-omap4panda.c @@ -278,7 +279,7 @@ return 0; } -static struct twl4030_codec_data twl6040_codec = { +static struct twl6040_codec_data twl6040_codec = { /* single-step ramp for headset and handsfree */ .hs_left_step = 0x0f, .hs_right_step = 0x0f, @@ -286,17 +287,14 @@ .hf_right_step = 0x1d, }; -static struct twl4030_audio_data twl6040_audio = { +static struct twl6040_platform_data twl6040_data = { .codec = twl6040_codec, .audpwron_gpio = 127, - .naudint_irq= OMAP44XX_IRQ_SYS_2N, .irq_base = TWL6040_CODEC_IRQ_BASE, }; /* Panda board uses the common PMIC configuration */ -static struct twl4030_platform_data omap4_panda_twldata = { - .audio = twl6040_audio, -}; +static struct twl4030_platform_data omap4_panda_twldata; I'm not sure hwo we could handle that properly. Either by letting Tony carrying this patchset, or by sending me the panda patch that adds those structures. As you prefer. If Liam would take this series that would be probably the way forward. If he does not have objections. Liam: I can create a branch for you to pull from as soon as all other patch receives the needed acks... Samuel: if Liam agrees is it possible for you to drop the twl6040 related patches from your for-next branch? Thank you, Péter -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v3 0/3] MFD: twl6040: Conversion to i2c driver
Hi Peter, On Tue, Feb 21, 2012 at 12:33:07PM +0200, Peter Ujfalusi wrote: I'm not sure hwo we could handle that properly. Either by letting Tony carrying this patchset, or by sending me the panda patch that adds those structures. As you prefer. If Liam would take this series that would be probably the way forward. If he does not have objections. Liam: I can create a branch for you to pull from as soon as all other patch receives the needed acks... Samuel: if Liam agrees is it possible for you to drop the twl6040 related patches from your for-next branch? That would make sense to me, yes. Liam, if you're ok with taking it, please add my: Acked-by: Samuel Ortiz sa...@linux.intel.com to this patchset. Cheers, Samuel. -- Intel Open Source Technology Centre http://oss.intel.com/ -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] OMAPDSS: HDMI: Move Avi-infoframe struct to hdmi_ip_data
On Tue, Feb 21, 2012 at 2:10 PM, Tomi Valkeinen tomi.valkei...@ti.com wrote: On Tue, 2012-02-21 at 13:52 +0530, mythr...@ti.com wrote: From: Mythri P K mythr...@ti.com With AVI infoframe various parameters of video stream such as aspect ratio, quantization range, videocode etc will be indicated from source to sink.Thus AVI information needs to be set/accessed by the middle ware based on the video content. Thus this parameter is now moved to the ip_data structure. Signed-off-by: Mythri P K mythr...@ti.com I have already applied this patch. Have you made some new changes to it? No, I just did a rebase. Thanks and regards, Mythri. Tomi -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 6/6] mmc: omap_hsmmc: Don't expect MMC1 to always have vmmc supply
On Tue, Feb 21, 2012 at 3:33 PM, Rajendra Nayak rna...@ti.com wrote: MMC1 is not the only instance that can be used/wired for SD. So remove this assumption from the driver. Now that all the mmc id based usage is removed, get rid of all the DEVID defines and also the 'id' field from the omap_hsmmc_host structure. Signed-off-by: Rajendra Nayak rna...@ti.com Tested-by: Venkatraman S svenk...@ti.com Tested-by: Balaji T K balaj...@ti.com For the whole series, Acked-by: Venkatraman S svenk...@ti.com --- drivers/mmc/host/omap_hsmmc.c | 31 ++- 1 files changed, 2 insertions(+), 29 deletions(-) diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 17e264b..e3eb9d4 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -106,17 +106,6 @@ #define SOFTRESET (1 1) #define RESETDONE (1 0) -/* - * FIXME: Most likely all the data using these _DEVID defines should come - * from the platform_data, or implemented in controller and slot specific - * functions. - */ -#define OMAP_MMC1_DEVID 0 -#define OMAP_MMC2_DEVID 1 -#define OMAP_MMC3_DEVID 2 -#define OMAP_MMC4_DEVID 3 -#define OMAP_MMC5_DEVID 4 - #define MMC_AUTOSUSPEND_DELAY 100 #define MMC_TIMEOUT_MS 20 #define OMAP_MMC_MIN_CLOCK 40 @@ -164,7 +153,6 @@ struct omap_hsmmc_host { void __iomem *base; resource_size_t mapbase; spinlock_t irq_lock; /* Prevent races with irq handler */ - unsigned int id; unsigned int dma_len; unsigned int dma_sg_idx; unsigned char bus_mode; @@ -300,7 +288,6 @@ static int omap_hsmmc_set_power(struct device *dev, int slot, int power_on, static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host) { struct regulator *reg; - int ret = 0; int ocr_value = 0; mmc_slot(host).set_power = omap_hsmmc_set_power; @@ -308,15 +295,6 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host) reg = regulator_get(host-dev, vmmc); if (IS_ERR(reg)) { dev_dbg(host-dev, vmmc regulator missing\n); - /* - * HACK: until fixed.c regulator is usable, - * we don't require a main regulator - * for MMC2 or MMC3 - */ - if (host-id == OMAP_MMC1_DEVID) { - ret = PTR_ERR(reg); - goto err; - } } else { host-vcc = reg; ocr_value = mmc_regulator_get_ocrmask(reg); @@ -324,8 +302,8 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host) mmc_slot(host).ocr_mask = ocr_value; } else { if (!(mmc_slot(host).ocr_mask ocr_value)) { - pr_err(MMC%d ocrmask %x is not supported\n, - host-id, mmc_slot(host).ocr_mask); + pr_err(MMC ocrmask %x is not supported\n, + mmc_slot(host).ocr_mask); mmc_slot(host).ocr_mask = 0; return -EINVAL; } @@ -358,10 +336,6 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host) } return 0; - -err: - mmc_slot(host).set_power = NULL; - return ret; } static void omap_hsmmc_reg_put(struct omap_hsmmc_host *host) @@ -1791,7 +1765,6 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev) host-dev-dma_mask = pdata-dma_mask; host-dma_ch = -1; host-irq = irq; - host-id = pdev-id; host-slot_id = 0; host-mapbase = res-start; host-base = ioremap(host-mapbase, SZ_4K); -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 6/6] mmc: omap_hsmmc: Don't expect MMC1 to always have vmmc supply
On Tue, Feb 21, 2012 at 05:43:54PM +0530, S, Venkatraman wrote: On Tue, Feb 21, 2012 at 3:33 PM, Rajendra Nayak rna...@ti.com wrote: @@ -324,8 +302,8 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host) mmc_slot(host).ocr_mask = ocr_value; } else { if (!(mmc_slot(host).ocr_mask ocr_value)) { - pr_err(MMC%d ocrmask %x is not supported\n, - host-id, mmc_slot(host).ocr_mask); + pr_err(MMC ocrmask %x is not supported\n, + mmc_slot(host).ocr_mask); You're dropping the MMC number from these error messages. It would be much better to fix them instead. Use dev_info(mmc_dev(host-mmc), blah rather than pr_err(). Drivers should not be using pr_* unless they really do not have a struct device. -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 6/6] mmc: omap_hsmmc: Don't expect MMC1 to always have vmmc supply
On Tuesday 21 February 2012 05:50 PM, Russell King - ARM Linux wrote: On Tue, Feb 21, 2012 at 05:43:54PM +0530, S, Venkatraman wrote: On Tue, Feb 21, 2012 at 3:33 PM, Rajendra Nayakrna...@ti.com wrote: @@ -324,8 +302,8 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host) mmc_slot(host).ocr_mask = ocr_value; } else { if (!(mmc_slot(host).ocr_mask ocr_value)) { - pr_err(MMC%d ocrmask %x is not supported\n, - host-id, mmc_slot(host).ocr_mask); + pr_err(MMC ocrmask %x is not supported\n, + mmc_slot(host).ocr_mask); You're dropping the MMC number from these error messages. It would be much better to fix them instead. Use dev_info(mmc_dev(host-mmc), blah rather than pr_err(). Thanks for catching this. There are a few other instance of pr_* usage within the driver. I will post a patch to fix all of them. Drivers should not be using pr_* unless they really do not have a struct device. -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCHv5 00/14] arm: omap3: auto-ret / auto-off support
Hi, This set applies on top of the pwrdm / clkdm / voltdm usecounting patch set I sent last week (see: http://www.spinics.net/lists/linux-omap/msg64670.html): Following changes done compared to previous version. - split out the basic usecounting support as its own set (see above) - added lots of new comments to the code, including kerneldoc style function headers - changed pmic-vp_vddmin / vddmax to simply vddmin / vddmax, these are now used as limits for all voltage related operations (both vc / vp), pmic limits are checked against the values defined for the omap chip itself to select proper voltage levels - some other minor fixes proposed for the previous version TBD: - omap4 support (will work with this once retention works for omap4) - pmic script support for omap3 (scaling to 0V level) Tested on omap3 beagle with retention / off, suspend and dynamic idle. Voltage rails for vdd1 (mpu) and vdd2 (core) measured and seen to scale correctly to retention / off voltage levels. -Tero -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCHv5 01/14] arm: OMAP3+: PM: VP: use uV for max and min voltage limits
From: Nishanth Menon n...@ti.com Every PMIC has it's own eccentricities, For example, one of the PMIC has MSB set to 1 for a specific function - voltage enable! using an hardcoded value specific for TWL when copied over to such an implementation causes the system to crash as the MSB bit was 0 and the voltage got disabled!. Instead we use actual values and depend on the convertion routines to abstract out the eccentricities of each PMIC. With this, we can now move the voltages to a common location in voltage.h as they are no longer dependent on PMICs and expect the PMIC's conversion routines to set a cap if the voltage is out of reach for the PMIC. Reported-by: Jon Hunter jon-hun...@ti.com Signed-off-by: Nishanth Menon n...@ti.com Signed-off-by: Vishwanath BS vishwanath...@ti.com Signed-off-by: Tero Kristo t-kri...@ti.com --- arch/arm/mach-omap2/omap_twl.c | 17 - arch/arm/mach-omap2/voltage.h | 22 -- arch/arm/mach-omap2/vp.c |4 ++-- 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/arch/arm/mach-omap2/omap_twl.c b/arch/arm/mach-omap2/omap_twl.c index f515a1a..df4e7c3 100644 --- a/arch/arm/mach-omap2/omap_twl.c +++ b/arch/arm/mach-omap2/omap_twl.c @@ -30,16 +30,6 @@ #define OMAP3_VP_VSTEPMAX_VSTEPMAX 0x04 #define OMAP3_VP_VLIMITTO_TIMEOUT_US 200 -#define OMAP3430_VP1_VLIMITTO_VDDMIN 0x14 -#define OMAP3430_VP1_VLIMITTO_VDDMAX 0x42 -#define OMAP3430_VP2_VLIMITTO_VDDMIN 0x18 -#define OMAP3430_VP2_VLIMITTO_VDDMAX 0x2c - -#define OMAP3630_VP1_VLIMITTO_VDDMIN 0x18 -#define OMAP3630_VP1_VLIMITTO_VDDMAX 0x3c -#define OMAP3630_VP2_VLIMITTO_VDDMIN 0x18 -#define OMAP3630_VP2_VLIMITTO_VDDMAX 0x30 - #define OMAP4_SRI2C_SLAVE_ADDR 0x12 #define OMAP4_VDD_MPU_SR_VOLT_REG 0x55 #define OMAP4_VDD_MPU_SR_CMD_REG 0x56 @@ -53,13 +43,6 @@ #define OMAP4_VP_VSTEPMAX_VSTEPMAX 0x04 #define OMAP4_VP_VLIMITTO_TIMEOUT_US 200 -#define OMAP4_VP_MPU_VLIMITTO_VDDMIN 0xA -#define OMAP4_VP_MPU_VLIMITTO_VDDMAX 0x39 -#define OMAP4_VP_IVA_VLIMITTO_VDDMIN 0xA -#define OMAP4_VP_IVA_VLIMITTO_VDDMAX 0x2D -#define OMAP4_VP_CORE_VLIMITTO_VDDMIN 0xA -#define OMAP4_VP_CORE_VLIMITTO_VDDMAX 0x28 - static bool is_offset_valid; static u8 smps_offset; /* diff --git a/arch/arm/mach-omap2/voltage.h b/arch/arm/mach-omap2/voltage.h index 8829201..fa5b3dc 100644 --- a/arch/arm/mach-omap2/voltage.h +++ b/arch/arm/mach-omap2/voltage.h @@ -118,6 +118,24 @@ struct omap_volt_data { u8 vp_errgain; }; +/* Min and max voltages from OMAP perspective */ +#define OMAP3430_VP1_VLIMITTO_VDDMIN 85 +#define OMAP3430_VP1_VLIMITTO_VDDMAX 1425000 +#define OMAP3430_VP2_VLIMITTO_VDDMIN 90 +#define OMAP3430_VP2_VLIMITTO_VDDMAX 115 + +#define OMAP3630_VP1_VLIMITTO_VDDMIN 90 +#define OMAP3630_VP1_VLIMITTO_VDDMAX 135 +#define OMAP3630_VP2_VLIMITTO_VDDMIN 90 +#define OMAP3630_VP2_VLIMITTO_VDDMAX 120 + +#define OMAP4_VP_MPU_VLIMITTO_VDDMIN 83 +#define OMAP4_VP_MPU_VLIMITTO_VDDMAX 141 +#define OMAP4_VP_IVA_VLIMITTO_VDDMIN 83 +#define OMAP4_VP_IVA_VLIMITTO_VDDMAX 126 +#define OMAP4_VP_CORE_VLIMITTO_VDDMIN 83 +#define OMAP4_VP_CORE_VLIMITTO_VDDMAX 120 + /** * struct omap_voltdm_pmic - PMIC specific data required by voltage driver. * @slew_rate: PMIC slew rate (in uv/us) @@ -144,8 +162,8 @@ struct omap_voltdm_pmic { u8 vp_erroroffset; u8 vp_vstepmin; u8 vp_vstepmax; - u8 vp_vddmin; - u8 vp_vddmax; + u32 vp_vddmin; + u32 vp_vddmax; u8 vp_timeout_us; bool i2c_high_speed; u8 i2c_mcode; diff --git a/arch/arm/mach-omap2/vp.c b/arch/arm/mach-omap2/vp.c index 807391d..6ee0b4a 100644 --- a/arch/arm/mach-omap2/vp.c +++ b/arch/arm/mach-omap2/vp.c @@ -53,8 +53,8 @@ void __init omap_vp_init(struct voltagedomain *voltdm) sys_clk_rate = voltdm-sys_clk.rate / 1000; timeout = (sys_clk_rate * voltdm-pmic-vp_timeout_us) / 1000; - vddmin = voltdm-pmic-vp_vddmin; - vddmax = voltdm-pmic-vp_vddmax; + vddmin = voltdm-pmic-uv_to_vsel(voltdm-pmic-vp_vddmin); + vddmax = voltdm-pmic-uv_to_vsel(voltdm-pmic-vp_vddmax); waittime = ((voltdm-pmic-step_size / voltdm-pmic-slew_rate) * sys_clk_rate) / 1000; -- 1.7.4.1 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCHv5 02/14] arm: omap: voltage: renamed vp_vddmin and vp_vddmax fields
These are now called vddmin and vddmax, as these fields will be used globally for selecting voltage ranges for a pmic channel, and not only for voltage processor. Signed-off-by: Tero Kristo t-kri...@ti.com --- arch/arm/mach-omap2/omap_twl.c | 27 ++- arch/arm/mach-omap2/voltage.h |4 ++-- arch/arm/mach-omap2/vp.c |4 ++-- 3 files changed, 14 insertions(+), 21 deletions(-) diff --git a/arch/arm/mach-omap2/omap_twl.c b/arch/arm/mach-omap2/omap_twl.c index df4e7c3..5224fbd 100644 --- a/arch/arm/mach-omap2/omap_twl.c +++ b/arch/arm/mach-omap2/omap_twl.c @@ -149,8 +149,8 @@ static struct omap_voltdm_pmic omap3_mpu_pmic = { .vp_erroroffset = OMAP3_VP_CONFIG_ERROROFFSET, .vp_vstepmin= OMAP3_VP_VSTEPMIN_VSTEPMIN, .vp_vstepmax= OMAP3_VP_VSTEPMAX_VSTEPMAX, - .vp_vddmin = OMAP3430_VP1_VLIMITTO_VDDMIN, - .vp_vddmax = OMAP3430_VP1_VLIMITTO_VDDMAX, + .vddmin = 60, + .vddmax = 145, .vp_timeout_us = OMAP3_VP_VLIMITTO_TIMEOUT_US, .i2c_slave_addr = OMAP3_SRI2C_SLAVE_ADDR, .volt_reg_addr = OMAP3_VDD_MPU_SR_CONTROL_REG, @@ -170,8 +170,8 @@ static struct omap_voltdm_pmic omap3_core_pmic = { .vp_erroroffset = OMAP3_VP_CONFIG_ERROROFFSET, .vp_vstepmin= OMAP3_VP_VSTEPMIN_VSTEPMIN, .vp_vstepmax= OMAP3_VP_VSTEPMAX_VSTEPMAX, - .vp_vddmin = OMAP3430_VP2_VLIMITTO_VDDMIN, - .vp_vddmax = OMAP3430_VP2_VLIMITTO_VDDMAX, + .vddmin = 60, + .vddmax = 145, .vp_timeout_us = OMAP3_VP_VLIMITTO_TIMEOUT_US, .i2c_slave_addr = OMAP3_SRI2C_SLAVE_ADDR, .volt_reg_addr = OMAP3_VDD_CORE_SR_CONTROL_REG, @@ -191,8 +191,8 @@ static struct omap_voltdm_pmic omap4_mpu_pmic = { .vp_erroroffset = OMAP4_VP_CONFIG_ERROROFFSET, .vp_vstepmin= OMAP4_VP_VSTEPMIN_VSTEPMIN, .vp_vstepmax= OMAP4_VP_VSTEPMAX_VSTEPMAX, - .vp_vddmin = OMAP4_VP_MPU_VLIMITTO_VDDMIN, - .vp_vddmax = OMAP4_VP_MPU_VLIMITTO_VDDMAX, + .vddmin = 0, + .vddmax = 150, .vp_timeout_us = OMAP4_VP_VLIMITTO_TIMEOUT_US, .i2c_slave_addr = OMAP4_SRI2C_SLAVE_ADDR, .volt_reg_addr = OMAP4_VDD_MPU_SR_VOLT_REG, @@ -213,8 +213,8 @@ static struct omap_voltdm_pmic omap4_iva_pmic = { .vp_erroroffset = OMAP4_VP_CONFIG_ERROROFFSET, .vp_vstepmin= OMAP4_VP_VSTEPMIN_VSTEPMIN, .vp_vstepmax= OMAP4_VP_VSTEPMAX_VSTEPMAX, - .vp_vddmin = OMAP4_VP_IVA_VLIMITTO_VDDMIN, - .vp_vddmax = OMAP4_VP_IVA_VLIMITTO_VDDMAX, + .vddmin = 0, + .vddmax = 150, .vp_timeout_us = OMAP4_VP_VLIMITTO_TIMEOUT_US, .i2c_slave_addr = OMAP4_SRI2C_SLAVE_ADDR, .volt_reg_addr = OMAP4_VDD_IVA_SR_VOLT_REG, @@ -235,8 +235,8 @@ static struct omap_voltdm_pmic omap4_core_pmic = { .vp_erroroffset = OMAP4_VP_CONFIG_ERROROFFSET, .vp_vstepmin= OMAP4_VP_VSTEPMIN_VSTEPMIN, .vp_vstepmax= OMAP4_VP_VSTEPMAX_VSTEPMAX, - .vp_vddmin = OMAP4_VP_CORE_VLIMITTO_VDDMIN, - .vp_vddmax = OMAP4_VP_CORE_VLIMITTO_VDDMAX, + .vddmin = 0, + .vddmax = 150, .vp_timeout_us = OMAP4_VP_VLIMITTO_TIMEOUT_US, .i2c_slave_addr = OMAP4_SRI2C_SLAVE_ADDR, .volt_reg_addr = OMAP4_VDD_CORE_SR_VOLT_REG, @@ -271,13 +271,6 @@ int __init omap3_twl_init(void) if (!cpu_is_omap34xx()) return -ENODEV; - if (cpu_is_omap3630()) { - omap3_mpu_pmic.vp_vddmin = OMAP3630_VP1_VLIMITTO_VDDMIN; - omap3_mpu_pmic.vp_vddmax = OMAP3630_VP1_VLIMITTO_VDDMAX; - omap3_core_pmic.vp_vddmin = OMAP3630_VP2_VLIMITTO_VDDMIN; - omap3_core_pmic.vp_vddmax = OMAP3630_VP2_VLIMITTO_VDDMAX; - } - /* * The smartreflex bit on twl4030 specifies if the setting of voltage * is done over the I2C_SR path. Since this setting is independent of diff --git a/arch/arm/mach-omap2/voltage.h b/arch/arm/mach-omap2/voltage.h index fa5b3dc..949938d 100644 --- a/arch/arm/mach-omap2/voltage.h +++ b/arch/arm/mach-omap2/voltage.h @@ -162,8 +162,8 @@ struct omap_voltdm_pmic { u8 vp_erroroffset; u8 vp_vstepmin; u8 vp_vstepmax; - u32 vp_vddmin; - u32 vp_vddmax; + u32 vddmin; + u32 vddmax; u8 vp_timeout_us; bool i2c_high_speed; u8 i2c_mcode; diff --git a/arch/arm/mach-omap2/vp.c
[PATCHv5 03/14] arm: omap3+: voltage: parameter segregation
Introduced two new voltage domain specific parameter structures, omap_vp_param and omap_vc_param. These are used to describe the minimum and maximum voltages for the voltagedomains, and also the sleep voltage levels. Existing voltage levels are also moved into these new structures, and the voltage domain code is changed to use these. Signed-off-by: Tero Kristo t-kri...@ti.com --- arch/arm/mach-omap2/omap_twl.c| 25 --- arch/arm/mach-omap2/vc.c | 241 ++--- arch/arm/mach-omap2/vc.h |8 +- arch/arm/mach-omap2/vc3xxx_data.c | 22 +++ arch/arm/mach-omap2/vc44xx_data.c | 28 +++ arch/arm/mach-omap2/voltage.h | 18 ++- arch/arm/mach-omap2/voltagedomains3xxx_data.c |5 + arch/arm/mach-omap2/voltagedomains44xx_data.c |8 + arch/arm/mach-omap2/vp.h |7 + arch/arm/mach-omap2/vp3xxx_data.c | 10 + arch/arm/mach-omap2/vp44xx_data.c | 15 ++ 11 files changed, 331 insertions(+), 56 deletions(-) diff --git a/arch/arm/mach-omap2/omap_twl.c b/arch/arm/mach-omap2/omap_twl.c index 5224fbd..2f20242 100644 --- a/arch/arm/mach-omap2/omap_twl.c +++ b/arch/arm/mach-omap2/omap_twl.c @@ -141,11 +141,6 @@ static u8 twl6030_uv_to_vsel(unsigned long uv) static struct omap_voltdm_pmic omap3_mpu_pmic = { .slew_rate = 4000, .step_size = 12500, - .on_volt= 120, - .onlp_volt = 100, - .ret_volt = 975000, - .off_volt = 60, - .volt_setup_time= 0xfff, .vp_erroroffset = OMAP3_VP_CONFIG_ERROROFFSET, .vp_vstepmin= OMAP3_VP_VSTEPMIN_VSTEPMIN, .vp_vstepmax= OMAP3_VP_VSTEPMAX_VSTEPMAX, @@ -162,11 +157,6 @@ static struct omap_voltdm_pmic omap3_mpu_pmic = { static struct omap_voltdm_pmic omap3_core_pmic = { .slew_rate = 4000, .step_size = 12500, - .on_volt= 120, - .onlp_volt = 100, - .ret_volt = 975000, - .off_volt = 60, - .volt_setup_time= 0xfff, .vp_erroroffset = OMAP3_VP_CONFIG_ERROROFFSET, .vp_vstepmin= OMAP3_VP_VSTEPMIN_VSTEPMIN, .vp_vstepmax= OMAP3_VP_VSTEPMAX_VSTEPMAX, @@ -183,11 +173,6 @@ static struct omap_voltdm_pmic omap3_core_pmic = { static struct omap_voltdm_pmic omap4_mpu_pmic = { .slew_rate = 4000, .step_size = 12660, - .on_volt= 1375000, - .onlp_volt = 1375000, - .ret_volt = 83, - .off_volt = 0, - .volt_setup_time= 0, .vp_erroroffset = OMAP4_VP_CONFIG_ERROROFFSET, .vp_vstepmin= OMAP4_VP_VSTEPMIN_VSTEPMIN, .vp_vstepmax= OMAP4_VP_VSTEPMAX_VSTEPMAX, @@ -205,11 +190,6 @@ static struct omap_voltdm_pmic omap4_mpu_pmic = { static struct omap_voltdm_pmic omap4_iva_pmic = { .slew_rate = 4000, .step_size = 12660, - .on_volt= 1188000, - .onlp_volt = 1188000, - .ret_volt = 83, - .off_volt = 0, - .volt_setup_time= 0, .vp_erroroffset = OMAP4_VP_CONFIG_ERROROFFSET, .vp_vstepmin= OMAP4_VP_VSTEPMIN_VSTEPMIN, .vp_vstepmax= OMAP4_VP_VSTEPMAX_VSTEPMAX, @@ -227,11 +207,6 @@ static struct omap_voltdm_pmic omap4_iva_pmic = { static struct omap_voltdm_pmic omap4_core_pmic = { .slew_rate = 4000, .step_size = 12660, - .on_volt= 120, - .onlp_volt = 120, - .ret_volt = 83, - .off_volt = 0, - .volt_setup_time= 0, .vp_erroroffset = OMAP4_VP_CONFIG_ERROROFFSET, .vp_vstepmin= OMAP4_VP_VSTEPMIN_VSTEPMIN, .vp_vstepmax= OMAP4_VP_VSTEPMAX_VSTEPMAX, diff --git a/arch/arm/mach-omap2/vc.c b/arch/arm/mach-omap2/vc.c index 031d116..af061c3 100644 --- a/arch/arm/mach-omap2/vc.c +++ b/arch/arm/mach-omap2/vc.c @@ -10,14 +10,18 @@ #include linux/kernel.h #include linux/delay.h #include linux/init.h +#include linux/clk.h +#include linux/io.h #include plat/cpu.h +#include plat/prcm.h #include voltage.h #include vc.h #include prm-regbits-34xx.h #include prm-regbits-44xx.h #include prm44xx.h +#include scrm44xx.h /** * struct omap_vc_channel_cfg - describe the cfg_channel bitfield @@ -136,6 +140,8 @@ int omap_vc_pre_scale(struct voltagedomain *voltdm, vc_cmdval |= (*target_vsel vc-common-cmd_on_shift); voltdm-write(vc_cmdval, vc-cmdval_reg); +
[PATCHv5 04/14] arm: omap: voltage: add definition for pmic startup / shutdown times
This is applied when PMIC is entering or leaving a sleep mode. Signed-off-by: Tero Kristo t-kri...@ti.com --- arch/arm/mach-omap2/voltage.h |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/voltage.h b/arch/arm/mach-omap2/voltage.h index 940a0d6..54b959c 100644 --- a/arch/arm/mach-omap2/voltage.h +++ b/arch/arm/mach-omap2/voltage.h @@ -145,6 +145,8 @@ struct omap_volt_data { * @i2c_slave_addr: I2C slave address of PMIC * @volt_reg_addr: voltage configuration register address * @cmd_reg_addr: command (on, on-LP, ret, off) configuration register address + * @startup_time: PMIC startup time, only valid for core domain + * @shutdown_time: PMIC shutdown time, only valid for core domain * @i2c_high_speed: whether VC uses I2C high-speed mode to PMIC * @i2c_mcode: master code value for I2C high-speed preamble transmission * @vsel_to_uv:PMIC API to convert vsel value to actual voltage in uV. @@ -162,6 +164,8 @@ struct omap_voltdm_pmic { u8 vp_vstepmax; u32 vddmin; u32 vddmax; + u32 startup_time; + u32 shutdown_time; u8 vp_timeout_us; bool i2c_high_speed; u8 i2c_mcode; -- 1.7.4.1 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCHv5 05/14] arm: omap4: add pmic startup / shutdown times
Both startup and shutdown take 500us at maximum, value taken from TWL6030 data manual. Signed-off-by: Tero Kristo t-kri...@ti.com --- arch/arm/mach-omap2/omap_twl.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/omap_twl.c b/arch/arm/mach-omap2/omap_twl.c index 2f20242..7830eae 100644 --- a/arch/arm/mach-omap2/omap_twl.c +++ b/arch/arm/mach-omap2/omap_twl.c @@ -207,6 +207,8 @@ static struct omap_voltdm_pmic omap4_iva_pmic = { static struct omap_voltdm_pmic omap4_core_pmic = { .slew_rate = 4000, .step_size = 12660, + .startup_time = 500, + .shutdown_time = 500, .vp_erroroffset = OMAP4_VP_CONFIG_ERROROFFSET, .vp_vstepmin= OMAP4_VP_VSTEPMIN_VSTEPMIN, .vp_vstepmax= OMAP4_VP_VSTEPMAX_VSTEPMAX, -- 1.7.4.1 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCHv5 06/14] arm: omap: add support for oscillator setup
This contains startup and shutdown times for the oscillator. By default use ULONG_MAX. Oscillator setup is used for calculating and setting up latencies for sleep modes that disable oscillator. Signed-off-by: Tero Kristo t-kri...@ti.com --- arch/arm/mach-omap2/pm.c | 27 +++ arch/arm/mach-omap2/pm.h |8 2 files changed, 35 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c index 1881fe9..2402e8e 100644 --- a/arch/arm/mach-omap2/pm.c +++ b/arch/arm/mach-omap2/pm.c @@ -28,6 +28,33 @@ static struct omap_device_pm_latency *pm_lats; +/** + * struct omap2_oscillator - Describe the board main oscillator latencies + * @startup_time: oscillator startup latency + * @shutdown_time: oscillator shutdown latency + */ +struct omap2_oscillator { + u32 startup_time; + u32 shutdown_time; +}; + +static struct omap2_oscillator oscillator = { + .startup_time = ULONG_MAX, + .shutdown_time = ULONG_MAX, +}; + +void omap_pm_setup_oscillator(u32 tstart, u32 tshut) +{ + oscillator.startup_time = tstart; + oscillator.shutdown_time = tshut; +} + +void omap_pm_get_oscillator(u32 *tstart, u32 *tshut) +{ + *tstart = oscillator.startup_time; + *tshut = oscillator.shutdown_time; +} + static int _init_omap_device(char *name) { struct omap_hwmod *oh; diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h index ec8f874..797d2da 100644 --- a/arch/arm/mach-omap2/pm.h +++ b/arch/arm/mach-omap2/pm.h @@ -141,4 +141,12 @@ static inline int omap4_twl_init(void) } #endif +#ifdef CONFIG_PM +extern void omap_pm_setup_oscillator(u32 tstart, u32 tshut); +extern void omap_pm_get_oscillator(u32 *tstart, u32 *tshut); +#else +static inline void omap_pm_setup_oscillator(u32 tstart, u32 tshut) { } +static inline void omap_pm_get_oscillator(u32 *tstart, u32 *tshut) { } +#endif + #endif -- 1.7.4.1 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCHv5 07/14] arm: omap3+: vp: use new vp_params for calculating vddmin and vddmax
Now we select the vddmin and vddmax values based on both pmic and voltage processor data, this allows usage of different power ICs. Signed-off-by: Tero Kristo t-kri...@ti.com --- arch/arm/mach-omap2/vp.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-omap2/vp.c b/arch/arm/mach-omap2/vp.c index d9e0650..22df86d 100644 --- a/arch/arm/mach-omap2/vp.c +++ b/arch/arm/mach-omap2/vp.c @@ -53,8 +53,10 @@ void __init omap_vp_init(struct voltagedomain *voltdm) sys_clk_rate = voltdm-sys_clk.rate / 1000; timeout = (sys_clk_rate * voltdm-pmic-vp_timeout_us) / 1000; - vddmin = voltdm-pmic-uv_to_vsel(voltdm-pmic-vddmin); - vddmax = voltdm-pmic-uv_to_vsel(voltdm-pmic-vddmax); + vddmin = max(voltdm-vp_param-vddmin, voltdm-pmic-vddmin); + vddmax = min(voltdm-vp_param-vddmax, voltdm-pmic-vddmax); + vddmin = voltdm-pmic-uv_to_vsel(vddmin); + vddmax = voltdm-pmic-uv_to_vsel(vddmax); waittime = ((voltdm-pmic-step_size / voltdm-pmic-slew_rate) * sys_clk_rate) / 1000; -- 1.7.4.1 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCHv5 08/14] arm: omap3+: voltage: use oscillator data to calculate setup times
We now use the previously defined oscillator setup / shutdown times to calculate the register values for CLKSETUP. Signed-off-by: Tero Kristo t-kri...@ti.com --- arch/arm/mach-omap2/vc.c | 62 ++ 1 files changed, 62 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/vc.c b/arch/arm/mach-omap2/vc.c index af061c3..2fe4ce2 100644 --- a/arch/arm/mach-omap2/vc.c +++ b/arch/arm/mach-omap2/vc.c @@ -13,6 +13,8 @@ #include linux/clk.h #include linux/io.h +#include asm/div64.h + #include plat/cpu.h #include plat/prcm.h @@ -22,6 +24,7 @@ #include prm-regbits-44xx.h #include prm44xx.h #include scrm44xx.h +#include pm.h /** * struct omap_vc_channel_cfg - describe the cfg_channel bitfield @@ -209,6 +212,21 @@ int omap_vc_bypass_scale(struct voltagedomain *voltdm, return 0; } +/* Convert microsecond value to number of 32kHz clock cycles */ +static u32 omap_usec_to_32k(u32 usec) +{ + /* DIV_ROUND_UP expanded to 64bit to avoid overflow */ + u64 val = 32768ULL * (u64)usec + 100ULL - 1; + do_div(val, 100ULL); + return val; +} + +/* Set oscillator setup time for omap3 */ +static void omap3_set_clksetup(u32 usec, struct voltagedomain *voltdm) +{ + voltdm-write(omap_usec_to_32k(usec), OMAP3_PRM_CLKSETUP_OFFSET); +} + /** * omap3_set_i2c_timings - sets i2c sleep timings for a channel * @voltdm: channel to configure @@ -225,6 +243,12 @@ static void omap3_set_i2c_timings(struct voltagedomain *voltdm, bool off_mode) unsigned long voltsetup1; u32 tgt_volt; + /* +* Oscillator is shut down only if we are using sys_off_mode pad, +* thus we set a minimal setup time here +*/ + omap3_set_clksetup(1, voltdm); + if (off_mode) tgt_volt = voltdm-vc_param-off; else @@ -265,6 +289,7 @@ static void omap3_set_off_timings(struct voltagedomain *voltdm) unsigned long voltsetup2; unsigned long voltsetup2_old; u32 val; + u32 tstart, tshut; /* check if sys_off_mode is used to control off-mode voltages */ val = voltdm-read(OMAP3_PRM_VOLTCTRL_OFFSET); @@ -274,6 +299,9 @@ static void omap3_set_off_timings(struct voltagedomain *voltdm) return; } + omap_pm_get_oscillator(tstart, tshut); + omap3_set_clksetup(tstart, voltdm); + clksetup = voltdm-read(OMAP3_PRM_CLKSETUP_OFFSET); /* voltsetup 2 in us */ @@ -370,6 +398,30 @@ static u32 omap4_calc_volt_ramp(struct voltagedomain *voltdm, u32 voltage_diff) } /** + * omap4_usec_to_val_scrm - convert microsecond value to SCRM module bitfield + * @usec: microseconds + * @shift: number of bits to shift left + * @mask: bitfield mask + * + * Converts microsecond value to OMAP4 SCRM bitfield. Bitfield is + * shifted to requested position, and checked agains the mask value. + * If larger, forced to the max value of the field (i.e. the mask itself.) + * Returns the SCRM bitfield value. + */ +static u32 omap4_usec_to_val_scrm(u32 usec, int shift, u32 mask) +{ + u32 val; + + val = omap_usec_to_32k(usec) shift; + + /* Check for overflow, if yes, force to max value */ + if (val mask) + val = mask; + + return val; +} + +/** * omap4_set_timings - set voltage ramp timings for a channel * @voltdm: channel to configure * @off_mode: whether off-mode values are used @@ -380,6 +432,7 @@ static void omap4_set_timings(struct voltagedomain *voltdm, bool off_mode) { u32 val; u32 ramp; + u32 tstart, tshut; /* configure the setup times */ val = voltdm-read(voltdm-vfsm-voltsetup_reg); @@ -399,6 +452,15 @@ static void omap4_set_timings(struct voltagedomain *voltdm, bool off_mode) val |= ramp OMAP4430_RAMP_UP_COUNT_SHIFT; voltdm-write(val, voltdm-vfsm-voltsetup_reg); + + omap_pm_get_oscillator(tstart, tshut); + + val = omap4_usec_to_val_scrm(tstart, OMAP4_SETUPTIME_SHIFT, + OMAP4_SETUPTIME_MASK); + val |= omap4_usec_to_val_scrm(tshut, OMAP4_DOWNTIME_SHIFT, + OMAP4_DOWNTIME_MASK); + + __raw_writel(val, OMAP4_SCRM_CLKSETUPTIME); } /* OMAP4 specific voltage init functions */ -- 1.7.4.1 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCHv5 09/14] arm: omap4: use pmic params for calculating pmic setup times
As voltdm-pmic now contains startup and shutdown times for PMIC, use these for calculating the fields in the PMICSETUPTIME register. Signed-off-by: Tero Kristo t-kri...@ti.com --- arch/arm/mach-omap2/vc.c | 11 +++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/vc.c b/arch/arm/mach-omap2/vc.c index 2fe4ce2..0971221 100644 --- a/arch/arm/mach-omap2/vc.c +++ b/arch/arm/mach-omap2/vc.c @@ -461,6 +461,17 @@ static void omap4_set_timings(struct voltagedomain *voltdm, bool off_mode) OMAP4_DOWNTIME_MASK); __raw_writel(val, OMAP4_SCRM_CLKSETUPTIME); + + tstart = voltdm-pmic-startup_time; + tshut = voltdm-pmic-shutdown_time; + + if (tstart tshut) { + val = omap4_usec_to_val_scrm(tstart, OMAP4_WAKEUPTIME_SHIFT, + OMAP4_WAKEUPTIME_MASK); + val |= omap4_usec_to_val_scrm(tshut, OMAP4_SLEEPTIME_SHIFT, + OMAP4_SLEEPTIME_MASK); + __raw_writel(val, OMAP4_SCRM_PMICSETUPTIME); + } } /* OMAP4 specific voltage init functions */ -- 1.7.4.1 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCHv5 11/14] arm: omap: beagle: set oscillator startup time to 10ms for rev c4
Based on the oscillator datasheet for this device. Signed-off-by: Tero Kristo t-kri...@ti.com --- arch/arm/mach-omap2/board-omap3beagle.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index 97678e5..5489dbe 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c @@ -511,6 +511,9 @@ static void __init beagle_opp_init(void) opp_disable(mpu_dev, 72000); opp_disable(iva_dev, 52000); } + + /* Set oscillator startup time to 10ms, shutdown not used */ + omap_pm_setup_oscillator(1, ULONG_MAX); } /* Custom OPP enabled for all xM versions */ -- 1.7.4.1 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCHv5 10/14] TEMP: arm: OMAP3: beagle rev-c4: enable OPP6
Beagleboard rev-c4 has a speed sorted OMAP3530 chip which can run at 720MHz. Signed-off-by: Tero Kristo t-kri...@ti.com --- arch/arm/mach-omap2/board-omap3beagle.c | 29 + arch/arm/mach-omap2/opp3xxx_data.c |4 2 files changed, 33 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index 7ffcd28..97678e5 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c @@ -484,6 +484,35 @@ static void __init beagle_opp_init(void) return; } + if (omap3_beagle_version == OMAP3BEAGLE_BOARD_C4) { + struct device *mpu_dev, *iva_dev; + + mpu_dev = omap_device_get_by_hwmod_name(mpu); + iva_dev = omap_device_get_by_hwmod_name(iva); + + if (!mpu_dev || !iva_dev) { + pr_err(%s: Aiee.. no mpu/dsp devices? %p %p\n, + __func__, mpu_dev, iva_dev); + return; + } + /* Enable MPU 720MHz opp */ + r = opp_enable(mpu_dev, 72000); + + /* Enable IVA 520MHz opp */ + r |= opp_enable(iva_dev, 52000); + + if (r) { + pr_err(%s: failed to enable higher opp %d\n, + __func__, r); + /* +* Cleanup - disable the higher freqs - we dont care +* about the results +*/ + opp_disable(mpu_dev, 72000); + opp_disable(iva_dev, 52000); + } + } + /* Custom OPP enabled for all xM versions */ if (cpu_is_omap3630()) { struct device *mpu_dev, *iva_dev; diff --git a/arch/arm/mach-omap2/opp3xxx_data.c b/arch/arm/mach-omap2/opp3xxx_data.c index d95f3f9..a0f5fe1 100644 --- a/arch/arm/mach-omap2/opp3xxx_data.c +++ b/arch/arm/mach-omap2/opp3xxx_data.c @@ -98,6 +98,8 @@ static struct omap_opp_def __initdata omap34xx_opp_def_list[] = { OPP_INITIALIZER(mpu, true, 55000, OMAP3430_VDD_MPU_OPP4_UV), /* MPU OPP5 */ OPP_INITIALIZER(mpu, true, 6, OMAP3430_VDD_MPU_OPP5_UV), + /* MPU OPP6 : omap3530 high speed grade only */ + OPP_INITIALIZER(mpu, false, 72000, OMAP3430_VDD_MPU_OPP5_UV), /* * L3 OPP1 - 41.5 MHz is disabled because: The voltage for that OPP is @@ -123,6 +125,8 @@ static struct omap_opp_def __initdata omap34xx_opp_def_list[] = { OPP_INITIALIZER(iva, true, 4, OMAP3430_VDD_MPU_OPP4_UV), /* DSP OPP5 */ OPP_INITIALIZER(iva, true, 43000, OMAP3430_VDD_MPU_OPP5_UV), + /* DSP OPP6 : omap3530 high speed grade only */ + OPP_INITIALIZER(iva, false, 52000, OMAP3430_VDD_MPU_OPP5_UV), }; static struct omap_opp_def __initdata omap36xx_opp_def_list[] = { -- 1.7.4.1 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCHv5 12/14] arm: omap3: vc: auto_ret / auto_off support
Voltage code will now enable / disable auto_ret / auto_off dynamically according to the voltagedomain usecounts. This is accomplished via the usage of the voltdm callback functions for sleep / wakeup. Signed-off-by: Tero Kristo t-kri...@ti.com --- arch/arm/mach-omap2/vc.c | 139 +++-- 1 files changed, 120 insertions(+), 19 deletions(-) diff --git a/arch/arm/mach-omap2/vc.c b/arch/arm/mach-omap2/vc.c index 0971221..49df835 100644 --- a/arch/arm/mach-omap2/vc.c +++ b/arch/arm/mach-omap2/vc.c @@ -12,6 +12,7 @@ #include linux/init.h #include linux/clk.h #include linux/io.h +#include linux/string.h #include asm/div64.h @@ -243,12 +244,6 @@ static void omap3_set_i2c_timings(struct voltagedomain *voltdm, bool off_mode) unsigned long voltsetup1; u32 tgt_volt; - /* -* Oscillator is shut down only if we are using sys_off_mode pad, -* thus we set a minimal setup time here -*/ - omap3_set_clksetup(1, voltdm); - if (off_mode) tgt_volt = voltdm-vc_param-off; else @@ -262,12 +257,6 @@ static void omap3_set_i2c_timings(struct voltagedomain *voltdm, bool off_mode) voltdm-rmw(voltdm-vfsm-voltsetup_mask, voltsetup1 __ffs(voltdm-vfsm-voltsetup_mask), voltdm-vfsm-voltsetup_reg); - - /* -* pmic is not controlling the voltage scaling during retention, -* thus set voltsetup2 to 0 -*/ - voltdm-write(0, OMAP3_PRM_VOLTSETUP2_OFFSET); } /** @@ -289,7 +278,6 @@ static void omap3_set_off_timings(struct voltagedomain *voltdm) unsigned long voltsetup2; unsigned long voltsetup2_old; u32 val; - u32 tstart, tshut; /* check if sys_off_mode is used to control off-mode voltages */ val = voltdm-read(OMAP3_PRM_VOLTCTRL_OFFSET); @@ -299,9 +287,6 @@ static void omap3_set_off_timings(struct voltagedomain *voltdm) return; } - omap_pm_get_oscillator(tstart, tshut); - omap3_set_clksetup(tstart, voltdm); - clksetup = voltdm-read(OMAP3_PRM_CLKSETUP_OFFSET); /* voltsetup 2 in us */ @@ -331,17 +316,133 @@ static void omap3_set_off_timings(struct voltagedomain *voltdm) */ voltdm-rmw(voltdm-vfsm-voltsetup_mask, 0, voltdm-vfsm-voltsetup_reg); +} - /* voltoffset must be clksetup minus voltsetup2 according to TRM */ - voltdm-write(clksetup - voltsetup2, OMAP3_PRM_VOLTOFFSET_OFFSET); +/** + * omap3_set_core_ret_timings - set retention timings for core domain + * @voltdm: pointer for core voltagedomain struct + * + * This function is called once core domain is ready to enter + * retention. This sets the values for the global setup variables like + * oscillator setup time, and the ramp times for voltages. + */ +static void omap3_set_core_ret_timings(struct voltagedomain *voltdm) +{ + /* +* Oscillator is not shut down in retention, thus set minimal +* clock setup time +*/ + omap3_set_clksetup(1, voltdm); + + /* +* Reset voltsetup 2 and voltoffset when entering retention +* as they are only used when pmic is controlling voltages +*/ + voltdm-write(0, OMAP3_PRM_VOLTSETUP2_OFFSET); + voltdm-write(0, OMAP3_PRM_VOLTOFFSET_OFFSET); + omap3_set_i2c_timings(voltdm, false); } -static void __init omap3_vc_init_channel(struct voltagedomain *voltdm) +/** + * omap3_set_core_off_timings - set off timings for core domain + * @voltdm: pointer for core voltagedomain struct + * + * This function is called once core domain is ready to enter off-mode. + * This sets the values for the global setup variables like oscillator + * setup time, and the ramp times for voltages. + */ +static void omap3_set_core_off_timings(struct voltagedomain *voltdm) { + u32 tstart, tshut; + + omap_pm_get_oscillator(tstart, tshut); + omap3_set_clksetup(tstart, voltdm); omap3_set_off_timings(voltdm); } /** + * omap3_vc_channel_sleep - idle callback for a voltagedomain + * @voltdm: voltage channel that is entering idle + * + * Prepares voltage channel for entering idle. This gets called from + * the voltagedomain code once the usecount for the domain reaches zero. + * Function checks the target sleep mode and configures the channel + * accordingly. + */ +static void omap3_vc_channel_sleep(struct voltagedomain *voltdm) +{ + /* Set off timings if entering off */ + if (voltdm-target_state == PWRDM_POWER_OFF) + omap3_set_off_timings(voltdm); + else + omap3_set_i2c_timings(voltdm, false); +} + +/** + * omap3_vc_core_sleep - idle callback for core voltagedomain + * @voltdm: pointer to core voltagedomain struct + * + * Prepares core voltagedomain for idle. This checks the target sleep + * mode of the device (highest sleep mode of all powerdomains), and + * sets up the device according
[PATCHv5 13/14] arm: omap3: voltage: fix channel configuration
OMAP3 uses the default settings for VDD1 channel, otherwise the settings will overlap with VDD2 and attempting to modify VDD1 voltage will actually change VDD2 voltage. Signed-off-by: Tero Kristo t-kri...@ti.com --- arch/arm/mach-omap2/vc.c |5 - arch/arm/mach-omap2/vc3xxx_data.c |1 + 2 files changed, 5 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-omap2/vc.c b/arch/arm/mach-omap2/vc.c index 49df835..a0023de 100644 --- a/arch/arm/mach-omap2/vc.c +++ b/arch/arm/mach-omap2/vc.c @@ -701,9 +701,12 @@ void __init omap_vc_init_channel(struct voltagedomain *voltdm) voltdm-rmw(vc-smps_cmdra_mask, vc-cmd_reg_addr __ffs(vc-smps_cmdra_mask), vc-smps_cmdra_reg); - vc-cfg_channel |= vc_cfg_bits-rac | vc_cfg_bits-racen; + vc-cfg_channel |= vc_cfg_bits-rac; } + if (vc-cmd_reg_addr == vc-volt_reg_addr) + vc-cfg_channel |= vc_cfg_bits-racen; + /* Set up the on, inactive, retention and off voltage */ on_vsel = omap_vc_calc_vsel(voltdm, voltdm-vc_param-on); onlp_vsel = omap_vc_calc_vsel(voltdm, voltdm-vc_param-onlp); diff --git a/arch/arm/mach-omap2/vc3xxx_data.c b/arch/arm/mach-omap2/vc3xxx_data.c index 0535e8e..75bc4aa 100644 --- a/arch/arm/mach-omap2/vc3xxx_data.c +++ b/arch/arm/mach-omap2/vc3xxx_data.c @@ -46,6 +46,7 @@ static struct omap_vc_common omap3_vc_common = { }; struct omap_vc_channel omap3_vc_mpu = { + .flags = OMAP_VC_CHANNEL_DEFAULT, .common = omap3_vc_common, .smps_sa_reg = OMAP3_PRM_VC_SMPS_SA_OFFSET, .smps_volra_reg = OMAP3_PRM_VC_SMPS_VOL_RA_OFFSET, -- 1.7.4.1 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCHv5 14/14] arm: omap: pm: wait for domain wakeup if changing state of idle domain
If we are switching the state of an idle powerdomain, we must wait for the wakeup to complete before attempting to switch to the new state, otherwise the powerdomain may not be ready for the switch and will fail. Signed-off-by: Tero Kristo t-kri...@ti.com --- arch/arm/mach-omap2/pm.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c index 2402e8e..7a669f3 100644 --- a/arch/arm/mach-omap2/pm.c +++ b/arch/arm/mach-omap2/pm.c @@ -126,6 +126,7 @@ int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state) } else { hwsup = clkdm_in_hwsup(pwrdm-pwrdm_clkdms[0]); clkdm_wakeup(pwrdm-pwrdm_clkdms[0]); + pwrdm_wait_transition(pwrdm); sleep_switch = FORCEWAKEUP_SWITCH; } } -- 1.7.4.1 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 0/3] OMAPDSS: Miscellaneous DISPC Fixes
These are some minor Display Controller fixes. Tested on 4430sdp and 3430sdp on the tree: git://gitorious.org/linux-omap-dss2/linux.git dev Lajos Molnar (3): OMAPDSS: DISPC: Fix OMAP4 supported color formats OMAPDSS: DISPC: Fix FIR coefficients OMAPDSS: DSS: Add runtime_pm protection around wait_for_vsync. drivers/video/omap2/dss/dispc.c| 24 +++- drivers/video/omap2/dss/dispc_coefs.c |9 - drivers/video/omap2/dss/dss_features.c |3 ++- 3 files changed, 21 insertions(+), 15 deletions(-) -- 1.7.5.4 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/3] OMAPDSS: DISPC: Fix OMAP4 supported color formats
From: Lajos Molnar la...@ti.com Add missing but supported color formats for GFX pipeline in dss features: RGBX16-, RGBA16- and XRGB16-1555. In dispc_ovl_set_color_mode(): - Remove unsupported modes on GFX pipeline: YUV2 and UYVY. Replace these by missing modes supported by GFX pipelines: RGBX16- and RGBA16-. - Fix swapped modes on VID pipelines: RGBX16- and XRGB16-. Signed-off-by: Lajos Molnar la...@ti.com Signed-off-by: Archit Taneja arc...@ti.com --- drivers/video/omap2/dss/dispc.c|8 drivers/video/omap2/dss/dss_features.c |3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c index 14b1f54..df6259e 100644 --- a/drivers/video/omap2/dss/dispc.c +++ b/drivers/video/omap2/dss/dispc.c @@ -736,11 +736,11 @@ static void dispc_ovl_set_color_mode(enum omap_plane plane, switch (color_mode) { case OMAP_DSS_COLOR_NV12: m = 0x0; break; - case OMAP_DSS_COLOR_RGB12U: + case OMAP_DSS_COLOR_RGBX16: m = 0x1; break; case OMAP_DSS_COLOR_RGBA16: m = 0x2; break; - case OMAP_DSS_COLOR_RGBX16: + case OMAP_DSS_COLOR_RGB12U: m = 0x4; break; case OMAP_DSS_COLOR_ARGB16: m = 0x5; break; @@ -789,9 +789,9 @@ static void dispc_ovl_set_color_mode(enum omap_plane plane, m = 0x8; break; case OMAP_DSS_COLOR_RGB24P: m = 0x9; break; - case OMAP_DSS_COLOR_YUV2: + case OMAP_DSS_COLOR_RGBX16: m = 0xa; break; - case OMAP_DSS_COLOR_UYVY: + case OMAP_DSS_COLOR_RGBA16: m = 0xb; break; case OMAP_DSS_COLOR_ARGB32: m = 0xc; break; diff --git a/drivers/video/omap2/dss/dss_features.c b/drivers/video/omap2/dss/dss_features.c index 0a92643..ce14aa6 100644 --- a/drivers/video/omap2/dss/dss_features.c +++ b/drivers/video/omap2/dss/dss_features.c @@ -190,7 +190,8 @@ static const enum omap_color_mode omap4_dss_supported_color_modes[] = { OMAP_DSS_COLOR_RGB16 | OMAP_DSS_COLOR_RGB24U | OMAP_DSS_COLOR_RGB24P | OMAP_DSS_COLOR_ARGB32 | OMAP_DSS_COLOR_RGBA32 | OMAP_DSS_COLOR_RGBX32 | - OMAP_DSS_COLOR_ARGB16_1555, + OMAP_DSS_COLOR_ARGB16_1555 | OMAP_DSS_COLOR_RGBX16 | + OMAP_DSS_COLOR_RGBA16 | OMAP_DSS_COLOR_XRGB16_1555, /* OMAP_DSS_VIDEO1 */ OMAP_DSS_COLOR_RGB16 | OMAP_DSS_COLOR_RGB12U | -- 1.7.5.4 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/3] OMAPDSS: DISPC: Fix FIR coefficients
From: Lajos Molnar la...@ti.com coef3_M8 had an incorrect phase with 50% more intensity. This resulted in banding on slightly down/upscaled images. Fixed a rounding error in coef5_M9. Also removed ARRAY_LEN macro as ARRAY_SIZE is the standard linux one. Signed-off-by: Lajos Molnar la...@ti.com Signed-off-by: Archit Taneja arc...@ti.com --- drivers/video/omap2/dss/dispc_coefs.c |9 - 1 files changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/video/omap2/dss/dispc_coefs.c b/drivers/video/omap2/dss/dispc_coefs.c index 069bccb..038c15b 100644 --- a/drivers/video/omap2/dss/dispc_coefs.c +++ b/drivers/video/omap2/dss/dispc_coefs.c @@ -19,14 +19,13 @@ #include linux/kernel.h #include video/omapdss.h -#include dispc.h -#define ARRAY_LEN(array) (sizeof(array) / sizeof(array[0])) +#include dispc.h static const struct dispc_coef coef3_M8[8] = { { 0, 0, 128, 0, 0 }, { 0, -4, 123, 9, 0 }, - { 0, -4, 108, 87, 0 }, + { 0, -4, 108, 24, 0 }, { 0, -2, 87, 43, 0 }, { 0, 64, 64, 0, 0 }, { 0, 43, 87, -2, 0 }, @@ -168,7 +167,7 @@ static const struct dispc_coef coef5_M8[8] = { static const struct dispc_coef coef5_M9[8] = { { -3, 10, 114, 10, -3 }, - { -6, 24, 110, 0, -1 }, + { -6, 24, 111, 0, -1 }, { -8, 40, 103, -7, 0 }, { -11, 58, 91, -11, 1 }, { 0, -12, 76, 76, -12 }, @@ -319,7 +318,7 @@ const struct dispc_coef *dispc_ovl_get_scale_coef(int inc, int five_taps) }; inc /= 128; - for (i = 0; i ARRAY_LEN(coefs); ++i) + for (i = 0; i ARRAY_SIZE(coefs); ++i) if (inc = coefs[i].Mmin inc = coefs[i].Mmax) return five_taps ? coefs[i].coef_5 : coefs[i].coef_3; return NULL; -- 1.7.5.4 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 3/3] OMAPDSS: DSS: Add runtime_pm protection around wait_for_vsync.
From: Lajos Molnar la...@ti.com If DSS is suspended during a wait_for_vsync operation, it may loose its clock. Request runtime_pm around wait_for_vsync. Signed-off-by: Lajos Molnar la...@ti.com Signed-off-by: Archit Taneja arc...@ti.com --- drivers/video/omap2/dss/dispc.c | 16 +++- 1 files changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c index df6259e..dd08356 100644 --- a/drivers/video/omap2/dss/dispc.c +++ b/drivers/video/omap2/dss/dispc.c @@ -3228,11 +3228,15 @@ int omap_dispc_wait_for_irq_interruptible_timeout(u32 irqmask, int r; DECLARE_COMPLETION_ONSTACK(completion); + r = dispc_runtime_get(); + if (r) + return r; + r = omap_dispc_register_isr(dispc_irq_wait_handler, completion, irqmask); if (r) - return r; + goto done; timeout = wait_for_completion_interruptible_timeout(completion, timeout); @@ -3240,12 +3244,14 @@ int omap_dispc_wait_for_irq_interruptible_timeout(u32 irqmask, omap_dispc_unregister_isr(dispc_irq_wait_handler, completion, irqmask); if (timeout == 0) - return -ETIMEDOUT; + r = -ETIMEDOUT; + else if (timeout == -ERESTARTSYS) + r = timeout; - if (timeout == -ERESTARTSYS) - return -ERESTARTSYS; +done: + dispc_runtime_put(); - return 0; + return r; } #ifdef CONFIG_OMAP2_DSS_FAKE_VSYNC -- 1.7.5.4 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCHv5 02/14] arm: omap: voltage: renamed vp_vddmin and vp_vddmax fields
On Tue, Feb 21, 2012 at 08:04, Tero Kristo t-kri...@ti.com wrote: These are now called vddmin and vddmax, as these fields will be used globally for selecting voltage ranges for a pmic channel, and not only for voltage processor. NAK. I think we need to setup voltage for SoC limits as well. the programmed voltage to the VP register should be: VP-vlimito-min = MAX(soc-vdd_min, pmic-vdd_min) VP-vlimito-max = MIN(soc-vdd_max, pmic-vdd_max) else you could be running the SoC beyond design voltage potentially damaging the device. Regards, Nishanth Menon Signed-off-by: Tero Kristo t-kri...@ti.com --- arch/arm/mach-omap2/omap_twl.c | 27 ++- arch/arm/mach-omap2/voltage.h | 4 ++-- arch/arm/mach-omap2/vp.c | 4 ++-- 3 files changed, 14 insertions(+), 21 deletions(-) diff --git a/arch/arm/mach-omap2/omap_twl.c b/arch/arm/mach-omap2/omap_twl.c index df4e7c3..5224fbd 100644 --- a/arch/arm/mach-omap2/omap_twl.c +++ b/arch/arm/mach-omap2/omap_twl.c @@ -149,8 +149,8 @@ static struct omap_voltdm_pmic omap3_mpu_pmic = { .vp_erroroffset = OMAP3_VP_CONFIG_ERROROFFSET, .vp_vstepmin = OMAP3_VP_VSTEPMIN_VSTEPMIN, .vp_vstepmax = OMAP3_VP_VSTEPMAX_VSTEPMAX, - .vp_vddmin = OMAP3430_VP1_VLIMITTO_VDDMIN, - .vp_vddmax = OMAP3430_VP1_VLIMITTO_VDDMAX, + .vddmin = 60, + .vddmax = 145, .vp_timeout_us = OMAP3_VP_VLIMITTO_TIMEOUT_US, .i2c_slave_addr = OMAP3_SRI2C_SLAVE_ADDR, .volt_reg_addr = OMAP3_VDD_MPU_SR_CONTROL_REG, @@ -170,8 +170,8 @@ static struct omap_voltdm_pmic omap3_core_pmic = { .vp_erroroffset = OMAP3_VP_CONFIG_ERROROFFSET, .vp_vstepmin = OMAP3_VP_VSTEPMIN_VSTEPMIN, .vp_vstepmax = OMAP3_VP_VSTEPMAX_VSTEPMAX, - .vp_vddmin = OMAP3430_VP2_VLIMITTO_VDDMIN, - .vp_vddmax = OMAP3430_VP2_VLIMITTO_VDDMAX, + .vddmin = 60, + .vddmax = 145, .vp_timeout_us = OMAP3_VP_VLIMITTO_TIMEOUT_US, .i2c_slave_addr = OMAP3_SRI2C_SLAVE_ADDR, .volt_reg_addr = OMAP3_VDD_CORE_SR_CONTROL_REG, @@ -191,8 +191,8 @@ static struct omap_voltdm_pmic omap4_mpu_pmic = { .vp_erroroffset = OMAP4_VP_CONFIG_ERROROFFSET, .vp_vstepmin = OMAP4_VP_VSTEPMIN_VSTEPMIN, .vp_vstepmax = OMAP4_VP_VSTEPMAX_VSTEPMAX, - .vp_vddmin = OMAP4_VP_MPU_VLIMITTO_VDDMIN, - .vp_vddmax = OMAP4_VP_MPU_VLIMITTO_VDDMAX, + .vddmin = 0, + .vddmax = 150, .vp_timeout_us = OMAP4_VP_VLIMITTO_TIMEOUT_US, .i2c_slave_addr = OMAP4_SRI2C_SLAVE_ADDR, .volt_reg_addr = OMAP4_VDD_MPU_SR_VOLT_REG, @@ -213,8 +213,8 @@ static struct omap_voltdm_pmic omap4_iva_pmic = { .vp_erroroffset = OMAP4_VP_CONFIG_ERROROFFSET, .vp_vstepmin = OMAP4_VP_VSTEPMIN_VSTEPMIN, .vp_vstepmax = OMAP4_VP_VSTEPMAX_VSTEPMAX, - .vp_vddmin = OMAP4_VP_IVA_VLIMITTO_VDDMIN, - .vp_vddmax = OMAP4_VP_IVA_VLIMITTO_VDDMAX, + .vddmin = 0, + .vddmax = 150, .vp_timeout_us = OMAP4_VP_VLIMITTO_TIMEOUT_US, .i2c_slave_addr = OMAP4_SRI2C_SLAVE_ADDR, .volt_reg_addr = OMAP4_VDD_IVA_SR_VOLT_REG, @@ -235,8 +235,8 @@ static struct omap_voltdm_pmic omap4_core_pmic = { .vp_erroroffset = OMAP4_VP_CONFIG_ERROROFFSET, .vp_vstepmin = OMAP4_VP_VSTEPMIN_VSTEPMIN, .vp_vstepmax = OMAP4_VP_VSTEPMAX_VSTEPMAX, - .vp_vddmin = OMAP4_VP_CORE_VLIMITTO_VDDMIN, - .vp_vddmax = OMAP4_VP_CORE_VLIMITTO_VDDMAX, + .vddmin = 0, + .vddmax = 150, .vp_timeout_us = OMAP4_VP_VLIMITTO_TIMEOUT_US, .i2c_slave_addr = OMAP4_SRI2C_SLAVE_ADDR, .volt_reg_addr = OMAP4_VDD_CORE_SR_VOLT_REG, @@ -271,13 +271,6 @@ int __init omap3_twl_init(void) if (!cpu_is_omap34xx()) return -ENODEV; - if (cpu_is_omap3630()) { - omap3_mpu_pmic.vp_vddmin = OMAP3630_VP1_VLIMITTO_VDDMIN; - omap3_mpu_pmic.vp_vddmax = OMAP3630_VP1_VLIMITTO_VDDMAX; - omap3_core_pmic.vp_vddmin = OMAP3630_VP2_VLIMITTO_VDDMIN; - omap3_core_pmic.vp_vddmax = OMAP3630_VP2_VLIMITTO_VDDMAX; - } - /* * The smartreflex bit on twl4030 specifies if the setting of voltage * is done over the I2C_SR path. Since this setting is independent of diff --git a/arch/arm/mach-omap2/voltage.h
Re: [PATCHv5 06/14] arm: omap: add support for oscillator setup
On Tue, Feb 21, 2012 at 08:04, Tero Kristo t-kri...@ti.com wrote: This contains startup and shutdown times for the oscillator. By default use ULONG_MAX. Oscillator setup is used for calculating and setting up latencies for sleep modes that disable oscillator. Signed-off-by: Tero Kristo t-kri...@ti.com --- arch/arm/mach-omap2/pm.c | 27 +++ arch/arm/mach-omap2/pm.h | 8 2 files changed, 35 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c index 1881fe9..2402e8e 100644 --- a/arch/arm/mach-omap2/pm.c +++ b/arch/arm/mach-omap2/pm.c @@ -28,6 +28,33 @@ static struct omap_device_pm_latency *pm_lats; +/** + * struct omap2_oscillator - Describe the board main oscillator latencies + * @startup_time: oscillator startup latency + * @shutdown_time: oscillator shutdown latency + */ +struct omap2_oscillator { + u32 startup_time; + u32 shutdown_time; +}; + +static struct omap2_oscillator oscillator = { + .startup_time = ULONG_MAX, + .shutdown_time = ULONG_MAX, +}; + +void omap_pm_setup_oscillator(u32 tstart, u32 tshut) +{ + oscillator.startup_time = tstart; + oscillator.shutdown_time = tshut; +} + +void omap_pm_get_oscillator(u32 *tstart, u32 *tshut) +{ Maybe a nitpick - variable check needed? Regards, Nishanth Menon + *tstart = oscillator.startup_time; + *tshut = oscillator.shutdown_time; +} + static int _init_omap_device(char *name) { struct omap_hwmod *oh; diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h index ec8f874..797d2da 100644 --- a/arch/arm/mach-omap2/pm.h +++ b/arch/arm/mach-omap2/pm.h @@ -141,4 +141,12 @@ static inline int omap4_twl_init(void) } #endif +#ifdef CONFIG_PM +extern void omap_pm_setup_oscillator(u32 tstart, u32 tshut); +extern void omap_pm_get_oscillator(u32 *tstart, u32 *tshut); +#else +static inline void omap_pm_setup_oscillator(u32 tstart, u32 tshut) { } +static inline void omap_pm_get_oscillator(u32 *tstart, u32 *tshut) { } +#endif + #endif -- 1.7.4.1 ___ linux-arm-kernel mailing list linux-arm-ker...@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCHv5 02/14] arm: omap: voltage: renamed vp_vddmin and vp_vddmax fields
On Tue, Feb 21, 2012 at 08:40:22AM -0600, Menon, Nishanth wrote: On Tue, Feb 21, 2012 at 08:04, Tero Kristo t-kri...@ti.com wrote: These are now called vddmin and vddmax, as these fields will be used globally for selecting voltage ranges for a pmic channel, and not only for voltage processor. NAK. I think we need to setup voltage for SoC limits as well. the programmed voltage to the VP register should be: VP-vlimito-min = MAX(soc-vdd_min, pmic-vdd_min) VP-vlimito-max = MIN(soc-vdd_max, pmic-vdd_max) else you could be running the SoC beyond design voltage potentially damaging the device. And if you're doing that kind of thing, you must also check that the resulting min and max are sane. In other words, the minimum is less than the maximum. Sure, it's something that should never happen (because it would be a design error) but if it did happen... -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCHv5 02/14] arm: omap: voltage: renamed vp_vddmin and vp_vddmax fields
On Tue, 2012-02-21 at 14:53 +, Russell King - ARM Linux wrote: On Tue, Feb 21, 2012 at 08:40:22AM -0600, Menon, Nishanth wrote: On Tue, Feb 21, 2012 at 08:04, Tero Kristo t-kri...@ti.com wrote: These are now called vddmin and vddmax, as these fields will be used globally for selecting voltage ranges for a pmic channel, and not only for voltage processor. NAK. I think we need to setup voltage for SoC limits as well. the programmed voltage to the VP register should be: VP-vlimito-min = MAX(soc-vdd_min, pmic-vdd_min) VP-vlimito-max = MIN(soc-vdd_max, pmic-vdd_max) This kind of code is actually introduced in patch #7 of this set. VP part of the code calculates the voltage processor vlimitto values in omap_vp_init. VC limits are handled in omap_vc_init_channel / omap_vc_calc_vsel. else you could be running the SoC beyond design voltage potentially damaging the device. And if you're doing that kind of thing, you must also check that the resulting min and max are sane. In other words, the minimum is less than the maximum. Sure, it's something that should never happen (because it would be a design error) but if it did happen... This could be added yes, current code assumes the limits themselves are at least somewhat sane, doesn't hurt to add a kern dump for this case I think as it sounds rather fatal. -Tero -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCHv5 02/14] arm: omap: voltage: renamed vp_vddmin and vp_vddmax fields
On 17:32-20120221, Tero Kristo wrote: On Tue, 2012-02-21 at 14:53 +, Russell King - ARM Linux wrote: On Tue, Feb 21, 2012 at 08:40:22AM -0600, Menon, Nishanth wrote: On Tue, Feb 21, 2012 at 08:04, Tero Kristo t-kri...@ti.com wrote: These are now called vddmin and vddmax, as these fields will be used globally for selecting voltage ranges for a pmic channel, and not only for voltage processor. NAK. I think we need to setup voltage for SoC limits as well. the programmed voltage to the VP register should be: VP-vlimito-min = MAX(soc-vdd_min, pmic-vdd_min) VP-vlimito-max = MIN(soc-vdd_max, pmic-vdd_max) This kind of code is actually introduced in patch #7 of this set. VP part of the code calculates the voltage processor vlimitto values in omap_vp_init. VC limits are handled in omap_vc_init_channel / omap_vc_calc_vsel. Apologies , you are right #7 does indeed take this into consideration probably belongs to #7, but, we also need to ensure that vp forceupdate and vc_bypass actually keep to the requirement as well. else you could be running the SoC beyond design voltage potentially damaging the device. And if you're doing that kind of thing, you must also check that the resulting min and max are sane. In other words, the minimum is less than the maximum. Sure, it's something that should never happen (because it would be a design error) but if it did happen... This could be added yes, current code assumes the limits themselves are at least somewhat sane, doesn't hurt to add a kern dump for this case I think as it sounds rather fatal. I agree - it is indeed the case. -- Regards, Nishanth Menon -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 3/3] OMAPDSS: DSS: Add runtime_pm protection around wait_for_vsync.
On Tue, 2012-02-21 at 19:36 +0530, Archit Taneja wrote: From: Lajos Molnar la...@ti.com If DSS is suspended during a wait_for_vsync operation, it may loose its clock. Request runtime_pm around wait_for_vsync. Signed-off-by: Lajos Molnar la...@ti.com Signed-off-by: Archit Taneja arc...@ti.com --- drivers/video/omap2/dss/dispc.c | 16 +++- 1 files changed, 11 insertions(+), 5 deletions(-) This only handles omap_dispc_wait_for_irq_interruptible_timeout(), there's also omap_dispc_wait_for_irq_timeout(). However, I think it'd be better to do the runtime_get/put in the caller, instead of in these dispc's wait funcs. While it doesn't really matter with dss_mgr_wait_for_vsync(), for dss_mgr/ovl_wait_for_go() it makes much more sense to get/put there just once, instead of every time the omap_dispc_wait_* is called. Tomi signature.asc Description: This is a digitally signed message part
Re: [PATCH v3 2/3] MFD: twl6040: Convert to i2c driver, and separate it from twl core
* Peter Ujfalusi peter.ujfal...@ti.com [120210 01:29]: Complete the separation of the twl6040 from the twl core since it is a separate chip, not part of the twl6030 PMIC. Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com Reviewed-by: Mark Brown broo...@opensource.wolfsonicro.com This should be OK to merge via the ASoC tree: Acked-by: Tony Lindgren t...@atomide.com -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v3 0/3] MFD: twl6040: Conversion to i2c driver
* Liam Girdwood l...@ti.com [120221 09:21]: On Tue, 2012-02-21 at 12:05 +0100, Samuel Ortiz wrote: Hi Peter, On Tue, Feb 21, 2012 at 12:33:07PM +0200, Peter Ujfalusi wrote: I'm not sure hwo we could handle that properly. Either by letting Tony carrying this patchset, or by sending me the panda patch that adds those structures. As you prefer. If Liam would take this series that would be probably the way forward. If he does not have objections. Liam: I can create a branch for you to pull from as soon as all other patch receives the needed acks... Samuel: if Liam agrees is it possible for you to drop the twl6040 related patches from your for-next branch? That would make sense to me, yes. Liam, if you're ok with taking it, please add my: Acked-by: Samuel Ortiz sa...@linux.intel.com Ok, sounds fine by me. Tony is this fine wrt the OMAP board file updates ? Yeah looks OK to me, acked that patch. Let me know if there are others I should look. Thanks, Tony -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] ARM: OMAP2+: gpmc-smsc911x: add required smsc911x regulators
* Mark Brown broo...@opensource.wolfsonmicro.com [120213 10:27]: On Mon, Feb 13, 2012 at 10:14:10AM -0800, Tony Lindgren wrote: * Russell King - ARM Linux li...@arm.linux.org.uk [120213 09:31]: On Mon, Feb 13, 2012 at 09:52:34AM -0800, Tony Lindgren wrote: Can't we just leave out the .id and have it automatically assigned? It'd be nice but... Unfortunately, there's no such infrastructure in the driver model. Hmm OK, -1 seems to be just used for name in platform_device_add(). -1 is a valid ID also, it means there's only one of these things so don't display a number. Which is sad but there we are. I'm at ELC/ABS so I might try and find Greg in person here to see if we can come up with something better, it seems like this is something the core ought to be able to help with in much the same way that the USB stuff can. Matt, care to refresh your original patch using some other number so we can apply it as a regression fix for the -rc series while the long term solution is being discussed? Just use some random number for now with a comment, 42? Regards, Tony -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] gpio/omap: fix wakeups on level-triggered GPIOs
While both level- and edge-triggered GPIOs are capable of generating interrupts, only edge-triggered GPIOs are capable of generating a module-level wakeup to the PRCM (c.f. 34xx NDA TRM section 25.5.3.2.) In order to ensure that devices using level-triggered GPIOs as interrupts can also cause wakeups (e.g. from idle), this patch enables edge-triggering for wakeup-enabled, level-triggered GPIOs when a GPIO bank is runtime-suspended (which also happens during idle.) This fixes a problem found in GPMC-connected network cards with GPIO interrupts (e.g. smsc911x on Zoom3, Overo, ...) where network booting with NFSroot was very slow since the GPIO IRQs used by the NIC were not generating PRCM wakeups, and thus not waking the system from idle. NOTE: until v3.3, this boot-time problem was somewhat masked because the UART init prevented WFI during boot until the full serial driver was available. Preventing WFI allowed regular GPIO interrupts to fire and this problem was not seen. After the UART runtime PM cleanups, we no longer avoid WFI during boot, so GPIO IRQs that were not causing wakeups resulted in very slow IRQ response times. Tested on platforms using level-triggered GPIOs for network IRQs using the SMSC911x NIC: 3530/Overo and 3630/Zoom3. Reported-by: Tony Lindgren t...@atomide.com Signed-off-by: Kevin Hilman khil...@ti.com --- This applies on top of the GPIO cleanup and runtime PM conversion series which has been submitted for v3.4 and also available here: git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm.git for_3.4/gpio/runtime-pm-cleanup drivers/gpio/gpio-omap.c | 34 ++ 1 files changed, 34 insertions(+), 0 deletions(-) diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index f49bd6f..752ae9b 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c @@ -1196,8 +1196,30 @@ static int omap_gpio_runtime_suspend(struct device *dev) struct gpio_bank *bank = platform_get_drvdata(pdev); u32 l1 = 0, l2 = 0; unsigned long flags; + u32 wake_low, wake_hi; spin_lock_irqsave(bank-lock, flags); + + /* +* Only edges can generate a wakeup event to the PRCM. +* +* Therefore, ensure any wake-up capable GPIOs have +* edge-detection enabled before going idle to ensure a wakeup +* to the PRCM is generated on a GPIO transition. (c.f. 34xx +* NDA TRM 25.5.3.1) +* +* The normal values will be restored upon -runtime_resume() +* by writing back the values saved in bank-context. +*/ + wake_low = bank-context.leveldetect0 bank-context.wake_en; + if (wake_low) + __raw_writel(wake_low | bank-context.fallingdetect, +bank-base + bank-regs-fallingdetect); + wake_hi = bank-context.leveldetect1 bank-context.wake_en; + if (wake_hi) + __raw_writel(wake_hi | bank-context.risingdetect, +bank-base + bank-regs-risingdetect); + if (bank-power_mode != OFF_MODE) { bank-power_mode = 0; goto update_gpio_context_count; @@ -1246,6 +1268,18 @@ static int omap_gpio_runtime_resume(struct device *dev) spin_lock_irqsave(bank-lock, flags); _gpio_dbck_enable(bank); + + /* +* In -runtime_suspend(), level-triggered, wakeup-enabled +* GPIOs were set to edge trigger also in order to be able to +* generate a PRCM wakeup. Here we restore the +* pre-runtime_suspend() values for edge triggering. +*/ + __raw_writel(bank-context.fallingdetect, +bank-base + bank-regs-fallingdetect); + __raw_writel(bank-context.risingdetect, +bank-base + bank-regs-risingdetect); + if (!bank-enabled_non_wakeup_gpios || !bank-workaround_enabled) { spin_unlock_irqrestore(bank-lock, flags); return 0; -- 1.7.9 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 0/2] Two trivial omap/serial patches
NeilBrown ne...@suse.de writes: Just a couple of small clean-ups following the recent major changes. Thanks Neil. I'll queue these as cleanups for v3.4 since I dont' think they're v3.3 material at this point of the cycle. I'll also update the changelogs to follow the practice of adding the shortlog in parens after the commit ID. Kevin Thanks, NeilBrown --- NeilBrown (2): ARM: OMAP2: remove some orphan function declarations. ARM: OMAP2+: UART: remove unused fields in omap_uart_state. arch/arm/mach-omap2/pm.h |1 - arch/arm/mach-omap2/serial.c |4 arch/arm/plat-omap/include/plat/serial.h |1 - 3 files changed, 0 insertions(+), 6 deletions(-) -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 0/2] Two trivial omap/serial patches
On Tue, 21 Feb 2012 11:10:30 -0800 Kevin Hilman khil...@ti.com wrote: NeilBrown ne...@suse.de writes: Just a couple of small clean-ups following the recent major changes. Thanks Neil. I'll queue these as cleanups for v3.4 since I dont' think they're v3.3 material at this point of the cycle. Thanks, I'll also update the changelogs to follow the practice of adding the shortlog in parens after the commit ID. I'll try to remember that for next time. Thanks, NeilBrown signature.asc Description: PGP signature
Re: [PATCH] ARM: OMAP2+: gpmc-smsc911x: add required smsc911x regulators
On Tue, Feb 21, 2012 at 10:46:48AM -0800, Tony Lindgren wrote: * Mark Brown broo...@opensource.wolfsonmicro.com [120213 10:27]: On Mon, Feb 13, 2012 at 10:14:10AM -0800, Tony Lindgren wrote: * Russell King - ARM Linux li...@arm.linux.org.uk [120213 09:31]: On Mon, Feb 13, 2012 at 09:52:34AM -0800, Tony Lindgren wrote: Can't we just leave out the .id and have it automatically assigned? It'd be nice but... Unfortunately, there's no such infrastructure in the driver model. Hmm OK, -1 seems to be just used for name in platform_device_add(). -1 is a valid ID also, it means there's only one of these things so don't display a number. Which is sad but there we are. I'm at ELC/ABS so I might try and find Greg in person here to see if we can come up with something better, it seems like this is something the core ought to be able to help with in much the same way that the USB stuff can. Matt, care to refresh your original patch using some other number so we can apply it as a regression fix for the -rc series while the long term solution is being discussed? Just use some random number for now with a comment, 42? Will do, I'll post an update with this approach. -Matt -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/3] tty: serial: OMAP: block idle while the UART is transferring data in PIO mode
Salut Benoît, On Mon, 20 Feb 2012, Cousson, Benoit wrote: 3.3-rc4 is broken in the DT case because of the serial driver. And it looks like it is due to this fix. We cannot rely on pdata anymore in DT, and in that case it leads to an Oops due to NULL pdata. Sorry about the breakage. I agree with the diagnosis. That code was just copied from the DMA errata part of the driver, so it will need to be fixed as well. Otherwise the same problem will happen when DMA is enabled. And then we will have to add the support for all these OMAP custom hooks without pdata. That's really the key question for the medium- to long-term... A basic fix (below) for the moment is to test for valid pdata inside the driver. I'll repost it properly if you are fine with it. Looks fine to me, although I'd suggest fixing the DMA workaround path as well. Reviewed-by: Paul Walmsley p...@pwsan.com - Paul
[PATCH] ARM: OMAP: omap_device: remove omap_device_parent
Currently all omap_devices are forced to have the dummy device 'omap_device_parent' as a parent. This was used to distinguish omap_devices from normal platform_devices in the OMAP PM core code. Now that we implement the PM core using PM domains, this is no longer needed, and is removed. This also frees up omap_devices to have a more complex parent/child relationships that model actual device relationships. The only in-tree user of omap_device_parent was the OMAP PM layer to handle lost-context count for omap_devices. That is now converted to use the presence of the omap_device_pm_domain instead. Signed-off-by: Kevin Hilman khil...@ti.com --- Unless there are objections, this will be queued for 3.4 in my for_3.4/cleanup/pm branch. arch/arm/plat-omap/include/plat/omap_device.h |2 +- arch/arm/plat-omap/omap-pm-noop.c |2 +- arch/arm/plat-omap/omap_device.c | 12 ++-- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/arch/arm/plat-omap/include/plat/omap_device.h b/arch/arm/plat-omap/include/plat/omap_device.h index 51423d2..d93ac93 100644 --- a/arch/arm/plat-omap/include/plat/omap_device.h +++ b/arch/arm/plat-omap/include/plat/omap_device.h @@ -36,7 +36,7 @@ #include plat/omap_hwmod.h -extern struct device omap_device_parent; +extern struct dev_pm_domain omap_device_pm_domain; /* omap_device._state values */ #define OMAP_DEVICE_STATE_UNKNOWN 0 diff --git a/arch/arm/plat-omap/omap-pm-noop.c b/arch/arm/plat-omap/omap-pm-noop.c index 3dc3801..5a97b4d 100644 --- a/arch/arm/plat-omap/omap-pm-noop.c +++ b/arch/arm/plat-omap/omap-pm-noop.c @@ -319,7 +319,7 @@ int omap_pm_get_dev_context_loss_count(struct device *dev) if (WARN_ON(!dev)) return -ENODEV; - if (dev-parent == omap_device_parent) { + if (dev-pm_domain == omap_device_pm_domain) { count = omap_device_get_context_loss_count(pdev); } else { WARN_ONCE(off_mode_enabled, omap_pm: using dummy context loss counter; device %s should be converted to omap_device, diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c index e8d9869..3643900 100644 --- a/arch/arm/plat-omap/omap_device.c +++ b/arch/arm/plat-omap/omap_device.c @@ -320,8 +320,6 @@ static void _add_hwmod_clocks_clkdev(struct omap_device *od, } -static struct dev_pm_domain omap_device_pm_domain; - /** * omap_device_build_from_dt - build an omap_device with multiple hwmods * @pdev_name: name of the platform_device driver to use @@ -799,7 +797,7 @@ static int _od_resume_noirq(struct device *dev) #define _od_resume_noirq NULL #endif -static struct dev_pm_domain omap_device_pm_domain = { +struct dev_pm_domain omap_device_pm_domain = { .ops = { SET_RUNTIME_PM_OPS(_od_runtime_suspend, _od_runtime_resume, _od_runtime_idle) @@ -821,7 +819,6 @@ static int omap_device_register(struct platform_device *pdev) { pr_debug(omap_device: %s: registering\n, pdev-name); - pdev-dev.parent = omap_device_parent; pdev-dev.pm_domain = omap_device_pm_domain; return platform_device_add(pdev); } @@ -1130,11 +1127,6 @@ int omap_device_enable_clocks(struct omap_device *od) return 0; } -struct device omap_device_parent = { - .init_name = omap, - .parent = platform_bus, -}; - static struct notifier_block platform_nb = { .notifier_call = _omap_device_notifier_call, }; @@ -1142,6 +1134,6 @@ static struct notifier_block platform_nb = { static int __init omap_device_init(void) { bus_register_notifier(platform_bus_type, platform_nb); - return device_register(omap_device_parent); + return 0; } core_initcall(omap_device_init); -- 1.7.9 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 0/3] Move most of omap io.h into omap-iomap.h
* Tony Lindgren t...@atomide.com [120214 08:47]: * Tony Lindgren t...@atomide.com [120213 15:22]: Hi all, This is intended as clean-up before we apply Rob Herring's series to remove mach/io.h. Need to update this to fix up more driver modules though. Also we can move almost everything into local iomap.h files. So let's scrap this series, I will post a new series shortly. Regards, Tony -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] OMAP3 EVM: remove out-of-bounds array access of gpio_leds.
* Arnout Vandecappelle (Essensium/Mind) arn...@mind.be [120213 00:04]: From: Arnout Vandecappelle (Essensium/Mind) arn...@mind.be The omap3evm BSP enables a GPIO LED on the twl4030 chip. However, the static gpio_leds array doesn't have an entry for it. This is most likely a copy-and-paste error, because it has been in there since the first commit of the omap3evm BSP (53c5ec31). Signed-off-by: Arnout Vandecappelle (Essensium/Mind) arn...@mind.be --- Please CC me, I'm not on the list. Since I don't have access to an OMAP3EVM board or schematics, I couldn't actually test if my fix is correct. I discovered the error because I'm using this BSP for an AM37xEVM board - which has the LED connected to a different GPIO. It works on the AM37xEVM board if I replace the assignment with the correct GPIO number (8). Thanks, applying it into fixes. Regards, Tony -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 0/8] Split omap plat/io.h into local iomap.h files
Hi all, Here's a better version of a patch set to cut down mach/io.h down to minimum to prepare for mach/io.h removal for omap2+. This is based on v3.3-rc4 + ARM: OMAP2xxx: PM: remove obsolete timer disable code in the suspend path patch. Regards, Tony --- Tony Lindgren (8): ARM: OMAP2+: Move DISPC L3 firewall to happen in omap_display_init() ARM: OMAP2+: Move SDRC related functions from io.h into local common.h ARM: OMAP: Move omap_init_consistent_dma_size() to local common.h ARM: OMAP1: Move 16xx GPIO system clock to platform init code ARM: OMAP1: Move most of plat/io.h into local iomap.h ARM: OMAP2+: Move most of plat/io.h into local iomap.h ARM: OMAP: Remove plat/io.h by moving it into mach/io.h ARM: OMAP2+: Limit omap_read/write usage to legacy USB drivers arch/arm/mach-omap1/ams-delta-fiq-handler.S|3 - arch/arm/mach-omap1/ams-delta-fiq.c|1 arch/arm/mach-omap1/board-ams-delta.c | 10 +- arch/arm/mach-omap1/board-fsample.c|7 +- arch/arm/mach-omap1/board-h2.c |6 + arch/arm/mach-omap1/board-h3.c |8 +- arch/arm/mach-omap1/board-htcherald.c |5 - arch/arm/mach-omap1/board-innovator.c |7 +- arch/arm/mach-omap1/board-nokia770.c |6 + arch/arm/mach-omap1/board-osk.c|7 +- arch/arm/mach-omap1/board-palmte.c |4 + arch/arm/mach-omap1/board-palmtt.c |9 +- arch/arm/mach-omap1/board-palmz71.c|9 +- arch/arm/mach-omap1/board-perseus2.c |7 +- arch/arm/mach-omap1/board-sx1.c|6 + arch/arm/mach-omap1/board-voiceblue.c |6 + arch/arm/mach-omap1/clock.c|2 arch/arm/mach-omap1/clock_data.c |2 arch/arm/mach-omap1/common.h |1 arch/arm/mach-omap1/devices.c |8 +- arch/arm/mach-omap1/dma.c |2 arch/arm/mach-omap1/flash.c|2 arch/arm/mach-omap1/fpga.c |5 + arch/arm/mach-omap1/gpio16xx.c |7 ++ arch/arm/mach-omap1/id.c |1 arch/arm/mach-omap1/include/mach/entry-macro.S |4 + arch/arm/mach-omap1/include/mach/io.h | 78 +++ arch/arm/mach-omap1/io.c |3 + arch/arm/mach-omap1/iomap.h| 18 arch/arm/mach-omap1/irq.c |4 + arch/arm/mach-omap1/lcd_dma.c |3 - arch/arm/mach-omap1/mcbsp.c|5 + arch/arm/mach-omap1/pm.c |6 + arch/arm/mach-omap1/reset.c|3 - arch/arm/mach-omap1/sleep.S|4 + arch/arm/mach-omap1/sram.S |4 + arch/arm/mach-omap1/time.c |3 - arch/arm/mach-omap1/timer32k.c |7 +- arch/arm/mach-omap2/clock2420_data.c |1 arch/arm/mach-omap2/clock2430.c|1 arch/arm/mach-omap2/clock2430_data.c |1 arch/arm/mach-omap2/clock3xxx_data.c |3 - arch/arm/mach-omap2/clock44xx_data.c |3 + arch/arm/mach-omap2/cm2xxx_3xxx.c |2 arch/arm/mach-omap2/cm44xx.c |2 arch/arm/mach-omap2/cminst44xx.c |2 arch/arm/mach-omap2/common.c |4 - arch/arm/mach-omap2/common.h |7 ++ arch/arm/mach-omap2/control.c |3 - arch/arm/mach-omap2/control.h |1 arch/arm/mach-omap2/devices.c |2 arch/arm/mach-omap2/display.c |4 + arch/arm/mach-omap2/include/mach/io.h | 60 ++- arch/arm/mach-omap2/io.c | 57 ++ arch/arm/mach-omap2/iomap.h| 98 arch/arm/mach-omap2/irq.c |5 + arch/arm/mach-omap2/omap-smp.c |3 - arch/arm/mach-omap2/pm24xx.c |5 - arch/arm/mach-omap2/prcm_mpu44xx.c |2 arch/arm/mach-omap2/prm44xx.c |3 - arch/arm/mach-omap2/prminst44xx.c |2 arch/arm/mach-omap2/sdram-nokia.c |1 arch/arm/mach-omap2/sdrc2xxx.c |5 + arch/arm/mach-omap2/sleep24xx.S|1 arch/arm/mach-omap2/sleep34xx.S|4 + arch/arm/mach-omap2/sram242x.S |4 + arch/arm/mach-omap2/sram243x.S |4 + arch/arm/mach-omap2/sram34xx.S |5 + arch/arm/plat-omap/dma.c |2 arch/arm/plat-omap/include/plat/tc.h |4 + arch/arm/plat-omap/include/plat/usb.h | 40 ++ arch/arm/plat-omap/sram.c |
[PATCH 1/8] ARM: OMAP2+: Move DISPC L3 firewall to happen in omap_display_init()
Otherwise we cannot move most of plat/io.h to be a local iomap.h for mach-omap2. Cc: Tomi Valkeinen tomi.valkei...@ti.com Cc: linux-fb...@vger.kernel.org Signed-off-by: Tony Lindgren t...@atomide.com --- arch/arm/mach-omap2/display.c |3 +++ drivers/video/omap2/dss/dispc.c |5 - 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c index 3677b1f..5a7f12f 100644 --- a/arch/arm/mach-omap2/display.c +++ b/arch/arm/mach-omap2/display.c @@ -191,6 +191,9 @@ int __init omap_display_init(struct omap_dss_board_info *board_data) memset(pdata, 0, sizeof(pdata)); if (cpu_is_omap24xx()) { + /* L3 firewall setting: enable access to OCM RAM */ + __raw_writel(0x402000b0, OMAP2_L3_IO_ADDRESS(0x680050a0)); + curr_dss_hwmod = omap2_dss_hwmod_data; oh_count = ARRAY_SIZE(omap2_dss_hwmod_data); } else if (cpu_is_omap34xx()) { diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c index e1626a1..cce0820 100644 --- a/drivers/video/omap2/dss/dispc.c +++ b/drivers/video/omap2/dss/dispc.c @@ -3272,11 +3272,6 @@ static void _omap_dispc_initial_config(void) if (dss_has_feature(FEAT_FUNCGATED)) REG_FLD_MOD(DISPC_CONFIG, 1, 9, 9); - /* L3 firewall setting: enable access to OCM RAM */ - /* XXX this should be somewhere in plat-omap */ - if (cpu_is_omap24xx()) - __raw_writel(0x402000b0, OMAP2_L3_IO_ADDRESS(0x680050a0)); - _dispc_setup_color_conv_coef(); dispc_set_loadmode(OMAP_DSS_LOAD_FRAME_ONLY); -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/8] ARM: OMAP2+: Move SDRC related functions from io.h into local common.h
These should be local to omap2/3/4. Signed-off-by: Tony Lindgren t...@atomide.com --- arch/arm/mach-omap2/common.h |5 + arch/arm/plat-omap/include/plat/io.h |4 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h index febffde..5aa1acb 100644 --- a/arch/arm/mach-omap2/common.h +++ b/arch/arm/mach-omap2/common.h @@ -235,5 +235,10 @@ static inline u32 omap4_mpuss_read_prev_context_state(void) return 0; } #endif + +struct omap_sdrc_params; +extern void omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0, + struct omap_sdrc_params *sdrc_cs1); + #endif /* __ASSEMBLER__ */ #endif /* __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H */ diff --git a/arch/arm/plat-omap/include/plat/io.h b/arch/arm/plat-omap/include/plat/io.h index 0696bae..f5b386b 100644 --- a/arch/arm/plat-omap/include/plat/io.h +++ b/arch/arm/plat-omap/include/plat/io.h @@ -266,10 +266,6 @@ extern void omap_writeb(u8 v, u32 pa); extern void omap_writew(u16 v, u32 pa); extern void omap_writel(u32 v, u32 pa); -struct omap_sdrc_params; -extern void omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0, - struct omap_sdrc_params *sdrc_cs1); - extern void __init omap_init_consistent_dma_size(void); #endif -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 3/8] ARM: OMAP: Move omap_init_consistent_dma_size() to local common.h
We don't want to keep it in io.h as we want to remove io.h for omap2+ for the common zImage support. Signed-off-by: Tony Lindgren t...@atomide.com --- arch/arm/mach-omap1/common.h |1 + arch/arm/mach-omap2/common.h |2 ++ arch/arm/plat-omap/include/plat/io.h |2 -- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-omap1/common.h b/arch/arm/mach-omap1/common.h index a9a5146..af658ad 100644 --- a/arch/arm/mach-omap1/common.h +++ b/arch/arm/mach-omap1/common.h @@ -58,5 +58,6 @@ void omap1_restart(char, const char *); extern struct sys_timer omap1_timer; extern bool omap_32k_timer_init(void); +extern void __init omap_init_consistent_dma_size(void); #endif /* __ARCH_ARM_MACH_OMAP1_COMMON_H */ diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h index 5aa1acb..f78ec4e 100644 --- a/arch/arm/mach-omap2/common.h +++ b/arch/arm/mach-omap2/common.h @@ -133,6 +133,8 @@ void am33xx_map_io(void); void omap4_map_io(void); void ti81xx_map_io(void); +extern void __init omap_init_consistent_dma_size(void); + /** * omap_test_timeout - busy-loop, testing a condition * @cond: condition to test until it evaluates to true diff --git a/arch/arm/plat-omap/include/plat/io.h b/arch/arm/plat-omap/include/plat/io.h index f5b386b..28cd796 100644 --- a/arch/arm/plat-omap/include/plat/io.h +++ b/arch/arm/plat-omap/include/plat/io.h @@ -266,8 +266,6 @@ extern void omap_writeb(u8 v, u32 pa); extern void omap_writew(u16 v, u32 pa); extern void omap_writel(u32 v, u32 pa); -extern void __init omap_init_consistent_dma_size(void); - #endif #endif -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 4/8] ARM: OMAP1: Move 16xx GPIO system clock to platform init code
This way we can remove omap_read/write call from the GPIO driver and remove include to linux/io.h. Cc: Grant Likely grant.lik...@secretlab.ca Signed-off-by: Tony Lindgren t...@atomide.com --- arch/arm/mach-omap1/gpio16xx.c |7 +++ drivers/gpio/gpio-omap.c |8 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-omap1/gpio16xx.c b/arch/arm/mach-omap1/gpio16xx.c index 0f399bd..99cabc4 100644 --- a/arch/arm/mach-omap1/gpio16xx.c +++ b/arch/arm/mach-omap1/gpio16xx.c @@ -218,6 +218,13 @@ static int __init omap16xx_gpio_init(void) if (!cpu_is_omap16xx()) return -EINVAL; + /* +* Enable system clock for GPIO module. +* The CAM_CLK_CTRL *is* really the right place. +*/ + omap_writel(omap_readl(ULPD_CAM_CLK_CTRL) | 0x04, + ULPD_CAM_CLK_CTRL); + for (i = 0; i ARRAY_SIZE(omap16xx_gpio_dev); i++) platform_device_register(omap16xx_gpio_dev[i]); diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index 0b05629..1078a14 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c @@ -18,7 +18,6 @@ #include linux/syscore_ops.h #include linux/err.h #include linux/clk.h -#include linux/io.h #include linux/slab.h #include linux/pm_runtime.h @@ -1064,13 +1063,6 @@ static void omap_gpio_mod_init(struct gpio_bank *bank, int id) + OMAP1610_GPIO_IRQSTATUS1); __raw_writew(0x0014, bank-base + OMAP1610_GPIO_SYSCONFIG); - - /* -* Enable system clock for GPIO module. -* The CAM_CLK_CTRL *is* really the right place. -*/ - omap_writel(omap_readl(ULPD_CAM_CLK_CTRL) | 0x04, - ULPD_CAM_CLK_CTRL); } if (cpu_is_omap7xx() bank-method == METHOD_GPIO_7XX) { __raw_writel(0x, bank-base -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 5/8] ARM: OMAP1: Move most of plat/io.h into local iomap.h
There's no need to have these in plat/io.h. While at it, clean up the includes to group them like they typically are grouped. Signed-off-by: Tony Lindgren t...@atomide.com --- arch/arm/mach-omap1/ams-delta-fiq-handler.S|3 ++- arch/arm/mach-omap1/ams-delta-fiq.c|1 + arch/arm/mach-omap1/board-ams-delta.c | 10 ++ arch/arm/mach-omap1/board-fsample.c|7 +-- arch/arm/mach-omap1/board-h2.c |6 +++--- arch/arm/mach-omap1/board-h3.c |8 arch/arm/mach-omap1/board-htcherald.c |5 ++--- arch/arm/mach-omap1/board-innovator.c |7 +-- arch/arm/mach-omap1/board-nokia770.c |6 -- arch/arm/mach-omap1/board-osk.c|7 +++ arch/arm/mach-omap1/board-palmte.c |4 +++- arch/arm/mach-omap1/board-palmtt.c |9 + arch/arm/mach-omap1/board-palmz71.c|9 + arch/arm/mach-omap1/board-perseus2.c |7 +-- arch/arm/mach-omap1/board-sx1.c|6 -- arch/arm/mach-omap1/board-voiceblue.c |6 -- arch/arm/mach-omap1/clock.c|2 +- arch/arm/mach-omap1/clock_data.c |2 +- arch/arm/mach-omap1/devices.c |8 arch/arm/mach-omap1/dma.c |2 +- arch/arm/mach-omap1/flash.c|2 +- arch/arm/mach-omap1/fpga.c |5 - arch/arm/mach-omap1/id.c |1 + arch/arm/mach-omap1/include/mach/entry-macro.S |4 +++- arch/arm/mach-omap1/io.c |3 +++ arch/arm/mach-omap1/iomap.h| 18 ++ arch/arm/mach-omap1/irq.c |4 +++- arch/arm/mach-omap1/lcd_dma.c |3 ++- arch/arm/mach-omap1/mcbsp.c|5 - arch/arm/mach-omap1/pm.c |6 -- arch/arm/mach-omap1/reset.c|3 ++- arch/arm/mach-omap1/sleep.S|4 arch/arm/mach-omap1/sram.S |4 arch/arm/mach-omap1/time.c |3 ++- arch/arm/mach-omap1/timer32k.c |7 +-- arch/arm/plat-omap/include/plat/io.h | 13 - 36 files changed, 128 insertions(+), 72 deletions(-) create mode 100644 arch/arm/mach-omap1/iomap.h diff --git a/arch/arm/mach-omap1/ams-delta-fiq-handler.S b/arch/arm/mach-omap1/ams-delta-fiq-handler.S index c1c5fb6..399c4c4 100644 --- a/arch/arm/mach-omap1/ams-delta-fiq-handler.S +++ b/arch/arm/mach-omap1/ams-delta-fiq-handler.S @@ -15,11 +15,12 @@ #include linux/linkage.h -#include plat/io.h #include plat/board-ams-delta.h #include mach/ams-delta-fiq.h +#include iomap.h + /* * GPIO related definitions, copied from arch/arm/plat-omap/gpio.c. * Unfortunately, those were not placed in a separate header file. diff --git a/arch/arm/mach-omap1/ams-delta-fiq.c b/arch/arm/mach-omap1/ams-delta-fiq.c index 152b32c..fcce7ff 100644 --- a/arch/arm/mach-omap1/ams-delta-fiq.c +++ b/arch/arm/mach-omap1/ams-delta-fiq.c @@ -22,6 +22,7 @@ #include plat/board-ams-delta.h #include asm/fiq.h + #include mach/ams-delta-fiq.h static struct fiq_handler fh = { diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c index 88909cc..ac65d7d 100644 --- a/arch/arm/mach-omap1/board-ams-delta.c +++ b/arch/arm/mach-omap1/board-ams-delta.c @@ -20,25 +20,27 @@ #include linux/platform_device.h #include linux/serial_8250.h #include linux/export.h +#include linux/io.h #include media/soc_camera.h #include asm/serial.h -#include mach/hardware.h #include asm/mach-types.h #include asm/mach/arch.h #include asm/mach/map.h -#include plat/io.h #include plat/board-ams-delta.h #include plat/keypad.h #include plat/mux.h #include plat/usb.h #include plat/board.h -#include common.h -#include mach/camera.h +#include mach/hardware.h #include mach/ams-delta-fiq.h +#include mach/camera.h + +#include iomap.h +#include common.h static u8 ams_delta_latch1_reg; static u16 ams_delta_latch2_reg; diff --git a/arch/arm/mach-omap1/board-fsample.c b/arch/arm/mach-omap1/board-fsample.c index 0b9464b..079292c 100644 --- a/arch/arm/mach-omap1/board-fsample.c +++ b/arch/arm/mach-omap1/board-fsample.c @@ -22,7 +22,6 @@ #include linux/input.h #include linux/smc91x.h -#include mach/hardware.h #include asm/mach-types.h #include asm/mach/arch.h #include asm/mach/map.h @@ -32,9 +31,13 @@ #include plat/flash.h #include plat/fpga.h #include plat/keypad.h -#include common.h #include plat/board.h +#include mach/hardware.h + +#include iomap.h +#include common.h + /* fsample is pretty close to p2-sample */ #define fsample_cpld_read(reg) __raw_readb(reg) diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c
[PATCH 6/8] ARM: OMAP2+: Move most of plat/io.h into local iomap.h
There's no need to have these defines in plat/io.h. Note that we now need to ifdef omap_read/write calls as they will be available for omap1 only. While at it, clean up the includes to group them like they typically are grouped. Signed-off-by: Tony Lindgren t...@atomide.com --- arch/arm/mach-omap2/clock2420_data.c |1 arch/arm/mach-omap2/clock2430.c |1 arch/arm/mach-omap2/clock2430_data.c |1 arch/arm/mach-omap2/clock3xxx_data.c |3 - arch/arm/mach-omap2/clock44xx_data.c |3 + arch/arm/mach-omap2/cm2xxx_3xxx.c|2 arch/arm/mach-omap2/cm44xx.c |2 arch/arm/mach-omap2/cminst44xx.c |2 arch/arm/mach-omap2/common.c |4 - arch/arm/mach-omap2/control.c|3 - arch/arm/mach-omap2/control.h|1 arch/arm/mach-omap2/devices.c|2 arch/arm/mach-omap2/display.c|1 arch/arm/mach-omap2/io.c | 17 +-- arch/arm/mach-omap2/iomap.h | 179 ++ arch/arm/mach-omap2/irq.c|5 + arch/arm/mach-omap2/omap-smp.c |3 - arch/arm/mach-omap2/pm24xx.c |5 + arch/arm/mach-omap2/prcm_mpu44xx.c |2 arch/arm/mach-omap2/prm44xx.c|3 - arch/arm/mach-omap2/prminst44xx.c|2 arch/arm/mach-omap2/sdram-nokia.c|1 arch/arm/mach-omap2/sdrc2xxx.c |5 + arch/arm/mach-omap2/sleep24xx.S |1 arch/arm/mach-omap2/sleep34xx.S |4 + arch/arm/mach-omap2/sram242x.S |4 + arch/arm/mach-omap2/sram243x.S |4 + arch/arm/mach-omap2/sram34xx.S |5 + arch/arm/plat-omap/include/plat/io.h | 174 - arch/arm/plat-omap/include/plat/tc.h |4 + arch/arm/plat-omap/sram.c|9 +- 31 files changed, 238 insertions(+), 215 deletions(-) create mode 100644 arch/arm/mach-omap2/iomap.h diff --git a/arch/arm/mach-omap2/clock2420_data.c b/arch/arm/mach-omap2/clock2420_data.c index 61ad385..b1f3e7c 100644 --- a/arch/arm/mach-omap2/clock2420_data.c +++ b/arch/arm/mach-omap2/clock2420_data.c @@ -19,6 +19,7 @@ #include plat/clkdev_omap.h +#include iomap.h #include clock.h #include clock2xxx.h #include opp2xxx.h diff --git a/arch/arm/mach-omap2/clock2430.c b/arch/arm/mach-omap2/clock2430.c index d87bc9c..0caf792 100644 --- a/arch/arm/mach-omap2/clock2430.c +++ b/arch/arm/mach-omap2/clock2430.c @@ -23,6 +23,7 @@ #include plat/clock.h +#include iomap.h #include clock.h #include clock2xxx.h #include cm2xxx_3xxx.h diff --git a/arch/arm/mach-omap2/clock2430_data.c b/arch/arm/mach-omap2/clock2430_data.c index 0cc1287..9a061ff 100644 --- a/arch/arm/mach-omap2/clock2430_data.c +++ b/arch/arm/mach-omap2/clock2430_data.c @@ -19,6 +19,7 @@ #include plat/clkdev_omap.h +#include iomap.h #include clock.h #include clock2xxx.h #include opp2xxx.h diff --git a/arch/arm/mach-omap2/clock3xxx_data.c b/arch/arm/mach-omap2/clock3xxx_data.c index d75e5f6..981b9f9 100644 --- a/arch/arm/mach-omap2/clock3xxx_data.c +++ b/arch/arm/mach-omap2/clock3xxx_data.c @@ -20,14 +20,15 @@ #include linux/clk.h #include linux/list.h +#include plat/hardware.h #include plat/clkdev_omap.h +#include iomap.h #include clock.h #include clock3xxx.h #include clock34xx.h #include clock36xx.h #include clock3517.h - #include cm2xxx_3xxx.h #include cm-regbits-34xx.h #include prm2xxx_3xxx.h diff --git a/arch/arm/mach-omap2/clock44xx_data.c b/arch/arm/mach-omap2/clock44xx_data.c index 08e86d7..79b98f2 100644 --- a/arch/arm/mach-omap2/clock44xx_data.c +++ b/arch/arm/mach-omap2/clock44xx_data.c @@ -26,8 +26,11 @@ #include linux/kernel.h #include linux/list.h #include linux/clk.h + +#include plat/hardware.h #include plat/clkdev_omap.h +#include iomap.h #include clock.h #include clock44xx.h #include cm1_44xx.h diff --git a/arch/arm/mach-omap2/cm2xxx_3xxx.c b/arch/arm/mach-omap2/cm2xxx_3xxx.c index 04d39cd..c79ed63 100644 --- a/arch/arm/mach-omap2/cm2xxx_3xxx.c +++ b/arch/arm/mach-omap2/cm2xxx_3xxx.c @@ -18,8 +18,8 @@ #include linux/err.h #include linux/io.h +#include iomap.h #include common.h - #include cm.h #include cm2xxx_3xxx.h #include cm-regbits-24xx.h diff --git a/arch/arm/mach-omap2/cm44xx.c b/arch/arm/mach-omap2/cm44xx.c index 6a83630..535d66e 100644 --- a/arch/arm/mach-omap2/cm44xx.c +++ b/arch/arm/mach-omap2/cm44xx.c @@ -18,8 +18,8 @@ #include linux/err.h #include linux/io.h +#include iomap.h #include common.h - #include cm.h #include cm1_44xx.h #include cm2_44xx.h diff --git a/arch/arm/mach-omap2/cminst44xx.c b/arch/arm/mach-omap2/cminst44xx.c index 6204dea..bd8810c 100644 --- a/arch/arm/mach-omap2/cminst44xx.c +++ b/arch/arm/mach-omap2/cminst44xx.c @@ -20,8 +20,8 @@ #include linux/err.h #include linux/io.h +#include iomap.h #include common.h - #include cm.h #include cm1_44xx.h #include cm2_44xx.h diff --git a/arch/arm/mach-omap2/common.c b/arch/arm/mach-omap2/common.c index aaf4211..93419de 100644 ---
[PATCH 7/8] ARM: OMAP: Remove plat/io.h by moving it into mach/io.h
This is needed so we can eventually remove mach/io.h for omap2+. Signed-off-by: Tony Lindgren t...@atomide.com --- arch/arm/mach-omap1/include/mach/io.h | 78 ++- arch/arm/mach-omap2/common.h | 10 arch/arm/mach-omap2/include/mach/io.h | 60 +++- arch/arm/mach-omap2/pm24xx.c |2 - arch/arm/plat-omap/dma.c |2 + arch/arm/plat-omap/include/plat/io.h | 84 - arch/arm/plat-omap/usb.c |2 + 7 files changed, 150 insertions(+), 88 deletions(-) delete mode 100644 arch/arm/plat-omap/include/plat/io.h diff --git a/arch/arm/mach-omap1/include/mach/io.h b/arch/arm/mach-omap1/include/mach/io.h index 57bdf74..07ffba8 100644 --- a/arch/arm/mach-omap1/include/mach/io.h +++ b/arch/arm/mach-omap1/include/mach/io.h @@ -1,5 +1,81 @@ /* * arch/arm/mach-omap1/include/mach/io.h + * + * IO definitions for TI OMAP processors and boards + * + * Copied from arch/arm/mach-sa1100/include/mach/io.h + * Copyright (C) 1997-1999 Russell King + * + * 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 SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * 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., + * 675 Mass Ave, Cambridge, MA 02139, USA. + * + * Modifications: + * 06-12-1997 RMK Created. + * 07-04-1999 RMK Major cleanup */ -#include plat/io.h +#ifndef __ASM_ARM_ARCH_IO_H +#define __ASM_ARM_ARCH_IO_H + +#include mach/hardware.h + +#define IO_SPACE_LIMIT 0x + +/* + * We don't actually have real ISA nor PCI buses, but there is so many + * drivers out there that might just work if we fake them... + */ +#define __io(a)__typesafe_io(a) +#define __mem_pci(a) (a) + +/* + * + * I/O mapping + * + */ + +#ifdef __ASSEMBLER__ +#define IOMEM(x) (x) +#else +#define IOMEM(x) ((void __force __iomem *)(x)) +#endif + +/* + * + * Omap specific register access + * + */ + +#ifndef __ASSEMBLER__ + +/* + * NOTE: Please use ioremap + __raw_read/write where possible instead of these + */ + +extern u8 omap_readb(u32 pa); +extern u16 omap_readw(u32 pa); +extern u32 omap_readl(u32 pa); +extern void omap_writeb(u8 v, u32 pa); +extern void omap_writew(u16 v, u32 pa); +extern void omap_writel(u32 v, u32 pa); + +#endif + +#endif diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h index f78ec4e..09ca9e9 100644 --- a/arch/arm/mach-omap2/common.h +++ b/arch/arm/mach-omap2/common.h @@ -242,5 +242,15 @@ struct omap_sdrc_params; extern void omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0, struct omap_sdrc_params *sdrc_cs1); +/* + * NOTE: Please use ioremap + __raw_read/write where possible instead of these + */ +extern u8 omap_readb(u32 pa); +extern u16 omap_readw(u32 pa); +extern u32 omap_readl(u32 pa); +extern void omap_writeb(u8 v, u32 pa); +extern void omap_writew(u16 v, u32 pa); +extern void omap_writel(u32 v, u32 pa); + #endif /* __ASSEMBLER__ */ #endif /* __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H */ diff --git a/arch/arm/mach-omap2/include/mach/io.h b/arch/arm/mach-omap2/include/mach/io.h index fd78f31..7306404 100644 --- a/arch/arm/mach-omap2/include/mach/io.h +++ b/arch/arm/mach-omap2/include/mach/io.h @@ -1,5 +1,63 @@ /* * arch/arm/mach-omap2/include/mach/io.h + * + * IO definitions for TI OMAP processors and boards + * + * Copied from arch/arm/mach-sa1100/include/mach/io.h + * Copyright (C) 1997-1999 Russell King + * + * Copyright (C) 2009 Texas Instruments + * Added OMAP4 support - Santosh Shilimkar santosh.shilim...@ti.com + * + * This program is free software; you can redistribute it and/or modify it +
[PATCH 8/8] ARM: OMAP2+: Limit omap_read/write usage to legacy USB drivers
Drivers should no longer use omap_read/write functions but instead use ioremap + read/write functions. As some USB legacy code is still shared between omap1 and omap2420, let's limit the omap_read/write to plat/usb.h. Also, let's make drivers/video/omap/lcdc.c depend on ARCH_OMAP1 as it is not needed for omap2+. Note that the long term fix is to update the drivers to use ioremap and read/write functions. That can now be done as a separate patch series that is limited to the USB drivers. Cc: Tomi Valkeinen tomi.valkei...@ti.com Cc: linux-fb...@vger.kernel.org Signed-off-by: Tony Lindgren t...@atomide.com --- arch/arm/mach-omap2/common.h | 10 arch/arm/mach-omap2/io.c | 40 - arch/arm/plat-omap/include/plat/usb.h | 40 + drivers/video/omap/Kconfig|2 +- 4 files changed, 41 insertions(+), 51 deletions(-) diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h index 09ca9e9..f78ec4e 100644 --- a/arch/arm/mach-omap2/common.h +++ b/arch/arm/mach-omap2/common.h @@ -242,15 +242,5 @@ struct omap_sdrc_params; extern void omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0, struct omap_sdrc_params *sdrc_cs1); -/* - * NOTE: Please use ioremap + __raw_read/write where possible instead of these - */ -extern u8 omap_readb(u32 pa); -extern u16 omap_readw(u32 pa); -extern u32 omap_readl(u32 pa); -extern void omap_writeb(u8 v, u32 pa); -extern void omap_writew(u16 v, u32 pa); -extern void omap_writel(u32 v, u32 pa); - #endif /* __ASSEMBLER__ */ #endif /* __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H */ diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c index 0119807..3203128 100644 --- a/arch/arm/mach-omap2/io.c +++ b/arch/arm/mach-omap2/io.c @@ -487,43 +487,3 @@ void __init omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0, _omap2_init_reprogram_sdrc(); } } - -/* - * NOTE: Please use ioremap + __raw_read/write where possible instead of these - */ - -u8 omap_readb(u32 pa) -{ - return __raw_readb(OMAP2_L4_IO_ADDRESS(pa)); -} -EXPORT_SYMBOL(omap_readb); - -u16 omap_readw(u32 pa) -{ - return __raw_readw(OMAP2_L4_IO_ADDRESS(pa)); -} -EXPORT_SYMBOL(omap_readw); - -u32 omap_readl(u32 pa) -{ - return __raw_readl(OMAP2_L4_IO_ADDRESS(pa)); -} -EXPORT_SYMBOL(omap_readl); - -void omap_writeb(u8 v, u32 pa) -{ - __raw_writeb(v, OMAP2_L4_IO_ADDRESS(pa)); -} -EXPORT_SYMBOL(omap_writeb); - -void omap_writew(u16 v, u32 pa) -{ - __raw_writew(v, OMAP2_L4_IO_ADDRESS(pa)); -} -EXPORT_SYMBOL(omap_writew); - -void omap_writel(u32 v, u32 pa) -{ - __raw_writel(v, OMAP2_L4_IO_ADDRESS(pa)); -} -EXPORT_SYMBOL(omap_writel); diff --git a/arch/arm/plat-omap/include/plat/usb.h b/arch/arm/plat-omap/include/plat/usb.h index dc864b5..5f6ced4 100644 --- a/arch/arm/plat-omap/include/plat/usb.h +++ b/arch/arm/plat-omap/include/plat/usb.h @@ -3,6 +3,7 @@ #ifndef__ASM_ARCH_OMAP_USB_H #define__ASM_ARCH_OMAP_USB_H +#include linux/io.h #include linux/usb/musb.h #include plat/board.h @@ -105,6 +106,45 @@ extern int omap4430_phy_set_clk(struct device *dev, int on); extern int omap4430_phy_init(struct device *dev); extern int omap4430_phy_exit(struct device *dev); extern int omap4430_phy_suspend(struct device *dev, int suspend); + +/* + * NOTE: Please update omap USB drivers to use ioremap + read/write + */ + +#define OMAP2_L4_IO_OFFSET 0xb200 +#define OMAP2_L4_IO_ADDRESS(pa)IOMEM((pa) + OMAP2_L4_IO_OFFSET) + +static inline u8 omap_readb(u32 pa) +{ + return __raw_readb(OMAP2_L4_IO_ADDRESS(pa)); +} + +static inline u16 omap_readw(u32 pa) +{ + return __raw_readw(OMAP2_L4_IO_ADDRESS(pa)); +} + +static inline u32 omap_readl(u32 pa) +{ + return __raw_readl(OMAP2_L4_IO_ADDRESS(pa)); +} + +static inline void omap_writeb(u8 v, u32 pa) +{ + __raw_writeb(v, OMAP2_L4_IO_ADDRESS(pa)); +} + + +static inline void omap_writew(u16 v, u32 pa) +{ + __raw_writew(v, OMAP2_L4_IO_ADDRESS(pa)); +} + +static inline void omap_writel(u32 v, u32 pa) +{ + __raw_writel(v, OMAP2_L4_IO_ADDRESS(pa)); +} + #endif extern void am35x_musb_reset(void); diff --git a/drivers/video/omap/Kconfig b/drivers/video/omap/Kconfig index 84ff232..295d1cc 100644 --- a/drivers/video/omap/Kconfig +++ b/drivers/video/omap/Kconfig @@ -11,7 +11,7 @@ config FB_OMAP config FB_OMAP_LCDC_EXTERNAL bool External LCD controller support - depends on FB_OMAP + depends on FB_OMAP ARCH_OMAP1 help Say Y here, if you want to have support for boards with an external LCD controller connected to the SoSSI/RFBI interface. -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCHv10 3/4] omap3: add common twl configurations for vdd1 and vdd2
Tero Kristo t-kri...@ti.com writes: VDD1 and VDD2 are the core voltage regulators on OMAP3. VDD1 is used to control MPU/IVA voltage, and VDD2 is used for CORE. These regulators are needed by DVFS. Voltage ranges for VDD1 and VDD2 are taken from twl4030/twl5030 data manuals: - SWCS019L : TWL4030 ES3.1 Data Manual rev L - SWCS030E : TWL5030 ES1.2 Data Manual rev E Signed-off-by: Tero Kristo t-kri...@ti.com Do you have a similar patch for OMAP4 support? Kevin -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH/RFT 1/1] OMAP2+: cpufreq: scale voltage along with frequency
Mohammed, Afzal af...@ti.com writes: Hi Kevin, On Fri, Feb 17, 2012 at 00:50:43, Hilman, Kevin wrote: +/* scaling up? scale voltage before frequency */ +if (mpu_reg (freqs.new freqs.old)) +regulator_set_voltage(mpu_reg, volt, volt); Probably voltage ranges has to be specified, otherwise if I understand correctly, if exact voltage 'volt' is a value that cannot be set by voltage regulator, it may not work properly. In this case, volt comes from the OPP table, and was requested using a rounding call into the OPP table, so the resolution problem is handled there. If 'volt' cannot be set by the regulator, then the OPP tables are also broken. Also, in your patch, you only add some offset. If you want to be approximate, shouldn't you have plus and minus? IMO, we should let the OPP table handle that, and not the CPUfreq driver. ret = clk_set_rate(mpu_clk, freqs.new * 1000); -freqs.new = omap_getspeed(policy-cpu); +/* scaling down? scale voltage after frequency */ +if (mpu_reg (freqs.new freqs.old)) +regulator_set_voltage(mpu_reg, volt, volt); + +freqs.new = omap_getspeed(policy-cpu); It would be better to handle error cases too, we have a patch for doing DVFS for AM335X as follows I agree, my version is not very robust in the face of errors from the regulator framework. Hoever, I'm not crazy about the extra notifications in your proposed patch. I think it's cleaner to always pre and post notify. If there's a failure, the post notify will have the same freq as the pre-notify, but that's not a big problem. I'll send an updated patch that follows this approach instead: - pre notify - scale volage up - if fail, goto done - scale freq - scale voltage down - if fail - scale freq back - goto done - SMP jiffies magic done: - post notify Kevin -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] ARM: OMAP1: Fix out-of-bounds array access for Innovator
Otherwise we can get the following on some compilers: arch/arm/mach-omap1/board-innovator.c:419:19: warning: array subscript is above array bounds [-Warray-bounds] arch/arm/mach-omap1/board-innovator.c:425:19: warning: array subscript is above array bounds [-Warray-bounds] Signed-off-by: Tony Lindgren t...@atomide.com --- a/arch/arm/mach-omap1/board-innovator.c +++ b/arch/arm/mach-omap1/board-innovator.c @@ -416,13 +416,13 @@ static void __init innovator_init(void) #ifdef CONFIG_ARCH_OMAP15XX if (cpu_is_omap1510()) { omap1_usb_init(innovator1510_usb_config); - innovator_config[1].data = innovator1510_lcd_config; + innovator_config[0].data = innovator1510_lcd_config; } #endif #ifdef CONFIG_ARCH_OMAP16XX if (cpu_is_omap1610()) { omap1_usb_init(h2_usb_config); - innovator_config[1].data = innovator1610_lcd_config; + innovator_config[0].data = innovator1610_lcd_config; } #endif omap_board_config = innovator_config; -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 7/8] ARM: OMAP: Remove plat/io.h by moving it into mach/io.h
On 02/21/2012 05:40 PM, Tony Lindgren wrote: This is needed so we can eventually remove mach/io.h for omap2+. Signed-off-by: Tony Lindgren t...@atomide.com --- arch/arm/mach-omap1/include/mach/io.h | 78 ++- arch/arm/mach-omap2/common.h | 10 arch/arm/mach-omap2/include/mach/io.h | 60 +++- arch/arm/mach-omap2/pm24xx.c |2 - arch/arm/plat-omap/dma.c |2 + arch/arm/plat-omap/include/plat/io.h | 84 - arch/arm/plat-omap/usb.c |2 + 7 files changed, 150 insertions(+), 88 deletions(-) delete mode 100644 arch/arm/plat-omap/include/plat/io.h diff --git a/arch/arm/mach-omap1/include/mach/io.h b/arch/arm/mach-omap1/include/mach/io.h index 57bdf74..07ffba8 100644 --- a/arch/arm/mach-omap1/include/mach/io.h +++ b/arch/arm/mach-omap1/include/mach/io.h @@ -1,5 +1,81 @@ /* * arch/arm/mach-omap1/include/mach/io.h + * + * IO definitions for TI OMAP processors and boards + * + * Copied from arch/arm/mach-sa1100/include/mach/io.h + * Copyright (C) 1997-1999 Russell King + * + * 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 SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * 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., + * 675 Mass Ave, Cambridge, MA 02139, USA. + * + * Modifications: + * 06-12-1997 RMK Created. + * 07-04-1999 RMK Major cleanup */ -#include plat/io.h +#ifndef __ASM_ARM_ARCH_IO_H +#define __ASM_ARM_ARCH_IO_H + +#include mach/hardware.h This shouldn't be needed. + +#define IO_SPACE_LIMIT 0x + +/* + * We don't actually have real ISA nor PCI buses, but there is so many + * drivers out there that might just work if we fake them... + */ +#define __io(a) __typesafe_io(a) +#define __mem_pci(a) (a) + +/* + * + * I/O mapping + * + */ + +#ifdef __ASSEMBLER__ +#define IOMEM(x) (x) +#else +#define IOMEM(x) ((void __force __iomem *)(x)) +#endif + This can't be moved to iomap.h? I did that for other platforms. +/* + * + * Omap specific register access + * + */ + +#ifndef __ASSEMBLER__ + +/* + * NOTE: Please use ioremap + __raw_read/write where possible instead of these + */ + +extern u8 omap_readb(u32 pa); +extern u16 omap_readw(u32 pa); +extern u32 omap_readl(u32 pa); +extern void omap_writeb(u8 v, u32 pa); +extern void omap_writew(u16 v, u32 pa); +extern void omap_writel(u32 v, u32 pa); These can't be moved to common.h like omap2? Same comments on omap2 io.h. Rob + +#endif + +#endif diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h index f78ec4e..09ca9e9 100644 --- a/arch/arm/mach-omap2/common.h +++ b/arch/arm/mach-omap2/common.h @@ -242,5 +242,15 @@ struct omap_sdrc_params; extern void omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0, struct omap_sdrc_params *sdrc_cs1); +/* + * NOTE: Please use ioremap + __raw_read/write where possible instead of these + */ +extern u8 omap_readb(u32 pa); +extern u16 omap_readw(u32 pa); +extern u32 omap_readl(u32 pa); +extern void omap_writeb(u8 v, u32 pa); +extern void omap_writew(u16 v, u32 pa); +extern void omap_writel(u32 v, u32 pa); + #endif /* __ASSEMBLER__ */ #endif /* __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H */ diff --git a/arch/arm/mach-omap2/include/mach/io.h b/arch/arm/mach-omap2/include/mach/io.h index fd78f31..7306404 100644 --- a/arch/arm/mach-omap2/include/mach/io.h +++ b/arch/arm/mach-omap2/include/mach/io.h @@ -1,5 +1,63 @@ /* *
Re: [PATCH 3/3] OMAPDSS: DSS: Add runtime_pm protection around wait_for_vsync.
On Tuesday 21 February 2012 09:38 PM, Tomi Valkeinen wrote: On Tue, 2012-02-21 at 19:36 +0530, Archit Taneja wrote: From: Lajos Molnarla...@ti.com If DSS is suspended during a wait_for_vsync operation, it may loose its clock. Request runtime_pm around wait_for_vsync. Signed-off-by: Lajos Molnarla...@ti.com Signed-off-by: Archit Tanejaarc...@ti.com --- drivers/video/omap2/dss/dispc.c | 16 +++- 1 files changed, 11 insertions(+), 5 deletions(-) This only handles omap_dispc_wait_for_irq_interruptible_timeout(), there's also omap_dispc_wait_for_irq_timeout(). However, I think it'd be better to do the runtime_get/put in the caller, instead of in these dispc's wait funcs. While it doesn't really matter with dss_mgr_wait_for_vsync(), for dss_mgr/ovl_wait_for_go() it makes much more sense to get/put there just once, instead of every time the omap_dispc_wait_* is called. Right, that makes sense. Btw, in the current code, how do we ensure that clocks are enabled when someone calls omap_dss_mgr_apply(). Archit Tomi -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH/RFT 1/1] OMAP2+: cpufreq: scale voltage along with frequency
Hi Kevin, On Wed, Feb 22, 2012 at 05:36:12, Hilman, Kevin wrote: In this case, volt comes from the OPP table, and was requested using a rounding call into the OPP table, so the resolution problem is handled there. If 'volt' cannot be set by the regulator, then the OPP tables are also broken. Also, in your patch, you only add some offset. If you want to be approximate, shouldn't you have plus and minus? IMO, we should let the OPP table handle that, and not the CPUfreq driver. I have a different opinion. Consider following case, Voltage to set for OPPX is 1262.5mV and regulator has steps of 10mV, and suppose regulator steps are .., 1260mV, 1270mV etc. Regulator framework will not be able to set voltage for OPPX (certainly if set_voltage_sel is used) if no range specified. But instead if range of 1262.5 - (1262.5 + 10 - 1) is provided, regulator can certainly set voltage for 1270mV (a nearest value) Resolution in my patch was not meant to be resolution per se, it was meant so that a voltage step can always be found for the regulator (assuming worst resolution is 12.5mV), and for regulator to get a step, resolution had to be used. Ideal solution may be to use a variable to have a default resolution of worst regulator and update it to that of regulator used (perhaps making use of something like module parameters) If regulator for a particular SoC is changed, exact OPP voltage may not be settable, but a near value should be sufficient, this can't be achieved if range is not specified. That happens exactly for AM335X, voltage for one of OPP is 1.26V, but as regulator cannot set the value, it is being set at 1.2625V and if no range is specified, it will not work. And in my patch plus - minus was not used as regulator framework will try to set voltage for the least voltage which sometimes corresponds to exact OPP required value. For cpufreq omap driver to work with various regulators, it would be better to specify ranges. I agree, my version is not very robust in the face of errors from the regulator framework. Hoever, I'm not crazy about the extra notifications in your proposed patch. I think it's cleaner to always pre and post notify. If there's a failure, the post notify will have the same freq as the pre-notify, but that's not a big problem. Yes, agree that error handling path is bulky. A problem that can happen is that drivers who has registered cpufreq notifier will think that frequency has changed, that may cause problem in addition to delay time getting altered. But whether these are worth handling with a penalty of bulky error handling, probably you know better. Regards Afzal -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 3/3] OMAPDSS: DSS: Add runtime_pm protection around wait_for_vsync.
On Wed, 2012-02-22 at 11:15 +0530, Archit Taneja wrote: On Tuesday 21 February 2012 09:38 PM, Tomi Valkeinen wrote: On Tue, 2012-02-21 at 19:36 +0530, Archit Taneja wrote: From: Lajos Molnarla...@ti.com If DSS is suspended during a wait_for_vsync operation, it may loose its clock. Request runtime_pm around wait_for_vsync. Signed-off-by: Lajos Molnarla...@ti.com Signed-off-by: Archit Tanejaarc...@ti.com --- drivers/video/omap2/dss/dispc.c | 16 +++- 1 files changed, 11 insertions(+), 5 deletions(-) This only handles omap_dispc_wait_for_irq_interruptible_timeout(), there's also omap_dispc_wait_for_irq_timeout(). However, I think it'd be better to do the runtime_get/put in the caller, instead of in these dispc's wait funcs. While it doesn't really matter with dss_mgr_wait_for_vsync(), for dss_mgr/ovl_wait_for_go() it makes much more sense to get/put there just once, instead of every time the omap_dispc_wait_* is called. Right, that makes sense. Btw, in the current code, how do we ensure that clocks are enabled when someone calls omap_dss_mgr_apply(). We don't. Apply does not touch any of the registers if the corresponding manager is not enabled, so there's no need to enable clocks. Tomi signature.asc Description: This is a digitally signed message part
[PATCH v2 3/3] OMAPDSS: MANAGER/APPLY: Add runtime_pm protection around wait_for_go/vsync functions
From: Lajos Molnar la...@ti.com If DSS suspends within the functions dss_mgr_wait_for_go(), dss_mgr_wait_for_go_ovl() or dss_mgr_wait_for_vsync(). It may lose it's clock and lead to a register access failure. Request runtime_pm around these functions. [arc...@ti.com: Moved runtime_pm calls to wait_for_go/vsync functions rather then calling them from omap_dispc_wait_for_irq_interruptible_timeout()] Signed-off-by: Archit Taneja arc...@ti.com --- drivers/video/omap2/dss/apply.c | 12 drivers/video/omap2/dss/manager.c | 12 +++- 2 files changed, 23 insertions(+), 1 deletions(-) diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c index b0264a1..f145e9c 100644 --- a/drivers/video/omap2/dss/apply.c +++ b/drivers/video/omap2/dss/apply.c @@ -391,6 +391,10 @@ int dss_mgr_wait_for_go(struct omap_overlay_manager *mgr) if (mgr_manual_update(mgr)) return 0; + r = dispc_runtime_get(); + if (r) + return r; + irq = dispc_mgr_get_vsync_irq(mgr-id); mp = get_mgr_priv(mgr); @@ -431,6 +435,8 @@ int dss_mgr_wait_for_go(struct omap_overlay_manager *mgr) } } + dispc_runtime_put(); + return r; } @@ -454,6 +460,10 @@ int dss_mgr_wait_for_go_ovl(struct omap_overlay *ovl) if (ovl_manual_update(ovl)) return 0; + r = dispc_runtime_get(); + if (r) + return r; + irq = dispc_mgr_get_vsync_irq(ovl-manager-id); op = get_ovl_priv(ovl); @@ -494,6 +504,8 @@ int dss_mgr_wait_for_go_ovl(struct omap_overlay *ovl) } } + dispc_runtime_put(); + return r; } diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c index d1858e7..e736460 100644 --- a/drivers/video/omap2/dss/manager.c +++ b/drivers/video/omap2/dss/manager.c @@ -494,6 +494,11 @@ static int dss_mgr_wait_for_vsync(struct omap_overlay_manager *mgr) { unsigned long timeout = msecs_to_jiffies(500); u32 irq; + int r; + + r = dispc_runtime_get(); + if (r) + return r; if (mgr-device-type == OMAP_DISPLAY_TYPE_VENC) { irq = DISPC_IRQ_EVSYNC_ODD; @@ -505,7 +510,12 @@ static int dss_mgr_wait_for_vsync(struct omap_overlay_manager *mgr) else irq = DISPC_IRQ_VSYNC2; } - return omap_dispc_wait_for_irq_interruptible_timeout(irq, timeout); + + r = omap_dispc_wait_for_irq_interruptible_timeout(irq, timeout); + + dispc_runtime_put(); + + return r; } int dss_init_overlay_managers(struct platform_device *pdev) -- 1.7.5.4 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v3 0/3] MFD: twl6040: Conversion to i2c driver
Hi Tony, On 02/21/2012 08:44 PM, Tony Lindgren wrote: Yeah looks OK to me, acked that patch. Let me know if there are others I should look. I would appreciate if you could take a look at this series as well: TWL6040: Regulator support http://marc.info/?l=linux-omapm=132947934522602w=2 I have separated the twl6040 i2c driver conversion, and regulator support since they are dealing with different issues. If you know who should look at the drivers/regulator/twl-regulator.c, drivers/mfd/twl.c changes could you CC them as well? Regards, Péter -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] ASoC: pandora: switch clock back to internal on stop
On 02/20/2012 11:52 AM, Peter Ujfalusi wrote: I have patch on top of the mcbsp merge series which allows users (developers) to switch between McBSP2 master/slave configuration on Beagle. It will have two PCM: 0 is the current configuration (twl4030 master, mcbsp2 slave) 1 is the same as with pandora (twl4030 slave, mcbsp2 master - CLKS pin is the source for the SRG). Side note: Don't forget the FCLK as a SRG source for McBSP master case. It's quite useful when bringing up and testing new hw. -- jarkko -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html