[RESEND 1/2] dt/bindings: Binding documentation for Palmas clk32kg and clk32kgaudio clocks
Palmas class of devices can provide 32K clock(s) to be used by other devices on the board. Depending on the actual device the provided clocks can be: CLK32K_KG and CLK32K_KGAUDIO or only one: CLK32K_KG (TPS659039 for example) Use separate compatible flags for the two 32K clock. A system which needs or have only one of the 32k clock from Palmas will need to add node(s) for each clock as separate section in the dts file. The two compatible property is: ti,palmas-clk32kg for clk32kg clock ti,palmas-clk32kgaudio for clk32kgaudio clock Apart from the register control of the clocks - which is done via the clock API there is a posibility to enable the external sleep control. In this way the clock can be enabled/disabled on demand by the user of the clock. Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com Reviewed-by: Nishanth Menon n...@ti.com --- .../bindings/clock/clk-palmas-clk32kg-clocks.txt | 35 ++ include/dt-bindings/mfd/palmas.h | 18 +++ 2 files changed, 53 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/clk-palmas-clk32kg-clocks.txt create mode 100644 include/dt-bindings/mfd/palmas.h diff --git a/Documentation/devicetree/bindings/clock/clk-palmas-clk32kg-clocks.txt b/Documentation/devicetree/bindings/clock/clk-palmas-clk32kg-clocks.txt new file mode 100644 index ..4208886d834a --- /dev/null +++ b/Documentation/devicetree/bindings/clock/clk-palmas-clk32kg-clocks.txt @@ -0,0 +1,35 @@ +* Palmas 32KHz clocks * + +Palmas device has two clock output pins for 32KHz, KG and KG_AUDIO. + +This binding uses the common clock binding ./clock-bindings.txt. + +Required properties: +- compatible : ti,palmas-clk32kg for clk32kg clock + ti,palmas-clk32kgaudio for clk32kgaudio clock +- #clock-cells : shall be set to 0. + +Optional property: +- ti,external-sleep-control: The external enable input pins controlled the + enable/disable of clocks. The external enable input pins ENABLE1, + ENABLE2 and NSLEEP. The valid values for the external pins are: + PALMAS_EXT_CONTROL_PIN_ENABLE1 for ENABLE1 pin + PALMAS_EXT_CONTROL_PIN_ENABLE2 for ENABLE2 pin + PALMAS_EXT_CONTROL_PIN_NSLEEP for NSLEEP pin + Option 0 or missing this property means the clock is enabled/disabled + via register access and these pins do not have any control. + The macros of external control pins for DTS is defined at + dt-bindings/mfd/palmas.h + +Example: + #include dt-bindings/mfd/palmas.h + ... + palmas: tps65913@58 { + ... + clk32kg: palmas_clk32k@0 { + compatible = ti,palmas-clk32kg; + #clock-cells = 0; + ti,external-sleep-control = PALMAS_EXT_CONTROL_PIN_NSLEEP; + }; + ... + }; diff --git a/include/dt-bindings/mfd/palmas.h b/include/dt-bindings/mfd/palmas.h new file mode 100644 index ..2c8ac4841385 --- /dev/null +++ b/include/dt-bindings/mfd/palmas.h @@ -0,0 +1,18 @@ +/* + * This header provides macros for Palmas device bindings. + * + * Copyright (c) 2013, NVIDIA Corporation. + * + * Author: Laxman Dewangan ldewan...@nvidia.com + * + */ + +#ifndef __DT_BINDINGS_PALMAS_H__ +#define __DT_BINDINGS_PALMAS_H + +/* External control pins */ +#define PALMAS_EXT_CONTROL_PIN_ENABLE1 1 +#define PALMAS_EXT_CONTROL_PIN_ENABLE2 2 +#define PALMAS_EXT_CONTROL_PIN_NSLEEP 3 + +#endif /* __DT_BINDINGS_PALMAS_H */ -- 2.0.0 -- 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
[RESEND 2/2] clk: Add driver for Palmas clk32kg and clk32kgaudio clocks
Palmas class of devices can provide 32K clock(s) to be used by other devices on the board. Depending on the actual device the provided clocks can be: CLK32K_KG and CLK32K_KGAUDIO or only one: CLK32K_KG (TPS659039 for example) Use separate compatible flags for the two 32K clock. A system which needs or have only one of the 32k clock from Palmas will need to add node(s) for each clock as separate section in the dts file. The two compatible property is: ti,palmas-clk32kg for clk32kg clock ti,palmas-clk32kgaudio for clk32kgaudio clock Apart from the register control of the clocks - which is done via the clock API there is a posibility to enable the external sleep control. In this way the clock can be enabled/disabled on demand by the user of the clock. See the documentation for more details. Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com Reviewed-by: Nishanth Menon n...@ti.com --- drivers/clk/Kconfig | 7 ++ drivers/clk/Makefile | 1 + drivers/clk/clk-palmas.c | 307 +++ 3 files changed, 315 insertions(+) create mode 100644 drivers/clk/clk-palmas.c diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig index 9f9c5ae5359b..cfd3af7b2cbd 100644 --- a/drivers/clk/Kconfig +++ b/drivers/clk/Kconfig @@ -102,6 +102,13 @@ config COMMON_CLK_KEYSTONE Supports clock drivers for Keystone based SOCs. These SOCs have local a power sleep control module that gate the clock to the IPs and PLLs. +config COMMON_CLK_PALMAS + tristate Clock driver for TI Palmas devices + depends on MFD_PALMAS + ---help--- + This driver supports TI Palmas devices 32KHz output KG and KG_AUDIO + using common clock framework. + source drivers/clk/qcom/Kconfig endmenu diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile index 567f10259029..312742c10661 100644 --- a/drivers/clk/Makefile +++ b/drivers/clk/Makefile @@ -22,6 +22,7 @@ obj-$(CONFIG_COMMON_CLK_MAX77686) += clk-max77686.o obj-$(CONFIG_ARCH_MOXART) += clk-moxart.o obj-$(CONFIG_ARCH_NOMADIK) += clk-nomadik.o obj-$(CONFIG_ARCH_NSPIRE) += clk-nspire.o +obj-$(CONFIG_COMMON_CLK_PALMAS)+= clk-palmas.o obj-$(CONFIG_CLK_PPC_CORENET) += clk-ppc-corenet.o obj-$(CONFIG_COMMON_CLK_S2MPS11) += clk-s2mps11.o obj-$(CONFIG_COMMON_CLK_SI5351)+= clk-si5351.o diff --git a/drivers/clk/clk-palmas.c b/drivers/clk/clk-palmas.c new file mode 100644 index ..781630e1372b --- /dev/null +++ b/drivers/clk/clk-palmas.c @@ -0,0 +1,307 @@ +/* + * Clock driver for Palmas device. + * + * Copyright (c) 2013, NVIDIA Corporation. + * Copyright (c) 2013-2014 Texas Instruments, Inc. + * + * Author: Laxman Dewangan ldewan...@nvidia.com + * Peter Ujfalusi peter.ujfal...@ti.com + * + * 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 version 2. + * + * This program is distributed as is WITHOUT ANY WARRANTY of any kind, + * whether express or implied; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + */ + +#include linux/clk.h +#include linux/clkdev.h +#include linux/clk-provider.h +#include linux/mfd/palmas.h +#include linux/module.h +#include linux/of.h +#include linux/of_device.h +#include linux/platform_device.h +#include linux/slab.h + +#define PALMAS_CLOCK_DT_EXT_CONTROL_ENABLE11 +#define PALMAS_CLOCK_DT_EXT_CONTROL_ENABLE22 +#define PALMAS_CLOCK_DT_EXT_CONTROL_NSLEEP 3 + +struct palmas_clk32k_desc { + const char *clk_name; + unsigned int control_reg; + unsigned int enable_mask; + unsigned int sleep_mask; + unsigned int sleep_reqstr_id; + int delay; +}; + +struct palmas_clock_info { + struct device *dev; + struct clk *clk; + struct clk_hw hw; + struct palmas *palmas; + struct palmas_clk32k_desc *clk_desc; + int ext_control_pin; +}; + +static inline struct palmas_clock_info *to_palmas_clks_info(struct clk_hw *hw) +{ + return container_of(hw, struct palmas_clock_info, hw); +} + +static unsigned long palmas_clks_recalc_rate(struct clk_hw *hw, +unsigned long parent_rate) +{ + return 32768; +} + +static int palmas_clks_prepare(struct clk_hw *hw) +{ + struct palmas_clock_info *cinfo = to_palmas_clks_info(hw); + int ret; + + ret = palmas_update_bits(cinfo-palmas, PALMAS_RESOURCE_BASE, +cinfo-clk_desc-control_reg, +cinfo-clk_desc-enable_mask, +cinfo-clk_desc-enable_mask); + if (ret 0) + dev_err(cinfo-dev, Reg 0x%02x update failed, %d\n, + cinfo-clk_desc-control_reg,
[RESEND 0/2] clk: Support for Palmas clk32kg and clk32kgaudio clocks
Hi Mike, This is a resend of the v2 version of the palmas clock driver which seamingly missed the 3.16 merge window. I have added Nishanth's Reviewed-by tag to the patches. Changes since v1: - binding documentation and driver has been separated based on Nishanth Menon's comment v2 of the series: https://lkml.org/lkml/2014/5/6/323 v1 of the driver can be found: https://lkml.org/lkml/2014/4/3/104 Palmas class of devices can provide 32K clock(s) to be used by other devices on the board. Depending on the actual device the provided clocks can be: CLK32K_KG and CLK32K_KGAUDIO or only one: CLK32K_KG (TPS659039 for example) Use separate compatible flags for the two 32K clock. A system which needs or have only one of the 32k clock from Palmas will need to add node(s) for each clock as separate section in the dts file. The two compatible property is: ti,palmas-clk32kg for clk32kg clock ti,palmas-clk32kgaudio for clk32kgaudio clock Apart from the register control of the clocks - which is done via the clock API there is a posibility to enable the external sleep control. In this way the clock can be enabled/disabled on demand by the user of the clock. Regards, Peter --- Peter Ujfalusi (2): dt/bindings: Binding documentation for Palmas clk32kg and clk32kgaudio clocks clk: Add driver for Palmas clk32kg and clk32kgaudio clocks .../bindings/clock/clk-palmas-clk32kg-clocks.txt | 35 +++ drivers/clk/Kconfig| 7 + drivers/clk/Makefile | 1 + drivers/clk/clk-palmas.c | 307 + include/dt-bindings/mfd/palmas.h | 18 ++ 5 files changed, 368 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/clk-palmas-clk32kg-clocks.txt create mode 100644 drivers/clk/clk-palmas.c create mode 100644 include/dt-bindings/mfd/palmas.h -- 2.0.0 -- 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 1/6] ARM: mm: cache-l2x0: Add base address argument to write_sec callback
On Wed, Jun 25, 2014 at 3:37 PM, Tomasz Figa t.f...@samsung.com wrote: For certain platforms (e.g. Exynos) it is necessary to read back some values from registers before they can be written (i.e. SMC calls that set multiple registers per call), so base address of L2C controller is needed for .write_sec operation. This patch adds base argument to .write_sec callback so that its implementation can also access registers directly. Signed-off-by: Tomasz Figa t.f...@samsung.com arch/arm/mach-ux500/cache-l2x0.c | 3 ++- In our case just changing the signature of the function I see so: Acked-by: Linus Walleij linus.wall...@linaro.org Yours, Linus Walleij -- 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 7/9] regulator: palmas: Add palmas_pmic_driver_data structure
On Wed, 18 Jun 2014, Keerthy wrote: Add palmas_pmic_driver_data structure. Signed-off-by: Keerthy j-keer...@ti.com --- include/linux/mfd/palmas.h | 25 + 1 file changed, 25 insertions(+) diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h index 0136e58..1a045ba 100644 --- a/include/linux/mfd/palmas.h +++ b/include/linux/mfd/palmas.h @@ -53,6 +53,8 @@ struct palmas_pmic; struct palmas_gpadc; struct palmas_resource; struct palmas_usb; +struct palmas_pmic_driver_data; +struct palmas_pmic_platform_data; Are you sure all of these forward declarations are required? I'd prefer that you re-ordered the header file, rather than have them all looming here. enum palmas_usb_state { PALMAS_USB_STATE_DISCONNECT, @@ -76,6 +78,8 @@ struct palmas { struct mutex irq_lock; struct regmap_irq_chip_data *irq_data; + struct palmas_pmic_driver_data *pmic_ddata; + /* Child Devices */ struct palmas_pmic *pmic; struct palmas_gpadc *gpadc; @@ -107,6 +111,27 @@ struct regs_info { int sleep_id; }; +struct palmas_pmic_driver_data { + int smps_start; + int smps_end; + int ldo_begin; + int ldo_end; + int max_reg; + struct regs_info *palmas_regs_info; + struct of_regulator_match *palmas_matches; + struct palmas_sleep_requestor_info *sleep_req_info; + int (*smps_register)(struct palmas_pmic *pmic, + struct palmas_pmic_driver_data *ddata, + struct palmas_pmic_platform_data *pdata, + const char *pdev_name, + struct regulator_config config); + int (*ldo_register)(struct palmas_pmic *pmic, + struct palmas_pmic_driver_data *ddata, + struct palmas_pmic_platform_data *pdata, + const char *pdev_name, + struct regulator_config config); +}; + struct palmas_gpadc_platform_data { /* Channel 3 current source is only enabled during conversion */ int ch3_current; -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog -- 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 8/9] regulator: palmas: add driver data and modularize the probe
On Wed, 18 Jun 2014, Keerthy wrote: add driver data and modularize the probe. Nit: This is a sentence, it should start with a capital letter. Signed-off-by: Keerthy j-keer...@ti.com --- Changes in V2: * Fixed the order of variable declarations. drivers/mfd/palmas.c | 44 +-- drivers/regulator/palmas-regulator.c | 658 -- 2 files changed, 396 insertions(+), 306 deletions(-) diff --git a/drivers/mfd/palmas.c b/drivers/mfd/palmas.c index c12759d..28cb048 100644 --- a/drivers/mfd/palmas.c +++ b/drivers/mfd/palmas.c @@ -25,42 +25,6 @@ #include linux/mfd/palmas.h #include linux/of_device.h -#define EXTERNAL_REQUESTOR(_id, _offset, _pos) \ - [PALMAS_EXTERNAL_REQSTR_ID_##_id] = { \ - .id = PALMAS_EXTERNAL_REQSTR_ID_##_id, \ - .reg_offset = _offset, \ - .bit_pos = _pos,\ - } - -static struct palmas_sleep_requestor_info sleep_req_info[] = { - EXTERNAL_REQUESTOR(REGEN1, 0, 0), - EXTERNAL_REQUESTOR(REGEN2, 0, 1), - EXTERNAL_REQUESTOR(SYSEN1, 0, 2), - EXTERNAL_REQUESTOR(SYSEN2, 0, 3), - EXTERNAL_REQUESTOR(CLK32KG, 0, 4), - EXTERNAL_REQUESTOR(CLK32KGAUDIO, 0, 5), - EXTERNAL_REQUESTOR(REGEN3, 0, 6), - EXTERNAL_REQUESTOR(SMPS12, 1, 0), - EXTERNAL_REQUESTOR(SMPS3, 1, 1), - EXTERNAL_REQUESTOR(SMPS45, 1, 2), - EXTERNAL_REQUESTOR(SMPS6, 1, 3), - EXTERNAL_REQUESTOR(SMPS7, 1, 4), - EXTERNAL_REQUESTOR(SMPS8, 1, 5), - EXTERNAL_REQUESTOR(SMPS9, 1, 6), - EXTERNAL_REQUESTOR(SMPS10, 1, 7), - EXTERNAL_REQUESTOR(LDO1, 2, 0), - EXTERNAL_REQUESTOR(LDO2, 2, 1), - EXTERNAL_REQUESTOR(LDO3, 2, 2), - EXTERNAL_REQUESTOR(LDO4, 2, 3), - EXTERNAL_REQUESTOR(LDO5, 2, 4), - EXTERNAL_REQUESTOR(LDO6, 2, 5), - EXTERNAL_REQUESTOR(LDO7, 2, 6), - EXTERNAL_REQUESTOR(LDO8, 2, 7), - EXTERNAL_REQUESTOR(LDO9, 3, 0), - EXTERNAL_REQUESTOR(LDOLN, 3, 1), - EXTERNAL_REQUESTOR(LDOUSB, 3, 2), -}; - Happy with this, good riddance. static const struct regmap_config palmas_regmap_config[PALMAS_NUM_CLIENTS] = { { .reg_bits = 8, @@ -365,10 +329,10 @@ static struct regmap_irq_chip tps65917_irq_chip = { int palmas_ext_control_req_config(struct palmas *palmas, enum palmas_external_requestor_id id, int ext_ctrl, bool enable) { + struct palmas_pmic_driver_data *pmic_ddata = palmas-pmic_ddata; int preq_mask_bit = 0; int reg_add = 0; - int bit_pos; - int ret; + int bit_pos, ret; I don't like this change. [...] -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog -- 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] regulator: tps65917: Fix SMPS enable/disable/is_enable
Hello Nishanth, On Friday 27 June 2014 12:01 AM, Nishanth Menon wrote: We use regmap regulator ops to enable/disable and check if regulator is enabled for various SMPS. However, these depend on valid enable_reg, enable_mask and enable_value in regulator descriptor. So, similar to fix we did in commit 318dbb02b50c (regulator: palmas: Fix SMPS enable/disable/is_enabled), populate the same for TPS65917 SMPS registration. LDO definitions are already in place. Fixes: d6f83370ed97 (regulator: palmas: Add tps65917 PMIC support) Signed-off-by: Nishanth Menon n...@ti.com --- Applies on: git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git branch: topic/palmas (4c0c9ca Merge remote-tracking branch 'regulator/fix/palmas' into regulator-palmas) Note: Ignored the minor style check from checkpatch --strict as fixing it would create an 80 char warning drivers/regulator/palmas-regulator.c |8 1 file changed, 8 insertions(+) diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c index 7c8b441..c7aa1b1 100644 --- a/drivers/regulator/palmas-regulator.c +++ b/drivers/regulator/palmas-regulator.c @@ -1333,6 +1333,14 @@ static int tps65917_smps_registration(struct palmas_pmic *pmic, pmic-current_reg_mode[id] = reg PALMAS_SMPS12_CTRL_MODE_ACTIVE_MASK; + pmic-desc[id].enable_reg = + PALMAS_BASE_TO_REG(PALMAS_SMPS_BASE, + palmas_regs_info[id].ctrl_addr); This is wrong. Please change palmas_regs_info[id].ctrl_addr to ddata-palmas_regs_info[id].ctrl_addr. The palmas_regs_info should come from the driver data for specific instances as the regmap is different for the different PMICs we support. Once you make the above changes please feel free to add Tested-by: Keerthy j-keer...@ti.com. + pmic-desc[id].enable_mask = + PALMAS_SMPS12_CTRL_MODE_ACTIVE_MASK; + /* set_mode overrides this value */ + pmic-desc[id].enable_val = SMPS_CTRL_MODE_ON; + pmic-desc[id].type = REGULATOR_VOLTAGE; pmic-desc[id].owner = THIS_MODULE; Regards, Keerthy -- 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 8/9] regulator: palmas: add driver data and modularize the probe
Hi Lee Jones, On Friday 27 June 2014 01:53 PM, Lee Jones wrote: On Wed, 18 Jun 2014, Keerthy wrote: add driver data and modularize the probe. Nit: This is a sentence, it should start with a capital letter. The series is already pulled by Mark. I Can send fixes on top of that patch set. Signed-off-by: Keerthy j-keer...@ti.com --- Changes in V2: * Fixed the order of variable declarations. drivers/mfd/palmas.c | 44 +-- drivers/regulator/palmas-regulator.c | 658 -- 2 files changed, 396 insertions(+), 306 deletions(-) diff --git a/drivers/mfd/palmas.c b/drivers/mfd/palmas.c index c12759d..28cb048 100644 --- a/drivers/mfd/palmas.c +++ b/drivers/mfd/palmas.c @@ -25,42 +25,6 @@ #include linux/mfd/palmas.h #include linux/of_device.h -#define EXTERNAL_REQUESTOR(_id, _offset, _pos) \ - [PALMAS_EXTERNAL_REQSTR_ID_##_id] = { \ - .id = PALMAS_EXTERNAL_REQSTR_ID_##_id, \ - .reg_offset = _offset, \ - .bit_pos = _pos,\ - } - -static struct palmas_sleep_requestor_info sleep_req_info[] = { - EXTERNAL_REQUESTOR(REGEN1, 0, 0), - EXTERNAL_REQUESTOR(REGEN2, 0, 1), - EXTERNAL_REQUESTOR(SYSEN1, 0, 2), - EXTERNAL_REQUESTOR(SYSEN2, 0, 3), - EXTERNAL_REQUESTOR(CLK32KG, 0, 4), - EXTERNAL_REQUESTOR(CLK32KGAUDIO, 0, 5), - EXTERNAL_REQUESTOR(REGEN3, 0, 6), - EXTERNAL_REQUESTOR(SMPS12, 1, 0), - EXTERNAL_REQUESTOR(SMPS3, 1, 1), - EXTERNAL_REQUESTOR(SMPS45, 1, 2), - EXTERNAL_REQUESTOR(SMPS6, 1, 3), - EXTERNAL_REQUESTOR(SMPS7, 1, 4), - EXTERNAL_REQUESTOR(SMPS8, 1, 5), - EXTERNAL_REQUESTOR(SMPS9, 1, 6), - EXTERNAL_REQUESTOR(SMPS10, 1, 7), - EXTERNAL_REQUESTOR(LDO1, 2, 0), - EXTERNAL_REQUESTOR(LDO2, 2, 1), - EXTERNAL_REQUESTOR(LDO3, 2, 2), - EXTERNAL_REQUESTOR(LDO4, 2, 3), - EXTERNAL_REQUESTOR(LDO5, 2, 4), - EXTERNAL_REQUESTOR(LDO6, 2, 5), - EXTERNAL_REQUESTOR(LDO7, 2, 6), - EXTERNAL_REQUESTOR(LDO8, 2, 7), - EXTERNAL_REQUESTOR(LDO9, 3, 0), - EXTERNAL_REQUESTOR(LDOLN, 3, 1), - EXTERNAL_REQUESTOR(LDOUSB, 3, 2), -}; - Happy with this, good riddance. static const struct regmap_config palmas_regmap_config[PALMAS_NUM_CLIENTS] = { { .reg_bits = 8, @@ -365,10 +329,10 @@ static struct regmap_irq_chip tps65917_irq_chip = { int palmas_ext_control_req_config(struct palmas *palmas, enum palmas_external_requestor_id id, int ext_ctrl, bool enable) { + struct palmas_pmic_driver_data *pmic_ddata = palmas-pmic_ddata; int preq_mask_bit = 0; int reg_add = 0; - int bit_pos; - int ret; + int bit_pos, ret; I don't like this change. [...] Regards, Keerthy -- 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 14/15] OMAPDSS: HDMI: remove the unused code
On 26/06/14 22:05, Jyri Sarha wrote: On 06/24/2014 01:03 PM, Tomi Valkeinen wrote: We no longer need the horrible driver internal videmode tables, which were used to decide if a given videomode is a HDMI or DVI mode. So remove all related code. Signed-off-by: Tomi Valkeinen tomi.valkei...@ti.com --- drivers/video/fbdev/omap2/dss/hdmi.h| 11 - drivers/video/fbdev/omap2/dss/hdmi_common.c | 316 2 files changed, 327 deletions(-) diff --git a/drivers/video/fbdev/omap2/dss/hdmi.h b/drivers/video/fbdev/omap2/dss/hdmi.h index e3956defc1c3..262771b9b76b 100644 --- a/drivers/video/fbdev/omap2/dss/hdmi.h +++ b/drivers/video/fbdev/omap2/dss/hdmi.h ... @@ -192,7 +187,6 @@ struct hdmi_video_format { struct hdmi_config { struct omap_video_timings timings; -struct hdmi_cm cm; struct hdmi_avi_infoframe infoframe; enum hdmi_core_hdmi_dvi hdmi_dvi_mode; }; The HDMI audio finctionality is broken already now, but removing hdmi_config.cm will cause compilation failure if HDMI audio is enabled. Ah, true. I'll mail a patch set to fix OMAP4+ HDMI audio shortly. The set should be applied on top of these patches and it fixes (obviously) the compilation issue too. I'll rather fix my series. It's not good to introduce compilation errors. So I'll just add the following in my patches: diff --git a/drivers/video/fbdev/omap2/dss/hdmi4.c b/drivers/video/fbdev/omap2/dss/hdmi4.c index 342ddb47811a..6a8550cf43e5 100644 --- a/drivers/video/fbdev/omap2/dss/hdmi4.c +++ b/drivers/video/fbdev/omap2/dss/hdmi4.c @@ -491,7 +491,7 @@ static int hdmi_audio_enable(struct omap_dss_device *dssdev) mutex_lock(hdmi.lock); - if (!hdmi_mode_has_audio(hdmi.cfg.cm.mode)) { + if (!hdmi_mode_has_audio(hdmi.cfg.hdmi_dvi_mode)) { r = -EPERM; goto err; } @@ -529,7 +529,7 @@ static bool hdmi_audio_supported(struct omap_dss_device *dssdev) mutex_lock(hdmi.lock); - r = hdmi_mode_has_audio(hdmi.cfg.cm.mode); + r = hdmi_mode_has_audio(hdmi.cfg.hdmi_dvi_mode); mutex_unlock(hdmi.lock); return r; @@ -543,7 +543,7 @@ static int hdmi_audio_config(struct omap_dss_device *dssdev, mutex_lock(hdmi.lock); - if (!hdmi_mode_has_audio(hdmi.cfg.cm.mode)) { + if (!hdmi_mode_has_audio(hdmi.cfg.hdmi_dvi_mode)) { r = -EPERM; goto err; } signature.asc Description: OpenPGP digital signature
Re: [PATCH 14/15] OMAPDSS: HDMI: remove the unused code
On 27/06/14 13:16, Tomi Valkeinen wrote: On 26/06/14 22:05, Jyri Sarha wrote: On 06/24/2014 01:03 PM, Tomi Valkeinen wrote: We no longer need the horrible driver internal videmode tables, which were used to decide if a given videomode is a HDMI or DVI mode. So remove all related code. Signed-off-by: Tomi Valkeinen tomi.valkei...@ti.com --- drivers/video/fbdev/omap2/dss/hdmi.h| 11 - drivers/video/fbdev/omap2/dss/hdmi_common.c | 316 2 files changed, 327 deletions(-) diff --git a/drivers/video/fbdev/omap2/dss/hdmi.h b/drivers/video/fbdev/omap2/dss/hdmi.h index e3956defc1c3..262771b9b76b 100644 --- a/drivers/video/fbdev/omap2/dss/hdmi.h +++ b/drivers/video/fbdev/omap2/dss/hdmi.h ... @@ -192,7 +187,6 @@ struct hdmi_video_format { struct hdmi_config { struct omap_video_timings timings; -struct hdmi_cm cm; struct hdmi_avi_infoframe infoframe; enum hdmi_core_hdmi_dvi hdmi_dvi_mode; }; The HDMI audio finctionality is broken already now, but removing hdmi_config.cm will cause compilation failure if HDMI audio is enabled. Ah, true. I'll mail a patch set to fix OMAP4+ HDMI audio shortly. The set should be applied on top of these patches and it fixes (obviously) the compilation issue too. I'll rather fix my series. It's not good to introduce compilation errors. So I'll just add the following in my patches: diff --git a/drivers/video/fbdev/omap2/dss/hdmi4.c Oh, and the same for hdmi5.c. Although that code is not compiled anyway, but I think it's still better to fix it. That could introduce a conflict with your series, but it's trivial. Tomi signature.asc Description: OpenPGP digital signature
Re: [PATCH 03/12] OMAPDSS: hdmi_wp: Add function for getting hdmi_wp physical base address
On 26/06/14 22:20, Jyri Sarha wrote: The hdmi_wp physical base address is needed for hdmi audio dma. Signed-off-by: Jyri Sarha jsa...@ti.com --- drivers/video/fbdev/omap2/dss/hdmi.h|2 ++ drivers/video/fbdev/omap2/dss/hdmi_wp.c |6 ++ 2 files changed, 8 insertions(+) diff --git a/drivers/video/fbdev/omap2/dss/hdmi.h b/drivers/video/fbdev/omap2/dss/hdmi.h index 1f01068..927cb4d 100644 --- a/drivers/video/fbdev/omap2/dss/hdmi.h +++ b/drivers/video/fbdev/omap2/dss/hdmi.h @@ -250,6 +250,7 @@ struct hdmi_core_audio_config { struct hdmi_wp_data { void __iomem *base; + phys_addr_t phys_base; }; struct hdmi_pll_data { @@ -317,6 +318,7 @@ void hdmi_wp_video_config_timing(struct hdmi_wp_data *wp, void hdmi_wp_init_vid_fmt_timings(struct hdmi_video_format *video_fmt, struct omap_video_timings *timings, struct hdmi_config *param); int hdmi_wp_init(struct platform_device *pdev, struct hdmi_wp_data *wp); +phys_addr_t hdmi_wp_get_phys_addr(struct hdmi_wp_data *wp); /* HDMI PLL funcs */ int hdmi_pll_enable(struct hdmi_pll_data *pll, struct hdmi_wp_data *wp); diff --git a/drivers/video/fbdev/omap2/dss/hdmi_wp.c b/drivers/video/fbdev/omap2/dss/hdmi_wp.c index 496327e..eadd4ed 100644 --- a/drivers/video/fbdev/omap2/dss/hdmi_wp.c +++ b/drivers/video/fbdev/omap2/dss/hdmi_wp.c @@ -247,6 +247,7 @@ int hdmi_wp_init(struct platform_device *pdev, struct hdmi_wp_data *wp) DSSERR(can't get WP mem resource\n); return -EINVAL; } + wp-phys_base = res-start; wp-base = devm_ioremap_resource(pdev-dev, res); if (IS_ERR(wp-base)) { @@ -256,3 +257,8 @@ int hdmi_wp_init(struct platform_device *pdev, struct hdmi_wp_data *wp) return 0; } + +phys_addr_t hdmi_wp_get_phys_addr(struct hdmi_wp_data *wp) +{ + return wp-phys_base; +} Maybe it would be better to have a function which returns the phys address for audio DMA? Only that one register is needed, right? That makes the purpose of the function more obvious, and also if you return the phys_base, the caller needs to know the offset to the DMA register, and that offset should be a WP internal value. Tomi signature.asc Description: OpenPGP digital signature
Re: [PATCH 04/12] OMAPDSS: hdmi_audio: Integrated ASoC DAI component driver implementation
On 26/06/14 22:20, Jyri Sarha wrote: Integrate ASoC DAI component driver in to the OMAP hdmi driver. The patch also updates the relevant entry in ti,omap5-dss DT binding document. The driver registers a dummy hdmi codec driver and a simple-card driver to produce a fully functional ALSA device. The DAI driver is implemented in hdmi_audio.c, but it still needs to be registered from hdmi4.c or hdmi5.c. Signed-off-by: Jyri Sarha jsa...@ti.com --- drivers/video/fbdev/omap2/dss/Makefile |2 + drivers/video/fbdev/omap2/dss/hdmi.h | 38 +++- drivers/video/fbdev/omap2/dss/hdmi_audio.c | 317 3 files changed, 355 insertions(+), 2 deletions(-) create mode 100644 drivers/video/fbdev/omap2/dss/hdmi_audio.c diff --git a/drivers/video/fbdev/omap2/dss/Makefile b/drivers/video/fbdev/omap2/dss/Makefile index 245f933..8260987 100644 --- a/drivers/video/fbdev/omap2/dss/Makefile +++ b/drivers/video/fbdev/omap2/dss/Makefile @@ -14,5 +14,7 @@ omapdss-$(CONFIG_OMAP2_DSS_DSI) += dsi.o omapdss-$(CONFIG_OMAP2_DSS_HDMI_COMMON) += hdmi_common.o hdmi_wp.o hdmi_pll.o \ hdmi_phy.o omapdss-$(CONFIG_OMAP4_DSS_HDMI) += hdmi4.o hdmi4_core.o +omapdss-$(CONFIG_OMAP4_DSS_HDMI_AUDIO) += hdmi_audio.o omapdss-$(CONFIG_OMAP5_DSS_HDMI) += hdmi5.o hdmi5_core.o +omapdss-$(CONFIG_OMAP5_DSS_HDMI_AUDIO) += hdmi_audio.o ccflags-$(CONFIG_OMAP2_DSS_DEBUG) += -DDEBUG diff --git a/drivers/video/fbdev/omap2/dss/hdmi.h b/drivers/video/fbdev/omap2/dss/hdmi.h index 927cb4d..cc6ecb5 100644 --- a/drivers/video/fbdev/omap2/dss/hdmi.h +++ b/drivers/video/fbdev/omap2/dss/hdmi.h @@ -25,6 +25,11 @@ #include linux/hdmi.h #include video/omapdss.h +#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO) || defined(CONFIG_OMAP5_DSS_HDMI_AUDIO) I think you're a bit overeager with these ifdefs =). They make the code more difficult to read. The question is, what is their purpose here? I'm quite sure those includes below can be included just fine even without HDMI support in the driver. So as far as I see, their only purpose would be to very minimally speed up the kernel compilation. +#include sound/dmaengine_pcm.h +#include uapi/sound/asound.h +#endif + #include dss.h /* HDMI Wrapper */ @@ -338,6 +343,35 @@ int hdmi_parse_lanes_of(struct platform_device *pdev, struct device_node *ep, struct hdmi_phy_data *phy); #if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO) || defined(CONFIG_OMAP5_DSS_HDMI_AUDIO) Same here. The struct definition doesn't do any harm, even if the audio support is not compiled in. +struct hdmi_audio_data { + /* These should be initialized when hdmi_audio_register() is called */ + struct mutex *hdmi_lock; + struct hdmi_wp_data *wp; + struct hdmi_core_data *core; + struct hdmi_config *cfg; + struct snd_soc_dai_driver *hdmi_dai_drv; + + int (*audio_start)(struct hdmi_core_data *core, +struct hdmi_wp_data *wp); + void (*audio_stop)(struct hdmi_core_data *core, +struct hdmi_wp_data *wp); + int (*audio_config)(struct hdmi_core_data *core, + struct hdmi_wp_data *wp, + struct omap_dss_audio *audio, + u32 pclk); + + /* These are of audio implementation's private use */ + struct snd_dmaengine_dai_dma_data dma_data; + struct omap_dss_audio dss_audio; + struct snd_aes_iec958 iec; + struct snd_cea_861_aud_if cea; + struct platform_device *codec_pdev; + struct platform_device *card_pdev; +}; Tomi signature.asc Description: OpenPGP digital signature
Re: [PATCH 03/12] OMAPDSS: hdmi_wp: Add function for getting hdmi_wp physical base address
On 06/27/2014 01:41 PM, Tomi Valkeinen wrote: On 26/06/14 22:20, Jyri Sarha wrote: The hdmi_wp physical base address is needed for hdmi audio dma. ... Maybe it would be better to have a function which returns the phys address for audio DMA? Only that one register is needed, right? That makes the purpose of the function more obvious, and also if you return the phys_base, the caller needs to know the offset to the DMA register, and that offset should be a WP internal value. Sounds good, I'll do that. Cheers, Jyri -- 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 06/12] OMAPDSS: hdmi4: Register HDMI audio ASoC drivers from HDMI driver
On 26/06/14 22:20, Jyri Sarha wrote: Add audio datamember to hdmi struct and call register and unregister functions form hdmi_audio.c. Register function registers the integrated cpu dai, dummy HDMI codec, and simple-card machine driver for complete HDMI audio support. Signed-off-by: Jyri Sarha jsa...@ti.com --- drivers/video/fbdev/omap2/dss/hdmi4.c | 45 + 1 file changed, 45 insertions(+) diff --git a/drivers/video/fbdev/omap2/dss/hdmi4.c b/drivers/video/fbdev/omap2/dss/hdmi4.c index 342ddb4..48f11f8 100644 --- a/drivers/video/fbdev/omap2/dss/hdmi4.c +++ b/drivers/video/fbdev/omap2/dss/hdmi4.c @@ -34,6 +34,11 @@ #include linux/regulator/consumer.h #include video/omapdss.h +#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO) No need for the ifdef here either. +#include sound/soc.h +#include sound/soc-dai.h +#endif + #include hdmi4_core.h #include dss.h #include dss_features.h @@ -52,6 +57,9 @@ static struct { struct clk *sys_clk; struct regulator *vdda_hdmi_dac_reg; +#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO) + struct hdmi_audio_data audio; +#endif bool core_enabled; struct omap_dss_device output; @@ -671,6 +679,21 @@ err: return r; } +#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO) +static struct snd_soc_dai_driver omap_hdmi_dai = { + .name = omap4-hdmi-dai, + .playback = { + .channels_min = 2, + .channels_max = 8, + .rates = (SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | + SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | + SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 | + SNDRV_PCM_RATE_192000), + .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE, + }, +}; +#endif + /* HDMI HW IP initialisation */ static int omapdss_hdmihw_probe(struct platform_device *pdev) { @@ -727,6 +750,25 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev) hdmi_init_output(pdev); +#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO) + /* drvdata is only used by HDMI audio */ + hdmi.audio.hdmi_lock = hdmi.lock; + hdmi.audio.wp = hdmi.wp; + hdmi.audio.core = hdmi.core; + hdmi.audio.cfg = hdmi.cfg; + hdmi.audio.hdmi_dai_drv = omap_hdmi_dai; + hdmi.audio.audio_start = hdmi4_audio_start; + hdmi.audio.audio_stop = hdmi4_audio_stop; + hdmi.audio.audio_config = hdmi4_audio_config; + dev_set_drvdata(pdev-dev, hdmi.audio); + r = hdmi_audio_register(pdev); + if (r) { + DSSERR(Registering HDMI audio failed\n); + hdmi_uninit_output(pdev); + pm_runtime_disable(pdev-dev); + return r; + } +#endif I don't think it's a good idea to reserve the driver data for audio. We need to change the hdmi drivers sooner or later to support multiple instances, and at that point having drvdata for audio will cause problems. If you don't want to make the hdmi struct public yet, maybe just add a function to this file which takes a pointer to the hdmi struct and returns the audio part. That way you can set the whole hdmi struct as driver data, which should be future safe. Tomi signature.asc Description: OpenPGP digital signature
RE: [PATCH v1 3/3] ARM: dts: am335x-bone: add support for beaglebone LCD4 cape
Hi Daren, Guido, From: Etheridge, Darren On 06/26/2014 10:40 AM, Guido Martínez wrote: I had some issues with this patch. Booting linux-next on a BeagleBone Black with this exact LCD left me with an unusable white screen. Please see below for some details. On Tue, Jun 24, 2014 at 05:54:26PM +0530, Pekon Gupta wrote: This patch adds support for LCD4 cape as advertised on http://elinux.org/CircuitCo:BeagleBone_LCD4 This cape has: * 480x272 TFT-LCD panel - LCD panel datasheet and timing information are sourced from [1] - LCD backlight is connected to 'EHRPWM1A' on cape board, but its used for enabling backlight power-supply. So 'gpio-backlight' driver is used instead of 'pwm-backlight' driver (Kconfig: BACKLIGHT_GPIO=y). * 4-wire resistive Touchscreen *Known constrains* As LCD panel pins (lcd_data, hsync, vsync, pclk) are shared with on-board NXP HDMI framer, so either HDMI or LCD-cape can be used at time. Thus while using this cape 'hdmi' DT node needs to be disabled in am335x-boneblack.dts [1] www.newhavendisplay.com/specs/NHD-4.3-480272MF-ATXI-T-1.pdf www.newhavendisplay.com/app_notes/OTA5180A.pdf Signed-off-by: Pekon Gupta pe...@ti.com --- snip + + panel { + status = disabled; + compatible = ti,tilcdc,panel; + pinctrl-names = default; + pinctrl-0 = bbcape_lcd_pins; + panel-info { + ac-bias = 255; + ac-bias-intrpt= 0; + dma-burst-sz = 16; + bpp = 16; + fdd = 0x80; + sync-edge = 0; + sync-ctrl = 0; I had to set this to 1. Does that make sense? Yes, I'll check this one again at my end. + raster-order = 0; + fifo-th = 0; + }; + display-timings { + native-mode = timing0; + /* www.newhavendisplay.com/app_notes/OTA5180A.pdf */ + timing0: 480x272 { + clock-frequency = 3000; + hactive = 480; + vactive = 272; + hfront-porch = 8; + hback-porch = 47; + hsync-len = 41; + vback-porch = 2; + vfront-porch = 3; + vsync-len = 10; + hsync-active = 0; + vsync-active = 0; + de-active = 1; + pixelclk-active = 0; Are you sure these timings are ok? When enabling the sync control I get an usable display, but it looks a bit funny. For example an all black display looks very clear and has a dotted pattern. I tried to take a picture of it but it doesn't show. I could run and test 'fbtest' and 'fbconsole' on this cape, using following configs CONFIG_DRM=y CONFIG_DRM_TILCDC=y [...] CONFIG_FB=y CONFIG_FIRMWARE_EDID=y CONFIG_FRAMEBUFFER_CONSOLE=y These timings look wrong to me, for instance this sets a clock frequency of 30MHz where as the linked app-note says 9MHz. I think the LCD4 cape uses the same LCD panel as is used on the AM335x EVMSK. Therefore the display timings from my DT patch for the EVMSK should work: https://patchwork.kernel.org/patch/4144801/ Yes, probably I got the pixel-clock timing wrong, I'll fix this. It should be 9.2MHz as per www.newhavendisplay.com/specs/NHD-4.3-480272MF-ATXI-T-1.pdf Table: Electrical Characteristics But as 'hsync' timings are relative to pixel-clock somehow it worked for me. I got other vsync and hsync timings from following reference: www.newhavendisplay.com/app_notes/OTA5180A.pdf Table: 8.4.1 480XRGBX272 Vertical Timing Table: 8.4.2 480XRGBX272 Horizontal Timing And I/O signal polarity for vsync-active and hsync-active from Table: 5. SIGNAL DESCRIPTIONS with regards, pekon -- 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 07/12] OMAPDSS: Kconfig: Select audio dependencies if OMAP5_DSS_HDMI_AUDIO=y
On 26/06/14 22:20, Jyri Sarha wrote: Adds help section and SND_SOC dependency to OMAP4_DSS_HDMI_AUDIO. Selects SND_OMAP_SOC, SND_SOC_HDMI_CODEC, and SND_SIMPLE_CARD if OMAP4_DSS_HDMI_AUDIO is enabled. Signed-off-by: Jyri Sarha jsa...@ti.com --- drivers/video/fbdev/omap2/dss/Kconfig | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/omap2/dss/Kconfig b/drivers/video/fbdev/omap2/dss/Kconfig index 871f722..1cce26c 100644 --- a/drivers/video/fbdev/omap2/dss/Kconfig +++ b/drivers/video/fbdev/omap2/dss/Kconfig @@ -6,9 +6,9 @@ menuconfig OMAP2_DSS select VIDEOMODE_HELPERS select OMAP2_DSS_INIT select HDMI - select SND_OMAP_SOC if OMAP4_DSS_HDMI_AUDIO - select SND_SOC_HDMI_CODEC if OMAP4_DSS_HDMI_AUDIO - select SND_SIMPLE_CARD if OMAP4_DSS_HDMI_AUDIO + select SND_OMAP_SOC if OMAP4_DSS_HDMI_AUDIO || OMAP5_DSS_HDMI_AUDIO + select SND_SOC_HDMI_CODEC if OMAP4_DSS_HDMI_AUDIO || OMAP5_DSS_HDMI_AUDIO + select SND_SIMPLE_CARD if OMAP4_DSS_HDMI_AUDIO || OMAP5_DSS_HDMI_AUDIO help OMAP2+ Display Subsystem support. @@ -99,8 +99,16 @@ config OMAP5_DSS_HDMI specification. config OMAP5_DSS_HDMI_AUDIO + bool HDMI audio support for OMAP5 depends on OMAP5_DSS_HDMI - bool + depends on SND_SOC=y || OMAP2_DSS = SND_SOC + default y These selects and depends ons make me feel a bit uneasy, but I don't have any idea how to deal with it in a nicer way... Tomi signature.asc Description: OpenPGP digital signature
Re: [PATCH V4 15/16] documentation: dt: omap: crossbar: Add description for interrupt consumer
On Thu, Jun 26, 2014 at 12:40:33PM +0530, Sricharan R wrote: From: Nishanth Menon n...@ti.com The current crossbar description does not include the description required for the consumer of the crossbar, a.k.a devices whoes events pass through the crossbar into the GIC interrupt controller. So, provide documentation for the same. Signed-off-by: Nishanth Menon n...@ti.com Signed-off-by: Sricharan R r.sricha...@ti.com Acked-by: Santosh Shilimkar santosh.shilim...@ti.com --- .../devicetree/bindings/arm/omap/crossbar.txt | 17 + 1 file changed, 17 insertions(+) diff --git a/Documentation/devicetree/bindings/arm/omap/crossbar.txt b/Documentation/devicetree/bindings/arm/omap/crossbar.txt index 6923531..35356b6 100644 --- a/Documentation/devicetree/bindings/arm/omap/crossbar.txt +++ b/Documentation/devicetree/bindings/arm/omap/crossbar.txt @@ -36,3 +36,20 @@ Examples: ti,irqs-reserved = 0 1 2 3 5 6 131 132 139 140; ti,irqs-skip = 10 133 139 140; }; + +Consumer: + +See Documentation/devicetree/bindings/interrupt-controller/interrupts.txt and +Documentation/devicetree/bindings/arm/gic.txt for further details. + +An interrupt consumer on an SoC using crossbar will use: + interrupts = GIC_SPI request_number interrupt_level +request number shall be between 0 to that described by +ti,max-crossbar-sources + +Example: + device_x@0x4a023000 { + /* Crossbar 8 used */ + interrupts = GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH; If you are going to reference MAX_SOURCES in the previous patch to the docs, then you should use the macro here as well and explain both. Or, just use numbers in the docs, and macros in the dtsi files. If you prefer the latter, just let me know and I'll fixup the other patch when applying these. Otherwise, you can just send a v5 of the two patches affected. thx, Jason. -- 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 04/12] OMAPDSS: hdmi_audio: Integrated ASoC DAI component driver implementation
On 26/06/14 22:20, Jyri Sarha wrote: Integrate ASoC DAI component driver in to the OMAP hdmi driver. The patch also updates the relevant entry in ti,omap5-dss DT binding document. The driver registers a dummy hdmi codec driver and a simple-card driver to produce a fully functional ALSA device. The DAI driver is implemented in hdmi_audio.c, but it still needs to be registered from hdmi4.c or hdmi5.c. Signed-off-by: Jyri Sarha jsa...@ti.com --- drivers/video/fbdev/omap2/dss/Makefile |2 + drivers/video/fbdev/omap2/dss/hdmi.h | 38 +++- drivers/video/fbdev/omap2/dss/hdmi_audio.c | 317 3 files changed, 355 insertions(+), 2 deletions(-) create mode 100644 drivers/video/fbdev/omap2/dss/hdmi_audio.c diff --git a/drivers/video/fbdev/omap2/dss/Makefile b/drivers/video/fbdev/omap2/dss/Makefile index 245f933..8260987 100644 --- a/drivers/video/fbdev/omap2/dss/Makefile +++ b/drivers/video/fbdev/omap2/dss/Makefile @@ -14,5 +14,7 @@ omapdss-$(CONFIG_OMAP2_DSS_DSI) += dsi.o omapdss-$(CONFIG_OMAP2_DSS_HDMI_COMMON) += hdmi_common.o hdmi_wp.o hdmi_pll.o \ hdmi_phy.o omapdss-$(CONFIG_OMAP4_DSS_HDMI) += hdmi4.o hdmi4_core.o +omapdss-$(CONFIG_OMAP4_DSS_HDMI_AUDIO) += hdmi_audio.o omapdss-$(CONFIG_OMAP5_DSS_HDMI) += hdmi5.o hdmi5_core.o +omapdss-$(CONFIG_OMAP5_DSS_HDMI_AUDIO) += hdmi_audio.o This adds the hdmi_audio.o twice. I'm not sure what the linker does, but I don't think that's correct. Maybe have a internal CONFIG_OMAP_DSS_HDMI_AUDIO option, which is selected if OMAP4 or OMAP5 HDMI AUDIO is selected by the user. That same internal option could be used in the code also (where is applies), instead of if OMAP4_AUDIO || OMAP5_AUDIO. Tomi signature.asc Description: OpenPGP digital signature
Re: [PATCH V4 13/16] irqchip: crossbar: Introduce ti,max-crossbar-sources to identify valid crossbar mapping
On Thu, Jun 26, 2014 at 12:40:31PM +0530, Sricharan R wrote: From: Nishanth Menon n...@ti.com Currently we attempt to map any crossbar value to an IRQ, however, this is not correct from hardware perspective. There is a max crossbar event number upto which hardware supports. So describe the same in device tree using 'ti,max-crossbar-sources' property and use it to validate requests. Signed-off-by: Nishanth Menon n...@ti.com Signed-off-by: Sricharan R r.sricha...@ti.com Acked-by: Santosh Shilimkar santosh.shilim...@ti.com --- .../devicetree/bindings/arm/omap/crossbar.txt |2 ++ drivers/irqchip/irq-crossbar.c | 21 ++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/arm/omap/crossbar.txt b/Documentation/devicetree/bindings/arm/omap/crossbar.txt index 5f45c78..6923531 100644 --- a/Documentation/devicetree/bindings/arm/omap/crossbar.txt +++ b/Documentation/devicetree/bindings/arm/omap/crossbar.txt @@ -10,6 +10,7 @@ Required properties: - compatible : Should be ti,irq-crossbar - reg: Base address and the size of the crossbar registers. - ti,max-irqs: Total number of irqs available at the interrupt controller. +- ti,max-crossbar-sources: Maximum number of crossbar sources that can be routed. - ti,reg-size: Size of a individual register in bytes. Every individual register is assumed to be of same size. Valid sizes are 1, 2, 4. - ti,irqs-reserved: List of the reserved irq lines that are not muxed using @@ -30,6 +31,7 @@ Examples: compatible = ti,irq-crossbar; reg = 0x4a002a48 0x130; ti,max-irqs = 160; + ti,max-crossbar-sources = MAX_SOURCES; As mentioned in my reply to #15, I can change this to 400 when I apply it, or you can send a new version of #15 using the macro and explaining it's definition. Thinking about it more, it's probably best just to use numbers in the docs. thx, Jason. -- 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 V4 00/16] irqchip: crossbar: Driver fixes
On Thu, Jun 26, 2014 at 12:42:09AM -0700, Tony Lindgren wrote: * Sricharan R r.sricha...@ti.com [140626 00:14]: This series does some cleanups, fixes for handling two interrupts getting mapped twice to same crossbar and provides support for hardwired IRQ and crossbar definitions. On certain platforms such as DRA7, SPIs 0, 1, 2, 3, 5, 6, 10, 131, 132, 133 are direct wired to hardware blocks bypassing crossbar. This quirky implementation is *NOT* supposed to be the expectation of crossbar hardware usage. This series adds support to represent such hard-wired irqs through DT and avoid generic allocation/programming of crossbar in the driver. This way of supporting hard-wired irqs was a result of the below discussions. http://www.spinics.net/lists/arm-kernel/msg329946.html Based on 3.16 rc2 mainline. Jason, once these patches look OK for merging, can you please set them up into an immutable branch so I too can merge them in? Sure thing. thx, Jason. -- 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 04/12] OMAPDSS: hdmi_audio: Integrated ASoC DAI component driver implementation
On 06/27/2014 02:57 PM, Tomi Valkeinen wrote: On 26/06/14 22:20, Jyri Sarha wrote: ... --- a/drivers/video/fbdev/omap2/dss/Makefile +++ b/drivers/video/fbdev/omap2/dss/Makefile @@ -14,5 +14,7 @@ omapdss-$(CONFIG_OMAP2_DSS_DSI) += dsi.o omapdss-$(CONFIG_OMAP2_DSS_HDMI_COMMON) += hdmi_common.o hdmi_wp.o hdmi_pll.o \ hdmi_phy.o omapdss-$(CONFIG_OMAP4_DSS_HDMI) += hdmi4.o hdmi4_core.o +omapdss-$(CONFIG_OMAP4_DSS_HDMI_AUDIO) += hdmi_audio.o omapdss-$(CONFIG_OMAP5_DSS_HDMI) += hdmi5.o hdmi5_core.o +omapdss-$(CONFIG_OMAP5_DSS_HDMI_AUDIO) += hdmi_audio.o This adds the hdmi_audio.o twice. I'm not sure what the linker does, but I don't think that's correct. Well, it works, but it is ugly. Maybe have a internal CONFIG_OMAP_DSS_HDMI_AUDIO option, which is selected if OMAP4 or OMAP5 HDMI AUDIO is selected by the user. That same internal option could be used in the code also (where is applies), instead of if OMAP4_AUDIO || OMAP5_AUDIO. I'll implement your suggestion. Cheers, Jyri -- 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 04/12] OMAPDSS: hdmi_audio: Integrated ASoC DAI component driver implementation
On 26/06/14 22:20, Jyri Sarha wrote: Integrate ASoC DAI component driver in to the OMAP hdmi driver. The patch also updates the relevant entry in ti,omap5-dss DT binding document. The driver registers a dummy hdmi codec driver and a simple-card driver to produce a fully functional ALSA device. The DAI driver is implemented in hdmi_audio.c, but it still needs to be registered from hdmi4.c or hdmi5.c. Signed-off-by: Jyri Sarha jsa...@ti.com --- snip +static const struct snd_soc_dai_ops hdmi_dai_ops = { + .startup= hdmi_dai_startup, + .hw_params = hdmi_dai_hw_params, + .prepare= hdmi_dai_prepare, + .trigger= hdmi_dai_trigger, + .shutdown = hdmi_dai_shutdown, +}; + +static const struct snd_soc_component_driver omap_hdmi_component = { + .name = omapdss_hdmi, +}; + +static struct asoc_simple_card_info card_info = { + .name = HDMI, + .card = OMAPHDMI, + .codec_dai.name = hdmi-hifi, +}; The above is not const. That, and the contents of the struct make me wonder, what happens if we have two HDMI instances? I know the core driver doesn't work with multiple instances yet, but as I mentioned, it has to be done sooner or later. And on the core driver side it should be quite straightforward. I'd rather not introduce new restrictions for that goal. Tomi signature.asc Description: OpenPGP digital signature
Re: [PATCH 09/12] ASoC: omap: Remove obsolete HDMI audio code and Kconfig options
On Thu, Jun 26, 2014 at 10:21:00PM +0300, Jyri Sarha wrote: Removes omap-hdmi DAI driver, omap-hdmi-card driver, the related Kconfig options, and Makefile entries. The HDMI DAI drivers has been integrated directly to OMAP4+ HDMI drivers and simple-card driver is used instead of omap-hdmi-card driver. Acked-by: Mark Brown broo...@linaro.org signature.asc Description: Digital signature
Re: [PATCH 04/12] OMAPDSS: hdmi_audio: Integrated ASoC DAI component driver implementation
On 06/27/2014 03:11 PM, Tomi Valkeinen wrote: On 26/06/14 22:20, Jyri Sarha wrote: ... +static struct asoc_simple_card_info card_info = { + .name = HDMI, + .card = OMAPHDMI, + .codec_dai.name = hdmi-hifi, +}; The above is not const. That, and the contents of the struct make me wonder, what happens if we have two HDMI instances? I know the core driver doesn't work with multiple instances yet, but as I mentioned, it has to be done sooner or later. And on the core driver side it should be quite straightforward. I'd rather not introduce new restrictions for that goal. Ok, I'll alloc that with devm_kzalloc(). Cheers, Jyri -- 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 04/12] OMAPDSS: hdmi_audio: Integrated ASoC DAI component driver implementation
On 27/06/14 15:26, Jyri Sarha wrote: On 06/27/2014 03:11 PM, Tomi Valkeinen wrote: On 26/06/14 22:20, Jyri Sarha wrote: ... +static struct asoc_simple_card_info card_info = { +.name = HDMI, +.card = OMAPHDMI, +.codec_dai.name = hdmi-hifi, +}; The above is not const. That, and the contents of the struct make me wonder, what happens if we have two HDMI instances? I know the core driver doesn't work with multiple instances yet, but as I mentioned, it has to be done sooner or later. And on the core driver side it should be quite straightforward. I'd rather not introduce new restrictions for that goal. Ok, I'll alloc that with devm_kzalloc(). Do the strings in the struct need to be unique? If so, you probably need to append something to them based on the hdmi device instance. Tomi signature.asc Description: OpenPGP digital signature
Re: [PATCH 04/12] OMAPDSS: hdmi_audio: Integrated ASoC DAI component driver implementation
On 06/27/2014 04:06 PM, Tomi Valkeinen wrote: On 27/06/14 15:26, Jyri Sarha wrote: On 06/27/2014 03:11 PM, Tomi Valkeinen wrote: On 26/06/14 22:20, Jyri Sarha wrote: ... +static struct asoc_simple_card_info card_info = { +.name = HDMI, +.card = OMAPHDMI, +.codec_dai.name = hdmi-hifi, +}; The above is not const. That, and the contents of the struct make me wonder, what happens if we have two HDMI instances? I know the core driver doesn't work with multiple instances yet, but as I mentioned, it has to be done sooner or later. And on the core driver side it should be quite straightforward. I'd rather not introduce new restrictions for that goal. Ok, I'll alloc that with devm_kzalloc(). Do the strings in the struct need to be unique? If so, you probably need to append something to them based on the hdmi device instance. I dont think they need to be unique, but it anyway makes sense to embed the HDMI device name into the audio device name, so I'll add it. BTW, platform_device_register_data() memdups the platform data, so a stack variable should be Ok for asoc_simple_card_info. Cheers, Jyri -- 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 06/12] OMAPDSS: hdmi4: Register HDMI audio ASoC drivers from HDMI driver
On 06/27/2014 02:39 PM, Tomi Valkeinen wrote: On 26/06/14 22:20, Jyri Sarha wrote: ... +#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO) + /* drvdata is only used by HDMI audio */ + hdmi.audio.hdmi_lock = hdmi.lock; + hdmi.audio.wp = hdmi.wp; + hdmi.audio.core = hdmi.core; + hdmi.audio.cfg = hdmi.cfg; + hdmi.audio.hdmi_dai_drv = omap_hdmi_dai; + hdmi.audio.audio_start = hdmi4_audio_start; + hdmi.audio.audio_stop = hdmi4_audio_stop; + hdmi.audio.audio_config = hdmi4_audio_config; + dev_set_drvdata(pdev-dev, hdmi.audio); + r = hdmi_audio_register(pdev); + if (r) { + DSSERR(Registering HDMI audio failed\n); + hdmi_uninit_output(pdev); + pm_runtime_disable(pdev-dev); + return r; + } +#endif I don't think it's a good idea to reserve the driver data for audio. We need to change the hdmi drivers sooner or later to support multiple instances, and at that point having drvdata for audio will cause problems. If you don't want to make the hdmi struct public yet, maybe just add a function to this file which takes a pointer to the hdmi struct and returns the audio part. That way you can set the whole hdmi struct as driver data, which should be future safe. Adding a function is not as simple as that because the OMAP4 and OMAP5 structs are subtly different and hdmi_audio.c is common to both. I'll make the minimal changes to make the struct public. Cheers, Jyri -- 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] arch: arm: mach-omap2: usb-tusb6010.c: Cleaning up variable is set more than once
On Wed, Jun 25, 2014 at 02:28:30PM +0200, Rickard Strandqvist wrote: A struct member variable is set to the same value more than once This was found using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se I think there was a bigger series from Roger rewriting most of this, but if I'm mistaken: Acked-by: Felipe Balbi ba...@ti.com --- arch/arm/mach-omap2/usb-tusb6010.c |1 - 1 file changed, 1 deletion(-) diff --git a/arch/arm/mach-omap2/usb-tusb6010.c b/arch/arm/mach-omap2/usb-tusb6010.c index e832bc7..8333400 100644 --- a/arch/arm/mach-omap2/usb-tusb6010.c +++ b/arch/arm/mach-omap2/usb-tusb6010.c @@ -95,7 +95,6 @@ static int tusb_set_sync_mode(unsigned sysclk_ps) dev_t.t_avdp_w = t_scsnh_advnh; dev_t.cyc_aavdh_we = 3; dev_t.cyc_wpl = 6; - dev_t.t_ce_rdyz = 7000; gpmc_calc_timings(t, tusb_sync, dev_t); -- 1.7.10.4 -- balbi signature.asc Description: Digital signature
Re: [PATCH] regulator: tps65917: Fix SMPS enable/disable/is_enable
On 14:48-20140627, Keerthy wrote: Hello Nishanth, On Friday 27 June 2014 12:01 AM, Nishanth Menon wrote: We use regmap regulator ops to enable/disable and check if regulator is enabled for various SMPS. However, these depend on valid enable_reg, enable_mask and enable_value in regulator descriptor. So, similar to fix we did in commit 318dbb02b50c (regulator: palmas: Fix SMPS enable/disable/is_enabled), populate the same for TPS65917 SMPS registration. LDO definitions are already in place. Fixes: d6f83370ed97 (regulator: palmas: Add tps65917 PMIC support) Signed-off-by: Nishanth Menon n...@ti.com --- Applies on: git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git branch: topic/palmas (4c0c9ca Merge remote-tracking branch 'regulator/fix/palmas' into regulator-palmas) Note: Ignored the minor style check from checkpatch --strict as fixing it would create an 80 char warning drivers/regulator/palmas-regulator.c |8 1 file changed, 8 insertions(+) diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c index 7c8b441..c7aa1b1 100644 --- a/drivers/regulator/palmas-regulator.c +++ b/drivers/regulator/palmas-regulator.c @@ -1333,6 +1333,14 @@ static int tps65917_smps_registration(struct palmas_pmic *pmic, pmic-current_reg_mode[id] = reg PALMAS_SMPS12_CTRL_MODE_ACTIVE_MASK; +pmic-desc[id].enable_reg = +PALMAS_BASE_TO_REG(PALMAS_SMPS_BASE, +palmas_regs_info[id].ctrl_addr); This is wrong. Please change palmas_regs_info[id].ctrl_addr to ddata-palmas_regs_info[id].ctrl_addr. The palmas_regs_info should come from the driver data for specific instances as the regmap is different for the different PMICs we support. Once you make the above changes please feel free to add Uggh.. just realized... since I was testing CPUFREQ with SMPS1 never realized it. and searched elsewhere on topic/palmas branch as well.. Looks like we should make the following changes? since the register data is now a parameter and it so happened that palmas_reg_info was mapping back to a valid variable and the error is easily missed - so rename the variable as well - I can break this up as proper series of patches for topic/palmas - let me know what you think.. diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c index 7c8b441..86fefdfb 100644 --- a/drivers/regulator/palmas-regulator.c +++ b/drivers/regulator/palmas-regulator.c @@ -41,7 +41,7 @@ static const struct regulator_linear_range smps_high_ranges[] = { REGULATOR_LINEAR_RANGE(330, 0x7A, 0x7f, 0), }; -static struct regs_info palmas_regs_info[] = { +static struct regs_info palmas_generic_regs_info[] = { { .name = SMPS12, .sname = smps1-in, @@ -1165,18 +1165,18 @@ static int palmas_smps_registration(struct palmas_pmic *pmic, pmic-desc[id].ops = palmas_ops_smps10; pmic-desc[id].vsel_reg = PALMAS_BASE_TO_REG(PALMAS_SMPS_BASE, - PALMAS_SMPS10_CTRL); + ddata-palmas_regs_info[id].ctrl_addr); pmic-desc[id].vsel_mask = SMPS10_VSEL; pmic-desc[id].enable_reg = PALMAS_BASE_TO_REG(PALMAS_SMPS_BASE, - PALMAS_SMPS10_CTRL); + ddata-palmas_regs_info[id].ctrl_addr); if (id == PALMAS_REG_SMPS10_OUT1) pmic-desc[id].enable_mask = SMPS10_SWITCH_EN; else pmic-desc[id].enable_mask = SMPS10_BOOST_EN; pmic-desc[id].bypass_reg = PALMAS_BASE_TO_REG(PALMAS_SMPS_BASE, - PALMAS_SMPS10_CTRL); + ddata-palmas_regs_info[id].ctrl_addr); pmic-desc[id].bypass_mask = SMPS10_BYPASS_EN; pmic-desc[id].min_uV = 375; pmic-desc[id].uV_step = 125; @@ -1188,7 +1188,7 @@ static int palmas_smps_registration(struct palmas_pmic *pmic, * otherwise we error in probe with unsupportable * ranges. Read the current smps mode for later use. */ - addr = palmas_regs_info[id].vsel_addr; + addr = ddata-palmas_regs_info[id].vsel_addr; pmic-desc[id].n_linear_ranges = 3; ret = palmas_smps_read(pmic-palmas, addr, reg
Re: [RESEND 2/2] clk: Add driver for Palmas clk32kg and clk32kgaudio clocks
Hello Peter, On Fri, Jun 27, 2014 at 8:01 AM, Peter Ujfalusi peter.ujfal...@ti.com wrote: Palmas class of devices can provide 32K clock(s) to be used by other devices on the board. Depending on the actual device the provided clocks can be: CLK32K_KG and CLK32K_KGAUDIO or only one: CLK32K_KG (TPS659039 for example) Use separate compatible flags for the two 32K clock. A system which needs or have only one of the 32k clock from Palmas will need to add node(s) for each clock as separate section in the dts file. The two compatible property is: ti,palmas-clk32kg for clk32kg clock ti,palmas-clk32kgaudio for clk32kgaudio clock Apart from the register control of the clocks - which is done via the clock API there is a posibility to enable the external sleep control. In this way the clock can be enabled/disabled on demand by the user of the clock. See the documentation for more details. Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com Reviewed-by: Nishanth Menon n...@ti.com --- drivers/clk/Kconfig | 7 ++ drivers/clk/Makefile | 1 + drivers/clk/clk-palmas.c | 307 +++ 3 files changed, 315 insertions(+) create mode 100644 drivers/clk/clk-palmas.c diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig index 9f9c5ae5359b..cfd3af7b2cbd 100644 --- a/drivers/clk/Kconfig +++ b/drivers/clk/Kconfig @@ -102,6 +102,13 @@ config COMMON_CLK_KEYSTONE Supports clock drivers for Keystone based SOCs. These SOCs have local a power sleep control module that gate the clock to the IPs and PLLs. +config COMMON_CLK_PALMAS + tristate Clock driver for TI Palmas devices + depends on MFD_PALMAS + ---help--- + This driver supports TI Palmas devices 32KHz output KG and KG_AUDIO + using common clock framework. + source drivers/clk/qcom/Kconfig endmenu diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile index 567f10259029..312742c10661 100644 --- a/drivers/clk/Makefile +++ b/drivers/clk/Makefile @@ -22,6 +22,7 @@ obj-$(CONFIG_COMMON_CLK_MAX77686) += clk-max77686.o obj-$(CONFIG_ARCH_MOXART) += clk-moxart.o obj-$(CONFIG_ARCH_NOMADIK) += clk-nomadik.o obj-$(CONFIG_ARCH_NSPIRE) += clk-nspire.o +obj-$(CONFIG_COMMON_CLK_PALMAS)+= clk-palmas.o obj-$(CONFIG_CLK_PPC_CORENET) += clk-ppc-corenet.o obj-$(CONFIG_COMMON_CLK_S2MPS11) += clk-s2mps11.o obj-$(CONFIG_COMMON_CLK_SI5351)+= clk-si5351.o diff --git a/drivers/clk/clk-palmas.c b/drivers/clk/clk-palmas.c new file mode 100644 index ..781630e1372b --- /dev/null +++ b/drivers/clk/clk-palmas.c @@ -0,0 +1,307 @@ +/* + * Clock driver for Palmas device. + * + * Copyright (c) 2013, NVIDIA Corporation. + * Copyright (c) 2013-2014 Texas Instruments, Inc. + * + * Author: Laxman Dewangan ldewan...@nvidia.com + * Peter Ujfalusi peter.ujfal...@ti.com + * + * 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 version 2. + * + * This program is distributed as is WITHOUT ANY WARRANTY of any kind, + * whether express or implied; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + */ + +#include linux/clk.h +#include linux/clkdev.h +#include linux/clk-provider.h +#include linux/mfd/palmas.h +#include linux/module.h +#include linux/of.h +#include linux/of_device.h +#include linux/platform_device.h +#include linux/slab.h + +#define PALMAS_CLOCK_DT_EXT_CONTROL_ENABLE11 +#define PALMAS_CLOCK_DT_EXT_CONTROL_ENABLE22 +#define PALMAS_CLOCK_DT_EXT_CONTROL_NSLEEP 3 + +struct palmas_clk32k_desc { + const char *clk_name; + unsigned int control_reg; + unsigned int enable_mask; + unsigned int sleep_mask; + unsigned int sleep_reqstr_id; + int delay; +}; + +struct palmas_clock_info { + struct device *dev; + struct clk *clk; + struct clk_hw hw; + struct palmas *palmas; + struct palmas_clk32k_desc *clk_desc; + int ext_control_pin; +}; + +static inline struct palmas_clock_info *to_palmas_clks_info(struct clk_hw *hw) +{ + return container_of(hw, struct palmas_clock_info, hw); +} + +static unsigned long palmas_clks_recalc_rate(struct clk_hw *hw, +unsigned long parent_rate) +{ + return 32768; +} I see that other clock drivers using a constant rate return 0 if the clock has not been enabled. So maybe is more correct to have something like the following? if (__clk_is_enabled(hw-clk)) return 32768; else return 0; Best regards, Javier -- To unsubscribe from this list: send the line unsubscribe
[PATCH v2 08/13] OMAPDSS: Kconfig: Update OMAP5_DSS_HDMI_AUDIO option
Add help section to OMAP5_DSS_HDMI_AUDIO with dependency to OMAP5_DSS_HDMI and select for OMAP_DSS_HDMI_AUDIO. Signed-off-by: Jyri Sarha jsa...@ti.com --- drivers/video/fbdev/omap2/dss/Kconfig | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/video/fbdev/omap2/dss/Kconfig b/drivers/video/fbdev/omap2/dss/Kconfig index 701164a..abd2e92 100644 --- a/drivers/video/fbdev/omap2/dss/Kconfig +++ b/drivers/video/fbdev/omap2/dss/Kconfig @@ -103,8 +103,17 @@ config OMAP5_DSS_HDMI specification. config OMAP5_DSS_HDMI_AUDIO + bool HDMI audio support for OMAP5 depends on OMAP5_DSS_HDMI - bool + depends on SND_SOC=y || OMAP2_DSS = SND_SOC + select OMAP_DSS_HDMI_AUDIO + default y + help + HDMI audio support for OMAP5 based SoCs. Adds integrated + ASoC Digital Audio Interface component driver into OMAPDSS + module. If enabled OMAP2_DSS selects SND_OMAP_SOC, + SND_SOC_HDMI_CODEC, and SND_SIMPLE_CARD for full HDMI + audio support. config OMAP2_DSS_SDI bool SDI support -- 1.7.9.5 -- 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 v2 11/13] OMAPDSS: hdmi4: Remove callbacks for an external ASoC DAI driver
Removes the OMAP4 HDMI audio callbacks for an external audio driver and the old external DAI driver does not work anymore after this patch. Signed-off-by: Jyri Sarha jsa...@ti.com --- drivers/video/fbdev/omap2/dss/hdmi4.c | 113 - 1 file changed, 113 deletions(-) diff --git a/drivers/video/fbdev/omap2/dss/hdmi4.c b/drivers/video/fbdev/omap2/dss/hdmi4.c index 3840f3f..e3937fa 100644 --- a/drivers/video/fbdev/omap2/dss/hdmi4.c +++ b/drivers/video/fbdev/omap2/dss/hdmi4.c @@ -472,112 +472,6 @@ static int hdmi_read_edid(struct omap_dss_device *dssdev, return r; } -#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO) -static int hdmi_audio_enable(struct omap_dss_device *dssdev) -{ - int r; - - mutex_lock(hdmi.lock); - - if (!hdmi_mode_has_audio(hdmi.cfg.hdmi_dvi_mode)) { - r = -EPERM; - goto err; - } - - r = hdmi_wp_audio_enable(hdmi.wp, true); - if (r) - goto err; - - mutex_unlock(hdmi.lock); - return 0; - -err: - mutex_unlock(hdmi.lock); - return r; -} - -static void hdmi_audio_disable(struct omap_dss_device *dssdev) -{ - hdmi_wp_audio_enable(hdmi.wp, false); -} - -static int hdmi_audio_start(struct omap_dss_device *dssdev) -{ - return hdmi4_audio_start(hdmi.core, hdmi.wp); -} - -static void hdmi_audio_stop(struct omap_dss_device *dssdev) -{ - hdmi4_audio_stop(hdmi.core, hdmi.wp); -} - -static bool hdmi_audio_supported(struct omap_dss_device *dssdev) -{ - bool r; - - mutex_lock(hdmi.lock); - - r = hdmi_mode_has_audio(hdmi.cfg.hdmi_dvi_mode); - - mutex_unlock(hdmi.lock); - return r; -} - -static int hdmi_audio_config(struct omap_dss_device *dssdev, - struct omap_dss_audio *audio) -{ - int r; - u32 pclk = hdmi.cfg.timings.pixelclock; - - mutex_lock(hdmi.lock); - - if (!hdmi_mode_has_audio(hdmi.cfg.hdmi_dvi_mode)) { - r = -EPERM; - goto err; - } - - r = hdmi4_audio_config(hdmi.core, hdmi.wp, audio, pclk); - if (r) - goto err; - - mutex_unlock(hdmi.lock); - return 0; - -err: - mutex_unlock(hdmi.lock); - return r; -} -#else -static int hdmi_audio_enable(struct omap_dss_device *dssdev) -{ - return -EPERM; -} - -static void hdmi_audio_disable(struct omap_dss_device *dssdev) -{ -} - -static int hdmi_audio_start(struct omap_dss_device *dssdev) -{ - return -EPERM; -} - -static void hdmi_audio_stop(struct omap_dss_device *dssdev) -{ -} - -static bool hdmi_audio_supported(struct omap_dss_device *dssdev) -{ - return false; -} - -static int hdmi_audio_config(struct omap_dss_device *dssdev, - struct omap_dss_audio *audio) -{ - return -EPERM; -} -#endif - static int hdmi_set_infoframe(struct omap_dss_device *dssdev, const struct hdmi_avi_infoframe *avi) { @@ -606,13 +500,6 @@ static const struct omapdss_hdmi_ops hdmi_ops = { .read_edid = hdmi_read_edid, .set_infoframe = hdmi_set_infoframe, .set_hdmi_mode = hdmi_set_hdmi_mode, - - .audio_enable = hdmi_audio_enable, - .audio_disable = hdmi_audio_disable, - .audio_start= hdmi_audio_start, - .audio_stop = hdmi_audio_stop, - .audio_supported= hdmi_audio_supported, - .audio_config = hdmi_audio_config, }; static void hdmi_init_output(struct platform_device *pdev) -- 1.7.9.5 -- 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 v2 03/13] OMAPDSS: hdmi_wp: Add function for getting audio dma address
The audio dma port is found in the hdmi_wp physical address space. Signed-off-by: Jyri Sarha jsa...@ti.com --- drivers/video/fbdev/omap2/dss/hdmi.h|2 ++ drivers/video/fbdev/omap2/dss/hdmi_wp.c |6 ++ 2 files changed, 8 insertions(+) diff --git a/drivers/video/fbdev/omap2/dss/hdmi.h b/drivers/video/fbdev/omap2/dss/hdmi.h index 1f01068..9e85b86 100644 --- a/drivers/video/fbdev/omap2/dss/hdmi.h +++ b/drivers/video/fbdev/omap2/dss/hdmi.h @@ -250,6 +250,7 @@ struct hdmi_core_audio_config { struct hdmi_wp_data { void __iomem *base; + phys_addr_t phys_base; }; struct hdmi_pll_data { @@ -317,6 +318,7 @@ void hdmi_wp_video_config_timing(struct hdmi_wp_data *wp, void hdmi_wp_init_vid_fmt_timings(struct hdmi_video_format *video_fmt, struct omap_video_timings *timings, struct hdmi_config *param); int hdmi_wp_init(struct platform_device *pdev, struct hdmi_wp_data *wp); +phys_addr_t hdmi_wp_get_audio_dma_addr(struct hdmi_wp_data *wp); /* HDMI PLL funcs */ int hdmi_pll_enable(struct hdmi_pll_data *pll, struct hdmi_wp_data *wp); diff --git a/drivers/video/fbdev/omap2/dss/hdmi_wp.c b/drivers/video/fbdev/omap2/dss/hdmi_wp.c index 496327e..43bf93e 100644 --- a/drivers/video/fbdev/omap2/dss/hdmi_wp.c +++ b/drivers/video/fbdev/omap2/dss/hdmi_wp.c @@ -247,6 +247,7 @@ int hdmi_wp_init(struct platform_device *pdev, struct hdmi_wp_data *wp) DSSERR(can't get WP mem resource\n); return -EINVAL; } + wp-phys_base = res-start; wp-base = devm_ioremap_resource(pdev-dev, res); if (IS_ERR(wp-base)) { @@ -256,3 +257,8 @@ int hdmi_wp_init(struct platform_device *pdev, struct hdmi_wp_data *wp) return 0; } + +phys_addr_t hdmi_wp_get_audio_dma_addr(struct hdmi_wp_data *wp) +{ + return wp-phys_base + HDMI_WP_AUDIO_DATA; +} -- 1.7.9.5 -- 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 v2 07/13] OMAPDSS: hdmi4: Register HDMI audio ASoC drivers from HDMI driver
Call register and unregister functions form hdmi_audio.c. Register function registers the integrated cpu dai, dummy HDMI codec, and simple-card machine driver for complete HDMI audio support. Signed-off-by: Jyri Sarha jsa...@ti.com --- drivers/video/fbdev/omap2/dss/hdmi4.c | 34 + 1 file changed, 34 insertions(+) diff --git a/drivers/video/fbdev/omap2/dss/hdmi4.c b/drivers/video/fbdev/omap2/dss/hdmi4.c index 58f1295..3840f3f 100644 --- a/drivers/video/fbdev/omap2/dss/hdmi4.c +++ b/drivers/video/fbdev/omap2/dss/hdmi4.c @@ -34,6 +34,9 @@ #include linux/regulator/consumer.h #include video/omapdss.h +#include sound/soc.h +#include sound/soc-dai.h + #include hdmi4_core.h #include dss.h #include dss_features.h @@ -656,6 +659,21 @@ err: return r; } +#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO) +static struct snd_soc_dai_driver omap_hdmi_dai = { + .name = omap4-hdmi-dai, + .playback = { + .channels_min = 2, + .channels_max = 8, + .rates = (SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | + SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | + SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 | + SNDRV_PCM_RATE_192000), + .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE, + }, +}; +#endif + /* HDMI HW IP initialisation */ static int omapdss_hdmihw_probe(struct platform_device *pdev) { @@ -714,6 +732,19 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev) hdmi_init_output(pdev); +#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO) + hdmi.audio.hdmi_dai_drv = omap_hdmi_dai; + hdmi.audio.audio_start = hdmi4_audio_start; + hdmi.audio.audio_stop = hdmi4_audio_stop; + hdmi.audio.audio_config = hdmi4_audio_config; + r = hdmi_audio_register(pdev); + if (r) { + DSSERR(Registering HDMI audio failed\n); + hdmi_uninit_output(pdev); + pm_runtime_disable(pdev-dev); + return r; + } +#endif dss_debugfs_create_file(hdmi, hdmi_dump_regs); return 0; @@ -721,6 +752,9 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev) static int __exit omapdss_hdmihw_remove(struct platform_device *pdev) { +#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO) + hdmi_audio_unregister(pdev); +#endif hdmi_uninit_output(pdev); pm_runtime_disable(pdev-dev); -- 1.7.9.5 -- 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 v2 12/13] OMAPDSS: hdmi5: Remove callbacks for an external ASoC DAI driver
Removes the OMAP5 HDMI audio callbacks for an external audio driver and the old external DAI driver does not work anymore after this patch. Signed-off-by: Jyri Sarha jsa...@ti.com --- drivers/video/fbdev/omap2/dss/hdmi5.c | 113 - 1 file changed, 113 deletions(-) diff --git a/drivers/video/fbdev/omap2/dss/hdmi5.c b/drivers/video/fbdev/omap2/dss/hdmi5.c index a2b2589..12d449d 100644 --- a/drivers/video/fbdev/omap2/dss/hdmi5.c +++ b/drivers/video/fbdev/omap2/dss/hdmi5.c @@ -496,112 +496,6 @@ static int hdmi_read_edid(struct omap_dss_device *dssdev, return r; } -#if defined(CONFIG_OMAP5_DSS_HDMI_AUDIO) -static int hdmi_audio_enable(struct omap_dss_device *dssdev) -{ - int r; - - mutex_lock(hdmi.lock); - - if (!hdmi_mode_has_audio(hdmi.cfg.hdmi_dvi_mode)) { - r = -EPERM; - goto err; - } - - r = hdmi_wp_audio_enable(hdmi.wp, true); - if (r) - goto err; - - mutex_unlock(hdmi.lock); - return 0; - -err: - mutex_unlock(hdmi.lock); - return r; -} - -static void hdmi_audio_disable(struct omap_dss_device *dssdev) -{ - hdmi_wp_audio_enable(hdmi.wp, false); -} - -static int hdmi_audio_start(struct omap_dss_device *dssdev) -{ - return hdmi_wp_audio_core_req_enable(hdmi.wp, true); -} - -static void hdmi_audio_stop(struct omap_dss_device *dssdev) -{ - hdmi_wp_audio_core_req_enable(hdmi.wp, false); -} - -static bool hdmi_audio_supported(struct omap_dss_device *dssdev) -{ - bool r; - - mutex_lock(hdmi.lock); - - r = hdmi_mode_has_audio(hdmi.cfg.hdmi_dvi_mode); - - mutex_unlock(hdmi.lock); - return r; -} - -static int hdmi_audio_config(struct omap_dss_device *dssdev, - struct omap_dss_audio *audio) -{ - int r; - u32 pclk = hdmi.cfg.timings.pixelclock; - - mutex_lock(hdmi.lock); - - if (!hdmi_mode_has_audio(hdmi.cfg.hdmi_dvi_mode)) { - r = -EPERM; - goto err; - } - - r = hdmi5_audio_config(hdmi.core, hdmi.wp, audio, pclk); - if (r) - goto err; - - mutex_unlock(hdmi.lock); - return 0; - -err: - mutex_unlock(hdmi.lock); - return r; -} -#else -static int hdmi_audio_enable(struct omap_dss_device *dssdev) -{ - return -EPERM; -} - -static void hdmi_audio_disable(struct omap_dss_device *dssdev) -{ -} - -static int hdmi_audio_start(struct omap_dss_device *dssdev) -{ - return -EPERM; -} - -static void hdmi_audio_stop(struct omap_dss_device *dssdev) -{ -} - -static bool hdmi_audio_supported(struct omap_dss_device *dssdev) -{ - return false; -} - -static int hdmi_audio_config(struct omap_dss_device *dssdev, - struct omap_dss_audio *audio) -{ - return -EPERM; -} -#endif - static int hdmi_set_infoframe(struct omap_dss_device *dssdev, const struct hdmi_avi_infoframe *avi) { @@ -630,13 +524,6 @@ static const struct omapdss_hdmi_ops hdmi_ops = { .read_edid = hdmi_read_edid, .set_infoframe = hdmi_set_infoframe, .set_hdmi_mode = hdmi_set_hdmi_mode, - - .audio_enable = hdmi_audio_enable, - .audio_disable = hdmi_audio_disable, - .audio_start= hdmi_audio_start, - .audio_stop = hdmi_audio_stop, - .audio_supported= hdmi_audio_supported, - .audio_config = hdmi_audio_config, }; static void hdmi_init_output(struct platform_device *pdev) -- 1.7.9.5 -- 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 v2 10/13] ASoC: omap: Remove obsolete HDMI audio code and Kconfig options
Removes omap-hdmi DAI driver, omap-hdmi-card driver, the related Kconfig options, and Makefile entries. The HDMI DAI drivers has been integrated directly to OMAP4+ HDMI drivers and simple-card driver is used instead of omap-hdmi-card driver. Signed-off-by: Jyri Sarha jsa...@ti.com --- sound/soc/omap/Kconfig | 13 -- sound/soc/omap/Makefile |4 - sound/soc/omap/omap-hdmi-card.c | 87 -- sound/soc/omap/omap-hdmi.c | 364 --- sound/soc/omap/omap-hdmi.h | 38 5 files changed, 506 deletions(-) delete mode 100644 sound/soc/omap/omap-hdmi-card.c delete mode 100644 sound/soc/omap/omap-hdmi.c delete mode 100644 sound/soc/omap/omap-hdmi.h diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig index d44463a..5c7b0aa 100644 --- a/sound/soc/omap/Kconfig +++ b/sound/soc/omap/Kconfig @@ -12,9 +12,6 @@ config SND_OMAP_SOC_MCBSP config SND_OMAP_SOC_MCPDM tristate -config SND_OMAP_SOC_HDMI - tristate - config SND_OMAP_SOC_N810 tristate SoC Audio support for Nokia N810 depends on SND_OMAP_SOC MACH_NOKIA_N810 I2C @@ -100,16 +97,6 @@ config SND_OMAP_SOC_OMAP_ABE_TWL6040 - PandaBoard (4430) - PandaBoardES (4460) -config SND_OMAP_SOC_OMAP_HDMI - tristate SoC Audio support for Texas Instruments OMAP HDMI - depends on SND_OMAP_SOC OMAP4_DSS_HDMI OMAP2_DSS - select SND_OMAP_SOC_HDMI - select SND_SOC_HDMI_CODEC - select OMAP4_DSS_HDMI_AUDIO - help - Say Y if you want to add support for SoC HDMI audio on Texas Instruments - OMAP4 chips - config SND_OMAP_SOC_OMAP3_PANDORA tristate SoC Audio support for OMAP3 Pandora depends on TWL4030_CORE SND_OMAP_SOC MACH_OMAP3_PANDORA diff --git a/sound/soc/omap/Makefile b/sound/soc/omap/Makefile index a725905..5832fe1 100644 --- a/sound/soc/omap/Makefile +++ b/sound/soc/omap/Makefile @@ -3,13 +3,11 @@ snd-soc-omap-objs := omap-pcm.o snd-soc-omap-dmic-objs := omap-dmic.o snd-soc-omap-mcbsp-objs := omap-mcbsp.o mcbsp.o snd-soc-omap-mcpdm-objs := omap-mcpdm.o -snd-soc-omap-hdmi-objs := omap-hdmi.o obj-$(CONFIG_SND_OMAP_SOC) += snd-soc-omap.o obj-$(CONFIG_SND_OMAP_SOC_DMIC) += snd-soc-omap-dmic.o obj-$(CONFIG_SND_OMAP_SOC_MCBSP) += snd-soc-omap-mcbsp.o obj-$(CONFIG_SND_OMAP_SOC_MCPDM) += snd-soc-omap-mcpdm.o -obj-$(CONFIG_SND_OMAP_SOC_HDMI) += snd-soc-omap-hdmi.o # OMAP Machine Support snd-soc-n810-objs := n810.o @@ -20,7 +18,6 @@ snd-soc-am3517evm-objs := am3517evm.o snd-soc-omap-abe-twl6040-objs := omap-abe-twl6040.o snd-soc-omap-twl4030-objs := omap-twl4030.o snd-soc-omap3pandora-objs := omap3pandora.o -snd-soc-omap-hdmi-card-objs := omap-hdmi-card.o obj-$(CONFIG_SND_OMAP_SOC_N810) += snd-soc-n810.o obj-$(CONFIG_SND_OMAP_SOC_RX51) += snd-soc-rx51.o @@ -30,4 +27,3 @@ obj-$(CONFIG_SND_OMAP_SOC_AM3517EVM) += snd-soc-am3517evm.o obj-$(CONFIG_SND_OMAP_SOC_OMAP_ABE_TWL6040) += snd-soc-omap-abe-twl6040.o obj-$(CONFIG_SND_OMAP_SOC_OMAP_TWL4030) += snd-soc-omap-twl4030.o obj-$(CONFIG_SND_OMAP_SOC_OMAP3_PANDORA) += snd-soc-omap3pandora.o -obj-$(CONFIG_SND_OMAP_SOC_OMAP_HDMI) += snd-soc-omap-hdmi-card.o diff --git a/sound/soc/omap/omap-hdmi-card.c b/sound/soc/omap/omap-hdmi-card.c deleted file mode 100644 index f649fe8..000 --- a/sound/soc/omap/omap-hdmi-card.c +++ /dev/null @@ -1,87 +0,0 @@ -/* - * omap-hdmi-card.c - * - * OMAP ALSA SoC machine driver for TI OMAP HDMI - * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ - * Author: Ricardo Neri ricardo.n...@ti.com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA - * - */ - -#include linux/module.h -#include sound/pcm.h -#include sound/soc.h -#include asm/mach-types.h -#include video/omapdss.h - -#define DRV_NAME omap-hdmi-audio - -static struct snd_soc_dai_link omap_hdmi_dai = { - .name = HDMI, - .stream_name = HDMI, - .cpu_dai_name = omap-hdmi-audio-dai, - .platform_name = omap-hdmi-audio-dai, - .codec_name = hdmi-audio-codec, - .codec_dai_name = hdmi-hifi, -}; - -static struct snd_soc_card snd_soc_omap_hdmi = { - .name = OMAPHDMI, - .owner = THIS_MODULE, - .dai_link = omap_hdmi_dai, - .num_links = 1, -}; - -static int omap_hdmi_probe(struct platform_device *pdev) -{ - struct snd_soc_card *card =
[PATCH v2 02/13] OMAPDSS: hdmi.h: Add HDMI_AUDIO_LAYOUT_6CH enum value
The OMAP5 HDMI audio implementation needs HDMI_AUDIO_LAYOUT_6CH in hdmi_core_audio_layout enum. I found the correct value from ti-linux 3.8 tree. Signed-off-by: Jyri Sarha jsa...@ti.com --- drivers/video/fbdev/omap2/dss/hdmi.h |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/video/fbdev/omap2/dss/hdmi.h b/drivers/video/fbdev/omap2/dss/hdmi.h index 262771b..1f01068 100644 --- a/drivers/video/fbdev/omap2/dss/hdmi.h +++ b/drivers/video/fbdev/omap2/dss/hdmi.h @@ -160,7 +160,8 @@ enum hdmi_audio_blk_strt_end_sig { enum hdmi_core_audio_layout { HDMI_AUDIO_LAYOUT_2CH = 0, - HDMI_AUDIO_LAYOUT_8CH = 1 + HDMI_AUDIO_LAYOUT_8CH = 1, + HDMI_AUDIO_LAYOUT_6CH = 2 }; enum hdmi_core_cts_mode { -- 1.7.9.5 -- 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 v2 05/13] OMAPDSS: hdmi_audio: Integrated ASoC DAI component driver implementation
Integrate ASoC DAI component driver in to the OMAP hdmi driver. The patch also updates the relevant entry in ti,omap5-dss DT binding document. The driver registers a dummy hdmi codec driver and a simple-card driver to produce a fully functional ALSA device. The DAI driver is implemented in hdmi_audio.c, but it still needs to be registered from hdmi4.c or hdmi5.c. Signed-off-by: Jyri Sarha jsa...@ti.com --- drivers/video/fbdev/omap2/dss/Kconfig |3 + drivers/video/fbdev/omap2/dss/Makefile |1 + drivers/video/fbdev/omap2/dss/hdmi.h | 35 ++- drivers/video/fbdev/omap2/dss/hdmi_audio.c | 323 4 files changed, 358 insertions(+), 4 deletions(-) create mode 100644 drivers/video/fbdev/omap2/dss/hdmi_audio.c diff --git a/drivers/video/fbdev/omap2/dss/Kconfig b/drivers/video/fbdev/omap2/dss/Kconfig index 3d5eb6c..41fb8ac 100644 --- a/drivers/video/fbdev/omap2/dss/Kconfig +++ b/drivers/video/fbdev/omap2/dss/Kconfig @@ -67,6 +67,9 @@ config OMAP2_DSS_VENC config OMAP2_DSS_HDMI_COMMON bool +config OMAP_DSS_HDMI_AUDIO + bool + config OMAP4_DSS_HDMI bool HDMI support for OMAP4 default y diff --git a/drivers/video/fbdev/omap2/dss/Makefile b/drivers/video/fbdev/omap2/dss/Makefile index 245f933..a95d715 100644 --- a/drivers/video/fbdev/omap2/dss/Makefile +++ b/drivers/video/fbdev/omap2/dss/Makefile @@ -13,6 +13,7 @@ omapdss-$(CONFIG_OMAP2_DSS_SDI) += sdi.o omapdss-$(CONFIG_OMAP2_DSS_DSI) += dsi.o omapdss-$(CONFIG_OMAP2_DSS_HDMI_COMMON) += hdmi_common.o hdmi_wp.o hdmi_pll.o \ hdmi_phy.o +omapdss-$(CONFIG_OMAP_DSS_HDMI_AUDIO) += hdmi_audio.o omapdss-$(CONFIG_OMAP4_DSS_HDMI) += hdmi4.o hdmi4_core.o omapdss-$(CONFIG_OMAP5_DSS_HDMI) += hdmi5.o hdmi5_core.o ccflags-$(CONFIG_OMAP2_DSS_DEBUG) += -DDEBUG diff --git a/drivers/video/fbdev/omap2/dss/hdmi.h b/drivers/video/fbdev/omap2/dss/hdmi.h index 075357e..61ad4ce 100644 --- a/drivers/video/fbdev/omap2/dss/hdmi.h +++ b/drivers/video/fbdev/omap2/dss/hdmi.h @@ -25,6 +25,9 @@ #include linux/hdmi.h #include video/omapdss.h +#include sound/dmaengine_pcm.h +#include uapi/sound/asound.h + #include dss.h /* HDMI Wrapper */ @@ -337,7 +340,32 @@ int hdmi_phy_parse_lanes(struct hdmi_phy_data *phy, const u32 *lanes); int hdmi_parse_lanes_of(struct platform_device *pdev, struct device_node *ep, struct hdmi_phy_data *phy); -#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO) || defined(CONFIG_OMAP5_DSS_HDMI_AUDIO) +/* HDMI audio support */ +struct hdmi_audio_data { + /* These should be initialized when hdmi_audio_register() is called */ + struct snd_soc_dai_driver *hdmi_dai_drv; + + int (*audio_start)(struct hdmi_core_data *core, + struct hdmi_wp_data *wp); + void (*audio_stop)(struct hdmi_core_data *core, + struct hdmi_wp_data *wp); + int (*audio_config)(struct hdmi_core_data *core, + struct hdmi_wp_data *wp, + struct omap_dss_audio *audio, + u32 pclk); + + /* These are for audio implementation's private use */ + struct snd_dmaengine_dai_dma_data dma_data; + struct omap_dss_audio dss_audio; + struct snd_aes_iec958 iec; + struct snd_cea_861_aud_if cea; + struct platform_device *codec_pdev; + struct platform_device *card_pdev; +}; + +int hdmi_audio_register(struct platform_device *pdev); +void hdmi_audio_unregister(struct platform_device *pdev); + int hdmi_compute_acr(u32 pclk, u32 sample_freq, u32 *n, u32 *cts); int hdmi_wp_audio_enable(struct hdmi_wp_data *wp, bool enable); int hdmi_wp_audio_core_req_enable(struct hdmi_wp_data *wp, bool enable); @@ -345,9 +373,9 @@ void hdmi_wp_audio_config_format(struct hdmi_wp_data *wp, struct hdmi_audio_format *aud_fmt); void hdmi_wp_audio_config_dma(struct hdmi_wp_data *wp, struct hdmi_audio_dma *aud_dma); -static inline bool hdmi_mode_has_audio(int mode) +static inline bool hdmi_mode_has_audio(struct hdmi_config *cfg) { - return mode == HDMI_HDMI ? true : false; + return cfg-hdmi_dvi_mode == HDMI_HDMI ? true : false; } /* HDMI DRV data */ @@ -374,4 +402,3 @@ struct omap_hdmi { }; #endif -#endif diff --git a/drivers/video/fbdev/omap2/dss/hdmi_audio.c b/drivers/video/fbdev/omap2/dss/hdmi_audio.c new file mode 100644 index 000..7b53a5f --- /dev/null +++ b/drivers/video/fbdev/omap2/dss/hdmi_audio.c @@ -0,0 +1,323 @@ +/* + * OMAP4+ HDMI audio + * + * Copyright (C) 2014 Texas Instruments Incorporated + * + * Authors: Jyri Sarha jsa...@ti.com + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY
[PATCH v2 06/13] OMAPDSS: Kconfig: Update OMAP4_DSS_HDMI_AUDIO option
Add help section to OMAP4_DSS_HDMI_AUDIO with dependency to OMAP4_DSS_HDMI and select for newly created OMAP_DSS_HDMI_AUDIO. The OMAP_DSS_HDMI_AUDIO option is for common HDMI audio support and it is is dependent on SND_SOC. Also selects SND_OMAP_SOC, SND_SOC_HDMI_CODEC, and SND_SIMPLE_CARD for OMAP2_DSS if OMAP_DSS_HDMI_AUDIO is enabled. Signed-off-by: Jyri Sarha jsa...@ti.com --- drivers/video/fbdev/omap2/dss/Kconfig | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/video/fbdev/omap2/dss/Kconfig b/drivers/video/fbdev/omap2/dss/Kconfig index 41fb8ac..701164a 100644 --- a/drivers/video/fbdev/omap2/dss/Kconfig +++ b/drivers/video/fbdev/omap2/dss/Kconfig @@ -6,6 +6,9 @@ menuconfig OMAP2_DSS select VIDEOMODE_HELPERS select OMAP2_DSS_INIT select HDMI + select SND_OMAP_SOC if OMAP_DSS_HDMI_AUDIO + select SND_SOC_HDMI_CODEC if OMAP_DSS_HDMI_AUDIO + select SND_SIMPLE_CARD if OMAP_DSS_HDMI_AUDIO help OMAP2+ Display Subsystem support. @@ -78,7 +81,17 @@ config OMAP4_DSS_HDMI HDMI support for OMAP4 based SoCs. config OMAP4_DSS_HDMI_AUDIO - bool + bool HDMI audio support for OMAP4 + depends on OMAP4_DSS_HDMI + depends on SND_SOC=y || OMAP2_DSS = SND_SOC + select OMAP_DSS_HDMI_AUDIO + default y + help + HDMI audio support for OMAP4 based SoCs. Adds integrated + ASoC Digital Audio Interface component driver into OMAPDSS + module. If enabled OMAP2_DSS selects SND_OMAP_SOC, + SND_SOC_HDMI_CODEC, and SND_SIMPLE_CARD for full HDMI + audio support. config OMAP5_DSS_HDMI bool HDMI support for OMAP5 -- 1.7.9.5 -- 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 v2 01/13] ARM: OMAP2+: Remove non working OMAP HDMI audio initialization
This code is not working currently and it can be removed. There is a conflict in sharing resources with the actual HDMI driver and with the ASoC HDMI audio DAI driver. Signed-off-by: Jyri Sarha jsa...@ti.com --- arch/arm/mach-omap2/devices.c | 28 1 file changed, 28 deletions(-) diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 592ba0a..b6f8f34 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -297,33 +297,6 @@ static void omap_init_audio(void) static inline void omap_init_audio(void) {} #endif -#if defined(CONFIG_SND_OMAP_SOC_OMAP_HDMI) || \ - defined(CONFIG_SND_OMAP_SOC_OMAP_HDMI_MODULE) - -static struct platform_device omap_hdmi_audio = { - .name = omap-hdmi-audio, - .id = -1, -}; - -static void __init omap_init_hdmi_audio(void) -{ - struct omap_hwmod *oh; - struct platform_device *pdev; - - oh = omap_hwmod_lookup(dss_hdmi); - if (!oh) - return; - - pdev = omap_device_build(omap-hdmi-audio-dai, -1, oh, NULL, 0); - WARN(IS_ERR(pdev), -Can't build omap_device for omap-hdmi-audio-dai.\n); - - platform_device_register(omap_hdmi_audio); -} -#else -static inline void omap_init_hdmi_audio(void) {} -#endif - #if defined(CONFIG_SPI_OMAP24XX) || defined(CONFIG_SPI_OMAP24XX_MODULE) #include linux/platform_data/spi-omap2-mcspi.h @@ -459,7 +432,6 @@ static int __init omap2_init_devices(void) */ omap_init_audio(); omap_init_camera(); - omap_init_hdmi_audio(); omap_init_mbox(); /* If dtb is there, the devices will be created dynamically */ if (!of_have_populated_dt()) { -- 1.7.9.5 -- 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 v2 09/13] OMAPDSS: hdmi5: Register HDMI audio ASoC drivers from HDMI driver
Call register and unregister functions form hdmi_audio.c. Register function registers the integrated cpu dai, dummy HDMI codec, and simple-card machine driver for complete HDMI audio support. Signed-off-by: Jyri Sarha jsa...@ti.com --- drivers/video/fbdev/omap2/dss/hdmi5.c | 46 + 1 file changed, 46 insertions(+) diff --git a/drivers/video/fbdev/omap2/dss/hdmi5.c b/drivers/video/fbdev/omap2/dss/hdmi5.c index 83925a9..a2b2589 100644 --- a/drivers/video/fbdev/omap2/dss/hdmi5.c +++ b/drivers/video/fbdev/omap2/dss/hdmi5.c @@ -39,6 +39,9 @@ #include linux/regulator/consumer.h #include video/omapdss.h +#include sound/soc.h +#include sound/soc-dai.h + #include hdmi5_core.h #include dss.h #include dss_features.h @@ -680,6 +683,33 @@ err: return r; } +#if defined(CONFIG_OMAP5_DSS_HDMI_AUDIO) +static int audio_start(struct hdmi_core_data *core, struct hdmi_wp_data *wp) +{ + hdmi_wp_audio_core_req_enable(wp, true); + + return 0; +} + +static void audio_stop(struct hdmi_core_data *core, struct hdmi_wp_data *wp) +{ + hdmi_wp_audio_core_req_enable(wp, false); +} + +static struct snd_soc_dai_driver omap_hdmi_dai = { + .name = omap5-hdmi-dai, + .playback = { + .channels_min = 2, + .channels_max = 8, + .rates = (SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | + SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | + SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 | + SNDRV_PCM_RATE_192000), + .formats = SNDRV_PCM_FMTBIT_S16_LE, + }, +}; +#endif + /* HDMI HW IP initialisation */ static int omapdss_hdmihw_probe(struct platform_device *pdev) { @@ -738,6 +768,19 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev) hdmi_init_output(pdev); +#if defined(CONFIG_OMAP5_DSS_HDMI_AUDIO) + hdmi.audio.hdmi_dai_drv = omap_hdmi_dai; + hdmi.audio.audio_start = audio_start; + hdmi.audio.audio_stop = audio_stop; + hdmi.audio.audio_config = hdmi5_audio_config; + r = hdmi_audio_register(pdev); + if (r) { + DSSERR(Registering HDMI audio failed\n); + hdmi_uninit_output(pdev); + pm_runtime_disable(pdev-dev); + return r; + } +#endif dss_debugfs_create_file(hdmi, hdmi_dump_regs); return 0; @@ -745,6 +788,9 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev) static int __exit omapdss_hdmihw_remove(struct platform_device *pdev) { +#if defined(CONFIG_OMAP5_DSS_HDMI_AUDIO) + hdmi_audio_unregister(pdev); +#endif hdmi_uninit_output(pdev); pm_runtime_disable(pdev-dev); -- 1.7.9.5 -- 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 v2 04/13] OMAPDSS: hdmi: Make hdmi structure public
Name the anonymous hdmi struct as omap_hdmi. Move the struct definition to hdmi.h and turn core member into a pointer to deal with it's different definitions for omap4 and omap5. Make associated changes to hdmi4.c and hdmi5.c. Signed-off-by: Jyri Sarha jsa...@ti.com --- drivers/video/fbdev/omap2/dss/hdmi.h | 24 +++ drivers/video/fbdev/omap2/dss/hdmi4.c | 41 +++-- drivers/video/fbdev/omap2/dss/hdmi5.c | 30 +++- 3 files changed, 46 insertions(+), 49 deletions(-) diff --git a/drivers/video/fbdev/omap2/dss/hdmi.h b/drivers/video/fbdev/omap2/dss/hdmi.h index 9e85b86..075357e 100644 --- a/drivers/video/fbdev/omap2/dss/hdmi.h +++ b/drivers/video/fbdev/omap2/dss/hdmi.h @@ -349,5 +349,29 @@ static inline bool hdmi_mode_has_audio(int mode) { return mode == HDMI_HDMI ? true : false; } + +/* HDMI DRV data */ +struct omap_hdmi { + struct mutex lock; + struct platform_device *pdev; + + struct hdmi_wp_data wp; + struct hdmi_pll_datapll; + struct hdmi_phy_dataphy; + struct hdmi_core_data *core; + + struct hdmi_config cfg; + + struct clk *sys_clk; + struct regulator *vdda_reg; + +#if defined(CONFIG_OMAP_DSS_HDMI_AUDIO) + struct hdmi_audio_data audio; +#endif + bool core_enabled; + + struct omap_dss_device output; +}; + #endif #endif diff --git a/drivers/video/fbdev/omap2/dss/hdmi4.c b/drivers/video/fbdev/omap2/dss/hdmi4.c index 6a8550c..58f1295 100644 --- a/drivers/video/fbdev/omap2/dss/hdmi4.c +++ b/drivers/video/fbdev/omap2/dss/hdmi4.c @@ -37,25 +37,10 @@ #include hdmi4_core.h #include dss.h #include dss_features.h +#include hdmi.h -static struct { - struct mutex lock; - struct platform_device *pdev; - - struct hdmi_wp_data wp; - struct hdmi_pll_datapll; - struct hdmi_phy_dataphy; - struct hdmi_core_data core; - - struct hdmi_config cfg; - - struct clk *sys_clk; - struct regulator *vdda_hdmi_dac_reg; - - bool core_enabled; - - struct omap_dss_device output; -} hdmi; +static struct omap_hdmi hdmi; +static struct hdmi_core_data hdmi4_core; static int hdmi_runtime_get(void) { @@ -117,7 +102,7 @@ static int hdmi_init_regulator(void) int r; struct regulator *reg; - if (hdmi.vdda_hdmi_dac_reg != NULL) + if (hdmi.vdda_reg != NULL) return 0; reg = devm_regulator_get(hdmi.pdev-dev, vdda); @@ -137,7 +122,7 @@ static int hdmi_init_regulator(void) } } - hdmi.vdda_hdmi_dac_reg = reg; + hdmi.vdda_reg = reg; return 0; } @@ -146,7 +131,7 @@ static int hdmi_power_on_core(struct omap_dss_device *dssdev) { int r; - r = regulator_enable(hdmi.vdda_hdmi_dac_reg); + r = regulator_enable(hdmi.vdda_reg); if (r) return r; @@ -162,7 +147,7 @@ static int hdmi_power_on_core(struct omap_dss_device *dssdev) return 0; err_runtime_get: - regulator_disable(hdmi.vdda_hdmi_dac_reg); + regulator_disable(hdmi.vdda_reg); return r; } @@ -172,7 +157,7 @@ static void hdmi_power_off_core(struct omap_dss_device *dssdev) hdmi.core_enabled = false; hdmi_runtime_put(); - regulator_disable(hdmi.vdda_hdmi_dac_reg); + regulator_disable(hdmi.vdda_reg); } static int hdmi_power_on_full(struct omap_dss_device *dssdev) @@ -217,7 +202,7 @@ static int hdmi_power_on_full(struct omap_dss_device *dssdev) if (r) goto err_phy_pwr; - hdmi4_configure(hdmi.core, hdmi.wp, hdmi.cfg); + hdmi4_configure(hdmi.core, hdmi.wp, hdmi.cfg); /* bypass TV gamma table */ dispc_enable_gamma_table(0); @@ -308,7 +293,7 @@ static void hdmi_dump_regs(struct seq_file *s) hdmi_wp_dump(hdmi.wp, s); hdmi_pll_dump(hdmi.pll, s); hdmi_phy_dump(hdmi.phy, s); - hdmi4_core_dump(hdmi.core, s); + hdmi4_core_dump(hdmi.core, s); hdmi_runtime_put(); mutex_unlock(hdmi.lock); @@ -323,7 +308,7 @@ static int read_edid(u8 *buf, int len) r = hdmi_runtime_get(); BUG_ON(r); - r = hdmi4_read_edid(hdmi.core, buf, len); + r = hdmi4_read_edid(hdmi.core, buf, len); hdmi_runtime_put(); mutex_unlock(hdmi.lock); @@ -678,6 +663,8 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev) int irq; hdmi.pdev = pdev; + hdmi.core = hdmi4_core; + dev_set_drvdata(pdev-dev, hdmi); mutex_init(hdmi.lock); @@ -699,7 +686,7 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev) if (r) return r; - r = hdmi4_core_init(pdev, hdmi.core); + r = hdmi4_core_init(pdev, hdmi.core); if (r) return r; diff --git a/drivers/video/fbdev/omap2/dss/hdmi5.c b/drivers/video/fbdev/omap2/dss/hdmi5.c
[PATCH v2 00/13] Rework OMAP4+ HDMI audio support
Chanhes since fist version: - Make hdmi struct public - http://mailman.alsa-project.org/pipermail/alsa-devel/2014-June/078220.html - Change hdmi_wp_get_phys_addr() to hdmi_wp_get_audio_dma_addr() - http://mailman.alsa-project.org/pipermail/alsa-devel/2014-June/078213.html - Remove unnecessary ifdefs - http://mailman.alsa-project.org/pipermail/alsa-devel/2014-June/078218.html - http://mailman.alsa-project.org/pipermail/alsa-devel/2014-June/078220.html - Make audio support multiple instance safe - http://mailman.alsa-project.org/pipermail/alsa-devel/2014-June/078225.html - Add hdmi_audio.o only once to linking line - http://mailman.alsa-project.org/pipermail/alsa-devel/2014-June/078223.html - Unique name for audio card - http://mailman.alsa-project.org/pipermail/alsa-devel/2014-June/078230.html The patches are based on linux 3.16-rc2 and OMAPDSS HDMI infoframe patches[1] from Tomi Valkeinen. The base, the patches, and couple of additional not-to-be-merged omap2plus_defconfig patches can be found here: git://git.ti.com/~jyrisarha/ti-linux-kernel/jyrisarhas-audio-video-linux-feature-tree.git omap-hdmi-audio The patch set fixes OMAP4+ HDMI audio. The structure of the implementation looks a bit different than before. Instead of creating a driver specific API for a separate ASoC component driver to connect to, this implementation integrates an the ASoC cpu-dai component driver into the HDMI driver. Also the other ASoC component drivers needed for operational audio are automatically registered by the HDMI driver. There is no need to add anything to the device tree as long as the nodes needed for HDMI video are there. Big part of the HDMI audio code is still unchanged and there is a need for a cleanup there. Also there is still probably something wrong with speaker mapping of multi-channel streams. I will get back to cleaning up these issues later. Best regards, Jyri Jyri Sarha (13): ARM: OMAP2+: Remove non working OMAP HDMI audio initialization OMAPDSS: hdmi.h: Add HDMI_AUDIO_LAYOUT_6CH enum value OMAPDSS: hdmi_wp: Add function for getting audio dma address OMAPDSS: hdmi: Make hdmi structure public OMAPDSS: hdmi_audio: Integrated ASoC DAI component driver implementation OMAPDSS: Kconfig: Update OMAP4_DSS_HDMI_AUDIO option OMAPDSS: hdmi4: Register HDMI audio ASoC drivers from HDMI driver OMAPDSS: Kconfig: Update OMAP5_DSS_HDMI_AUDIO option OMAPDSS: hdmi5: Register HDMI audio ASoC drivers from HDMI driver ASoC: omap: Remove obsolete HDMI audio code and Kconfig options OMAPDSS: hdmi4: Remove callbacks for an external ASoC DAI driver OMAPDSS: hdmi5: Remove callbacks for an external ASoC DAI driver OMAPDSS: Remove all references to obsolete HDMI audio callbacks arch/arm/mach-omap2/devices.c | 28 -- .../fbdev/omap2/displays-new/connector-hdmi.c | 99 -- .../fbdev/omap2/displays-new/encoder-tpd12s015.c | 56 --- drivers/video/fbdev/omap2/dss/Kconfig | 29 +- drivers/video/fbdev/omap2/dss/Makefile |1 + drivers/video/fbdev/omap2/dss/hdmi.h | 62 +++- drivers/video/fbdev/omap2/dss/hdmi4.c | 188 +++--- drivers/video/fbdev/omap2/dss/hdmi5.c | 189 +++--- drivers/video/fbdev/omap2/dss/hdmi_audio.c | 323 + drivers/video/fbdev/omap2/dss/hdmi_wp.c|6 + include/video/omapdss.h| 31 -- sound/soc/omap/Kconfig | 13 - sound/soc/omap/Makefile|4 - sound/soc/omap/omap-hdmi-card.c| 87 - sound/soc/omap/omap-hdmi.c | 364 sound/soc/omap/omap-hdmi.h | 38 -- 16 files changed, 517 insertions(+), 1001 deletions(-) create mode 100644 drivers/video/fbdev/omap2/dss/hdmi_audio.c delete mode 100644 sound/soc/omap/omap-hdmi-card.c delete mode 100644 sound/soc/omap/omap-hdmi.c delete mode 100644 sound/soc/omap/omap-hdmi.h -- 1.7.9.5 -- 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 v2 13/13] OMAPDSS: Remove all references to obsolete HDMI audio callbacks
In new model these callbacks are obsolete since the ASoC component drivers are integrated into the HDMI drivers and no callbacks are needed anymore. Signed-off-by: Jyri Sarha jsa...@ti.com --- .../fbdev/omap2/displays-new/connector-hdmi.c | 99 .../fbdev/omap2/displays-new/encoder-tpd12s015.c | 56 --- include/video/omapdss.h| 31 -- 3 files changed, 186 deletions(-) diff --git a/drivers/video/fbdev/omap2/displays-new/connector-hdmi.c b/drivers/video/fbdev/omap2/displays-new/connector-hdmi.c index 131c6e2..dd36d71 100644 --- a/drivers/video/fbdev/omap2/displays-new/connector-hdmi.c +++ b/drivers/video/fbdev/omap2/displays-new/connector-hdmi.c @@ -170,98 +170,6 @@ static bool hdmic_detect(struct omap_dss_device *dssdev) return in-ops.hdmi-detect(in); } -static int hdmic_audio_enable(struct omap_dss_device *dssdev) -{ - struct panel_drv_data *ddata = to_panel_data(dssdev); - struct omap_dss_device *in = ddata-in; - int r; - - /* enable audio only if the display is active */ - if (!omapdss_device_is_enabled(dssdev)) - return -EPERM; - - r = in-ops.hdmi-audio_enable(in); - if (r) - return r; - - dssdev-audio_state = OMAP_DSS_AUDIO_ENABLED; - - return 0; -} - -static void hdmic_audio_disable(struct omap_dss_device *dssdev) -{ - struct panel_drv_data *ddata = to_panel_data(dssdev); - struct omap_dss_device *in = ddata-in; - - in-ops.hdmi-audio_disable(in); - - dssdev-audio_state = OMAP_DSS_AUDIO_DISABLED; -} - -static int hdmic_audio_start(struct omap_dss_device *dssdev) -{ - struct panel_drv_data *ddata = to_panel_data(dssdev); - struct omap_dss_device *in = ddata-in; - int r; - - /* -* No need to check the panel state. It was checked when trasitioning -* to AUDIO_ENABLED. -*/ - if (dssdev-audio_state != OMAP_DSS_AUDIO_ENABLED) - return -EPERM; - - r = in-ops.hdmi-audio_start(in); - if (r) - return r; - - dssdev-audio_state = OMAP_DSS_AUDIO_PLAYING; - - return 0; -} - -static void hdmic_audio_stop(struct omap_dss_device *dssdev) -{ - struct panel_drv_data *ddata = to_panel_data(dssdev); - struct omap_dss_device *in = ddata-in; - - in-ops.hdmi-audio_stop(in); - - dssdev-audio_state = OMAP_DSS_AUDIO_ENABLED; -} - -static bool hdmic_audio_supported(struct omap_dss_device *dssdev) -{ - struct panel_drv_data *ddata = to_panel_data(dssdev); - struct omap_dss_device *in = ddata-in; - - if (!omapdss_device_is_enabled(dssdev)) - return false; - - return in-ops.hdmi-audio_supported(in); -} - -static int hdmic_audio_config(struct omap_dss_device *dssdev, - struct omap_dss_audio *audio) -{ - struct panel_drv_data *ddata = to_panel_data(dssdev); - struct omap_dss_device *in = ddata-in; - int r; - - /* config audio only if the display is active */ - if (!omapdss_device_is_enabled(dssdev)) - return -EPERM; - - r = in-ops.hdmi-audio_config(in, audio); - if (r) - return r; - - dssdev-audio_state = OMAP_DSS_AUDIO_CONFIGURED; - - return 0; -} - static int hdmic_set_hdmi_mode(struct omap_dss_device *dssdev, bool hdmi_mode) { struct panel_drv_data *ddata = to_panel_data(dssdev); @@ -296,13 +204,6 @@ static struct omap_dss_driver hdmic_driver = { .detect = hdmic_detect, .set_hdmi_mode = hdmic_set_hdmi_mode, .set_hdmi_infoframe = hdmic_set_infoframe, - - .audio_enable = hdmic_audio_enable, - .audio_disable = hdmic_audio_disable, - .audio_start= hdmic_audio_start, - .audio_stop = hdmic_audio_stop, - .audio_supported= hdmic_audio_supported, - .audio_config = hdmic_audio_config, }; static int hdmic_probe_pdata(struct platform_device *pdev) diff --git a/drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c b/drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c index c891d8f..235e3d5 100644 --- a/drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c +++ b/drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c @@ -193,55 +193,6 @@ static bool tpd_detect(struct omap_dss_device *dssdev) return gpio_get_value_cansleep(ddata-hpd_gpio); } -static int tpd_audio_enable(struct omap_dss_device *dssdev) -{ - struct panel_drv_data *ddata = to_panel_data(dssdev); - struct omap_dss_device *in = ddata-in; - - return in-ops.hdmi-audio_enable(in); -} - -static void tpd_audio_disable(struct omap_dss_device *dssdev) -{ - struct panel_drv_data *ddata = to_panel_data(dssdev); - struct omap_dss_device *in = ddata-in; - - in-ops.hdmi-audio_disable(in); -} - -static int
[PATCH 0/3] GPIO OMAP driver changes for v3.17
Hi Linus, This is a small series with trivial changes to the gpio-omap driver. There are no functional changes. Patches 1 and 2 removes code that it's not necessary anymore now that the driver has been converted to use the gpiolib irqchip and Patch 3 adds an omap prefix to all driver functions, something that you suggested me to do before if I remember correctly. The patch-set is composed of the following patches: Javier Martinez Canillas (3): gpio: omap: Remove unnecessary lockdep class gpio: omap: Remove unneeded include gpio: omap: Add an omap prefix to all functions drivers/gpio/gpio-omap.c | 275 +++ 1 file changed, 137 insertions(+), 138 deletions(-) Best regards, Javier -- 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] gpio: omap: Remove unnecessary lockdep class
GPIO irqchips assign to the cascaded IRQs their own lock class in order to avoid warnings about lockdep recursions since that allow the lockdep core to keep track of things. Since commit e45d1c80 (gpio: put GPIO IRQs into their own lock class) there is no need to do this in a driver if it's using the GPIO irqchip helpers since gpiolib already assigns a lockdep class. Signed-off-by: Javier Martinez Canillas jmarti...@softcrates.net --- drivers/gpio/gpio-omap.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index 00f29aa..4b4e1b4 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c @@ -1025,11 +1025,6 @@ static void __init omap_gpio_show_rev(struct gpio_bank *bank) called = true; } -/* This lock class tells lockdep that GPIO irqs are in a different - * category than their parents, so it won't report false recursion. - */ -static struct lock_class_key gpio_lock_class; - static void omap_gpio_mod_init(struct gpio_bank *bank) { void __iomem *base = bank-base; @@ -1152,7 +1147,6 @@ static int omap_gpio_chip_init(struct gpio_bank *bank) for (j = 0; j bank-width; j++) { int irq = irq_find_mapping(bank-chip.irqdomain, j); - irq_set_lockdep_class(irq, gpio_lock_class); if (bank-is_mpuio) { omap_mpuio_alloc_gc(bank, irq, bank-width); irq_set_chip_and_handler(irq, NULL, NULL); -- 2.0.0.rc2 -- 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] gpio: omap: Remove unneeded include
The linux/irqchip/chained_irq.h header is already included when selecting GPIOLIB_IRQCHIP so there is no need to do it in the driver. This is a left over from commit fb655f5 (gpio: omap: convert driver to use gpiolib irqchip). Signed-off-by: Javier Martinez Canillas jmarti...@softcrates.net --- drivers/gpio/gpio-omap.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index 4b4e1b4..ef461e7 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c @@ -24,7 +24,6 @@ #include linux/pm.h #include linux/of.h #include linux/of_device.h -#include linux/irqchip/chained_irq.h #include linux/gpio.h #include linux/bitops.h #include linux/platform_data/gpio-omap.h -- 2.0.0.rc2 -- 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] gpio: omap: Add an omap prefix to all functions
The GPIO OMAP driver didn't have a consistent naming scheme for all its functions. Some of them had an omap prefix while others didn't. There are many advantages on having a separate namespace for driver functions so let's add an omap prefix to all of them. Signed-off-by: Javier Martinez Canillas jmarti...@softcrates.net --- drivers/gpio/gpio-omap.c | 268 --- 1 file changed, 137 insertions(+), 131 deletions(-) diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index ef461e7..1749321 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c @@ -88,18 +88,19 @@ struct gpio_bank { #define BANK_USED(bank) (bank-mod_usage || bank-irq_usage) #define LINE_USED(line, offset) (line (BIT(offset))) -static int irq_to_gpio(struct gpio_bank *bank, unsigned int gpio_irq) +static int omap_irq_to_gpio(struct gpio_bank *bank, unsigned int gpio_irq) { return bank-chip.base + gpio_irq; } -static inline struct gpio_bank *_irq_data_get_bank(struct irq_data *d) +static inline struct gpio_bank *omap_irq_data_get_bank(struct irq_data *d) { struct gpio_chip *chip = irq_data_get_irq_chip_data(d); return container_of(chip, struct gpio_bank, chip); } -static void _set_gpio_direction(struct gpio_bank *bank, int gpio, int is_input) +static void omap_set_gpio_direction(struct gpio_bank *bank, int gpio, + int is_input) { void __iomem *reg = bank-base; u32 l; @@ -116,7 +117,8 @@ static void _set_gpio_direction(struct gpio_bank *bank, int gpio, int is_input) /* set data out value using dedicate set/clear register */ -static void _set_gpio_dataout_reg(struct gpio_bank *bank, int gpio, int enable) +static void omap_set_gpio_dataout_reg(struct gpio_bank *bank, int gpio, + int enable) { void __iomem *reg = bank-base; u32 l = GPIO_BIT(bank, gpio); @@ -133,7 +135,8 @@ static void _set_gpio_dataout_reg(struct gpio_bank *bank, int gpio, int enable) } /* set data out value using mask register */ -static void _set_gpio_dataout_mask(struct gpio_bank *bank, int gpio, int enable) +static void omap_set_gpio_dataout_mask(struct gpio_bank *bank, int gpio, + int enable) { void __iomem *reg = bank-base + bank-regs-dataout; u32 gpio_bit = GPIO_BIT(bank, gpio); @@ -148,21 +151,21 @@ static void _set_gpio_dataout_mask(struct gpio_bank *bank, int gpio, int enable) bank-context.dataout = l; } -static int _get_gpio_datain(struct gpio_bank *bank, int offset) +static int omap_get_gpio_datain(struct gpio_bank *bank, int offset) { void __iomem *reg = bank-base + bank-regs-datain; return (readl_relaxed(reg) (BIT(offset))) != 0; } -static int _get_gpio_dataout(struct gpio_bank *bank, int offset) +static int omap_get_gpio_dataout(struct gpio_bank *bank, int offset) { void __iomem *reg = bank-base + bank-regs-dataout; return (readl_relaxed(reg) (BIT(offset))) != 0; } -static inline void _gpio_rmw(void __iomem *base, u32 reg, u32 mask, bool set) +static inline void omap_gpio_rmw(void __iomem *base, u32 reg, u32 mask, bool set) { int l = readl_relaxed(base + reg); @@ -174,7 +177,7 @@ static inline void _gpio_rmw(void __iomem *base, u32 reg, u32 mask, bool set) writel_relaxed(l, base + reg); } -static inline void _gpio_dbck_enable(struct gpio_bank *bank) +static inline void omap_gpio_dbck_enable(struct gpio_bank *bank) { if (bank-dbck_enable_mask !bank-dbck_enabled) { clk_prepare_enable(bank-dbck); @@ -185,7 +188,7 @@ static inline void _gpio_dbck_enable(struct gpio_bank *bank) } } -static inline void _gpio_dbck_disable(struct gpio_bank *bank) +static inline void omap_gpio_dbck_disable(struct gpio_bank *bank) { if (bank-dbck_enable_mask bank-dbck_enabled) { /* @@ -201,7 +204,7 @@ static inline void _gpio_dbck_disable(struct gpio_bank *bank) } /** - * _set_gpio_debounce - low level gpio debounce time + * omap2_set_gpio_debounce - low level gpio debounce time * @bank: the gpio bank we're acting upon * @gpio: the gpio number on this @gpio * @debounce: debounce time to use @@ -209,8 +212,8 @@ static inline void _gpio_dbck_disable(struct gpio_bank *bank) * OMAP's debounce time is in 31us steps so we need * to convert and round up to the closest unit. */ -static void _set_gpio_debounce(struct gpio_bank *bank, unsigned gpio, - unsigned debounce) +static void omap2_set_gpio_debounce(struct gpio_bank *bank, unsigned gpio, + unsigned debounce) { void __iomem*reg; u32 val; @@ -251,7 +254,7 @@ static void _set_gpio_debounce(struct gpio_bank *bank, unsigned gpio, * used within _gpio_dbck_enable() is still not initialized at * that point.
RE: [PATCH v1 1/3] ARM: dts: am335x-bone: add support for beaglebone NAND cape
From: Guido Martínez [mailto:gu...@vanguardiasur.com.ar] On Tue, Jun 24, 2014 at 05:54:24PM +0530, Pekon Gupta wrote: [...] +gpmc { +ranges = 0 0 0 0x0100;/* address range = 16MB (minimum GPMC partition) */ +nand@0,0 { +status = disabled; +reg = 0 0 4; /* device IO registers */ +pinctrl-names = default; +pinctrl-0 = bbcape_nand_flash_pins; This doesn't seem to work as pinctrl properties are not parsed for childs of the gpmc node. Did this work for you? Putting this in the gpmc node makes it work, but how will we control pins for the nand and nor independently? I believe there is currently no support for muxing individual gpmc devices. If we want to add both devices to the DT and enable them as needed we'd need to add support for this, right? Yes, And that should be the case, because different devices would be connected to different chip-selects, so there should be support of providing individual pin-mux for different GPMC devices. Currently both NAND and NOR cape share GPMC_CS0, so both NAND and NOR capes will not work simultaneously. But I'm planning to modify NOR cape hardware at my end to use GPMC_CS1 instead of GPMC_CS0. - NAND on GPMC_CS0 - NOR on GPMC_CS1 In addition to pin-mux you may also require following patch: http://www.spinics.net/lists/linux-omap/msg107950.html Also, I should have marked this series as RFC as its not fully tested. My main intention was to get acknowledgement about cape DTS from various users and Tony Lindgren t...@atomide.com. Now as Tony has given some acceptance for these kind of cape DTS, I'll clean-up and re-send these patches with better testing and GPMC fixes. with regards, pekon with regards, pekon -- 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/RESEND 0/9] drm: tilcdc driver fixes
Guido, On 06/17/2014 09:17 AM, Guido Martínez wrote: The tilcdc driver could be compiled as a module, but was severely broken and could not be used as such. This patchset attempts to fix the issues preventing a proper load/unload of the module. Issues included dangling sysfs nodes, dangling devices, memory leaks and a double kfree. It now seems to be working ok. We have tested this by loading and unloading the driver repeteadly, with both panel and slave connectors and found no flaws. There is still one warning left on tilcdc_crtc_destroy, caused by destroying the connector while still in an ON status. We don't know why this happens or why it's an issue, so we did not fix it. Yes I see what you mean, it triggers the WARN_ON in tilcdc_crtc_destroy because DRM_MODE_DPMS_ON is still set. This WARN_ON does make some sense because DPMS_OFF would have the effect of turning off clocks and putting the monitor to sleep which seems logical considering we have torn down the display. Adding a tilcdc_crtc_dpms(DPMS_OFF) right before the WARN_ON confirms this, but it seems strange that this hasn't happened automatically (+ Russell doesn't need to do it in his Armada driver) - so I suspect there is a better way. Otherwise I think this is a good and useful patch series. Darren The first 7 patches are bug fixes which and should probably be applied in the stable trees. The last two are clean-ups. Resending this since I got no replies. Guido Martínez (9): drm/i2c: tda998x: move drm_i2c_encoder_destroy call drm/tilcdc: panel: fix dangling sysfs connector node drm/tilcdc: slave: fix dangling sysfs connector node drm/tilcdc: tfp410: fix dangling sysfs connector node drm/tilcdc: panel: fix leak when unloading the module drm/tilcdc: fix release order on exit drm/tilcdc: fix double kfree drm/tilcdc: remove submodule destroy calls drm/tilcdc: replace late_initcall with module_init drivers/gpu/drm/i2c/tda998x_drv.c | 2 +- drivers/gpu/drm/tilcdc/Module.symvers | 0 drivers/gpu/drm/tilcdc/tilcdc_drv.c| 15 + drivers/gpu/drm/tilcdc/tilcdc_drv.h| 1 - drivers/gpu/drm/tilcdc/tilcdc_panel.c | 39 +- drivers/gpu/drm/tilcdc/tilcdc_slave.c | 27 +-- drivers/gpu/drm/tilcdc/tilcdc_tfp410.c | 35 +++--- 7 files changed, 59 insertions(+), 60 deletions(-) create mode 100644 drivers/gpu/drm/tilcdc/Module.symvers -- 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