Re: [PATCH 1/2] vgaarb: Select a default VGA device even if there's no legacy VGA

2017-10-12 Thread Lothar Waßmann
aarb_info(dev, "no bridge control possible\n");
> > }
> >   
> > +   if (!vga_default_device()) {
> > +   list_for_each_entry(vgadev, &vga_list, list) {
> > +   struct device *dev = &vgadev->pdev->dev;
> > +   u16 cmd;
> > +
> > +   pdev = vgadev->pdev;
> > +   pci_read_config_word(pdev, PCI_COMMAND, &cmd);
> > +   if (cmd & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) {
> > +   vgaarb_info(dev, "setting as boot device (VGA 
> > legacy resources not available)\n");
> > +   vga_set_default_device(pdev);
> > +   break;
> > +   }
> > +   }
> > +   }
> > +
> > +   if (!vga_default_device()) {
> > +   vgadev = list_first_entry_or_null(&vga_list,
> > + struct vga_device, list);
> > +   if (vgadev) {
> > +   struct device *dev = &vgadev->pdev->dev;
> > +   vgaarb_info(dev, "setting as boot device (VGA legacy 
> > resources not available)\n");
> > +   vga_set_default_device(pdev);
> 
> Isn't 'pdev' NULL here? shouldn't it be vgadev->pdev instead?
> 
That cannot not happen, though it isn't quite obvious.
'vgadev' will only be non-NULL, when the vga_list isn't empty and in
that case pdev has been set up in the list_for_each_entry() loop above.


Lothar Waßmann


Re: [PATCH 00/44] usb: don't print on ENOMEM

2016-08-25 Thread Lothar Waßmann
Hi,

On Thu, 25 Aug 2016 19:38:52 +0200 Wolfram Sang wrote:
> Here is my next series to save memory by removing unneeded strings. It removes
> in the usb subsystem all unspecific error messages after calling malloc-based
> functions, i.e. (devm_)k[zcm]alloc. kmalloc prints enough information in that
> case. If the message was specific (e.g. "can't save CLEAR_TT_BUFFER state"), I
> left it. This series saves ~4.5KB of "out of memory" permutations in .text and
> .rodata. For modified lines, (x == NULL) was replaced with (!NULL) as well.
s/!NULL/!x/


Lothar Waßmann


Re: [alsa-devel] [PATCH 2/2] ASoC: fsl: select SND_SOC_FSL_SAI or SND_SOC_FSL_SSI depending on SoC type

2016-01-13 Thread Lothar Waßmann
Hi,

> On Tue, Jan 12, 2016 at 4:13 PM, Lothar Waßmann  
> wrote:
> 
> > diff --git a/sound/soc/fsl/Kconfig b/sound/soc/fsl/Kconfig
> > index 14dfdee..c128823 100644
> > --- a/sound/soc/fsl/Kconfig
> > +++ b/sound/soc/fsl/Kconfig
> > @@ -258,7 +258,8 @@ config SND_SOC_IMX_SGTL5000
> > select SND_SOC_SGTL5000
> > select SND_SOC_IMX_PCM_DMA
> > select SND_SOC_IMX_AUDMUX
> > -   select SND_SOC_FSL_SSI
> > +   select SND_SOC_FSL_SAI if SOC_IMX6UL
> > +   select SND_SOC_FSL_SSI if SOC_IMX6Q || SOC_IMX6SL || SOC_IMX6SX
> 
> MX6SX has SSI and SAI interfaces.
>
I chose the settings, so that the default behaviour before this patch is
not changed. The other interface can still be enabled by the user.
[Yes, I know this is a case of the frowned-upon use of 'select' with
user-visible symbols, but this is as things currently are]


Lothar Waßmann
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 2/2] ASoC: fsl: select SND_SOC_FSL_SAI or SND_SOC_FSL_SSI depending on SoC type

2016-01-13 Thread Lothar Waßmann
Hi,

> Lothar Waßmann wrote:
> > -   select SND_SOC_FSL_SSI
> > +   select SND_SOC_FSL_SAI if SOC_IMX6UL
> > +   select SND_SOC_FSL_SSI if SOC_IMX6Q || SOC_IMX6SL || SOC_IMX6SX
> 
> I don't think this is compatible with a multiarch kernel.
>
Why? If more than one of the IMX6 SoCs are selected, both interfaces
may be selected at the same time without any harm.


Lothar Waßmann
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 1/2] ASoC: fsl: imx-sgtl5000: make audmux optional for imx sound driver

2016-01-13 Thread Lothar Waßmann
Hi,

> On Tue, Jan 12, 2016 at 07:13:30PM +0100, Lothar Waßmann wrote:
> 
> > i.MX6UL does not have the audio multiplexer (AUDMUX) like e.g. i.MX6Q,
> > but apart from that can use the same audio driver. Make audmux
> > optional for the imx-sgtl5000 driver, so it can be used on i.MX6UL
> > too. Also i.MX6UL requires use of the SAI interface rather than SSI.
> 
> If it doesn't have the audmux can you use simple-card?
>
I'll have a look at it. Thanks for the hint.


Lothar Waßmann
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 1/2] ASoC: fsl: imx-sgtl5000: make audmux optional for imx sound driver

2016-01-12 Thread Lothar Waßmann
i.MX6UL does not have the audio multiplexer (AUDMUX) like e.g. i.MX6Q,
but apart from that can use the same audio driver. Make audmux
optional for the imx-sgtl5000 driver, so it can be used on i.MX6UL
too. Also i.MX6UL requires use of the SAI interface rather than SSI.

Signed-off-by: Lothar Waßmann 
---
 sound/soc/fsl/imx-sgtl5000.c | 70 +++-
 1 file changed, 36 insertions(+), 34 deletions(-)

diff --git a/sound/soc/fsl/imx-sgtl5000.c b/sound/soc/fsl/imx-sgtl5000.c
index b99e0b5..7cefb40 100644
--- a/sound/soc/fsl/imx-sgtl5000.c
+++ b/sound/soc/fsl/imx-sgtl5000.c
@@ -65,40 +65,42 @@ static int imx_sgtl5000_probe(struct platform_device *pdev)
int int_port, ext_port;
int ret;
 
-   ret = of_property_read_u32(np, "mux-int-port", &int_port);
-   if (ret) {
-   dev_err(&pdev->dev, "mux-int-port missing or invalid\n");
-   return ret;
-   }
-   ret = of_property_read_u32(np, "mux-ext-port", &ext_port);
-   if (ret) {
-   dev_err(&pdev->dev, "mux-ext-port missing or invalid\n");
-   return ret;
-   }
-
-   /*
-* The port numbering in the hardware manual starts at 1, while
-* the audmux API expects it starts at 0.
-*/
-   int_port--;
-   ext_port--;
-   ret = imx_audmux_v2_configure_port(int_port,
-   IMX_AUDMUX_V2_PTCR_SYN |
-   IMX_AUDMUX_V2_PTCR_TFSEL(ext_port) |
-   IMX_AUDMUX_V2_PTCR_TCSEL(ext_port) |
-   IMX_AUDMUX_V2_PTCR_TFSDIR |
-   IMX_AUDMUX_V2_PTCR_TCLKDIR,
-   IMX_AUDMUX_V2_PDCR_RXDSEL(ext_port));
-   if (ret) {
-   dev_err(&pdev->dev, "audmux internal port setup failed\n");
-   return ret;
-   }
-   ret = imx_audmux_v2_configure_port(ext_port,
-   IMX_AUDMUX_V2_PTCR_SYN,
-   IMX_AUDMUX_V2_PDCR_RXDSEL(int_port));
-   if (ret) {
-   dev_err(&pdev->dev, "audmux external port setup failed\n");
-   return ret;
+   if (!of_property_read_bool(np, "fsl,no-audmux")) {
+   ret = of_property_read_u32(np, "mux-int-port", &int_port);
+   if (ret) {
+   dev_err(&pdev->dev, "mux-int-port missing or 
invalid\n");
+   return ret;
+   }
+   ret = of_property_read_u32(np, "mux-ext-port", &ext_port);
+   if (ret) {
+   dev_err(&pdev->dev, "mux-ext-port missing or 
invalid\n");
+   return ret;
+   }
+
+   /*
+* The port numbering in the hardware manual starts at 1, while
+* the audmux API expects it starts at 0.
+*/
+   int_port--;
+   ext_port--;
+   ret = imx_audmux_v2_configure_port(int_port,
+   IMX_AUDMUX_V2_PTCR_SYN |
+   IMX_AUDMUX_V2_PTCR_TFSEL(ext_port) |
+   IMX_AUDMUX_V2_PTCR_TCSEL(ext_port) |
+   IMX_AUDMUX_V2_PTCR_TFSDIR |
+   IMX_AUDMUX_V2_PTCR_TCLKDIR,
+   IMX_AUDMUX_V2_PDCR_RXDSEL(ext_port));
+   if (ret) {
+   dev_err(&pdev->dev, "audmux internal port setup 
failed\n");
+   return ret;
+   }
+   ret = imx_audmux_v2_configure_port(ext_port,
+   IMX_AUDMUX_V2_PTCR_SYN,
+   IMX_AUDMUX_V2_PDCR_RXDSEL(int_port));
+   if (ret) {
+   dev_err(&pdev->dev, "audmux external port setup 
failed\n");
+   return ret;
+   }
}
 
ssi_np = of_parse_phandle(pdev->dev.of_node, "ssi-controller", 0);
-- 
2.1.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 2/2] ASoC: fsl: select SND_SOC_FSL_SAI or SND_SOC_FSL_SSI depending on SoC type

2016-01-12 Thread Lothar Waßmann
i.MX6UL does not provide an SSI interface like the other i.MX6 SoCs,
but only an SAI interface.
Select the appropriate interface(s) depending on the enabled SoC types.

Signed-off-by: Lothar Waßmann 
---
 sound/soc/fsl/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/soc/fsl/Kconfig b/sound/soc/fsl/Kconfig
index 14dfdee..c128823 100644
--- a/sound/soc/fsl/Kconfig
+++ b/sound/soc/fsl/Kconfig
@@ -258,7 +258,8 @@ config SND_SOC_IMX_SGTL5000
select SND_SOC_SGTL5000
select SND_SOC_IMX_PCM_DMA
select SND_SOC_IMX_AUDMUX
-   select SND_SOC_FSL_SSI
+   select SND_SOC_FSL_SAI if SOC_IMX6UL
+   select SND_SOC_FSL_SSI if SOC_IMX6Q || SOC_IMX6SL || SOC_IMX6SX
help
  Say Y if you want to add support for SoC audio on an i.MX board with
  a sgtl5000 codec.
-- 
2.1.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 0/2] ASoC: fsl: make snd-soc-imx-sgtl5000 driver useable on i.MX6UL

2016-01-12 Thread Lothar Waßmann
This patchset adds support for the i.MX6UL SoC to the imx-sgtl5000
sound driver.
The first patch makes the audmux setup optional for the driver, since
i.MX6UL does not have this unit.
The second patch selects the SAI interface rather than the SSI
interface for the i.MX6UL SoC.

A patch to make the corresponding DTB changes has been sent
separately.

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 2/2] clk: imx: add kpp clock for i.MX6UL

2016-01-12 Thread Lothar Waßmann
Add the necessary clock to use the KPP interface on i.MX6UL.

Signed-off-by: Lothar Waßmann 
---
 drivers/clk/imx/clk-imx6ul.c | 1 +
 include/dt-bindings/clock/imx6ul-clock.h | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/imx/clk-imx6ul.c b/drivers/clk/imx/clk-imx6ul.c
index 3e31ec0..1ee28d3 100644
--- a/drivers/clk/imx/clk-imx6ul.c
+++ b/drivers/clk/imx/clk-imx6ul.c
@@ -365,6 +365,7 @@ static void __init imx6ul_clocks_init(struct device_node 
*ccm_node)
/* CCGR5 */
clks[IMX6UL_CLK_ROM]= imx_clk_gate2("rom",  "ahb",  
base + 0x7c,0);
clks[IMX6UL_CLK_SDMA]   = imx_clk_gate2("sdma", "ahb",  
base + 0x7c,6);
+   clks[IMX6UL_CLK_KPP]= imx_clk_gate2("kpp",  "ipg",  
base + 0x7c,8);
clks[IMX6UL_CLK_WDOG2]  = imx_clk_gate2("wdog2","ipg",  
base + 0x7c,10);
clks[IMX6UL_CLK_SPBA]   = imx_clk_gate2("spba", "ipg",  
base + 0x7c,12);
clks[IMX6UL_CLK_SPDIF]  = imx_clk_gate2_shared("spdif", 
"spdif_podf",   base + 0x7c,14, &share_count_audio);
diff --git a/include/dt-bindings/clock/imx6ul-clock.h 
b/include/dt-bindings/clock/imx6ul-clock.h
index 08ce4a7..fd8aee8 100644
--- a/include/dt-bindings/clock/imx6ul-clock.h
+++ b/include/dt-bindings/clock/imx6ul-clock.h
@@ -234,7 +234,8 @@
 #define IMX6UL_CLK_CSI_SEL 221
 #define IMX6UL_CLK_CSI_PODF222
 #define IMX6UL_CLK_PLL3_120M   223
+#define IMX6UL_CLK_KPP 224
 
-#define IMX6UL_CLK_END 224
+#define IMX6UL_CLK_END 225
 
 #endif /* __DT_BINDINGS_CLOCK_IMX6UL_H */
-- 
2.1.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 1/2] clk: imx: whitespace cleanup; no functional change

2016-01-12 Thread Lothar Waßmann
remove whitespace before TAB.

Signed-off-by: Lothar Waßmann 
---
 drivers/clk/imx/clk-imx6ul.c |  62 ++---
 include/dt-bindings/clock/imx6ul-clock.h | 146 +++
 2 files changed, 104 insertions(+), 104 deletions(-)

diff --git a/drivers/clk/imx/clk-imx6ul.c b/drivers/clk/imx/clk-imx6ul.c
index 08692d7..3e31ec0 100644
--- a/drivers/clk/imx/clk-imx6ul.c
+++ b/drivers/clk/imx/clk-imx6ul.c
@@ -157,9 +157,9 @@ static void __init imx6ul_clocks_init(struct device_node 
*ccm_node)
clk_set_parent(clks[IMX6UL_PLL7_BYPASS], clks[IMX6UL_CLK_PLL7]);
 
clks[IMX6UL_CLK_PLL1_SYS]   = imx_clk_fixed_factor("pll1_sys",  
"pll1_bypass", 1, 1);
-   clks[IMX6UL_CLK_PLL2_BUS]   = imx_clk_gate("pll2_bus",  
"pll2_bypass", base + 0x30, 13);
-   clks[IMX6UL_CLK_PLL3_USB_OTG]   = imx_clk_gate("pll3_usb_otg",  
"pll3_bypass", base + 0x10, 13);
-   clks[IMX6UL_CLK_PLL4_AUDIO] = imx_clk_gate("pll4_audio",
"pll4_bypass", base + 0x70, 13);
+   clks[IMX6UL_CLK_PLL2_BUS]   = imx_clk_gate("pll2_bus",  
"pll2_bypass", base + 0x30, 13);
+   clks[IMX6UL_CLK_PLL3_USB_OTG]   = imx_clk_gate("pll3_usb_otg",  
"pll3_bypass", base + 0x10, 13);
+   clks[IMX6UL_CLK_PLL4_AUDIO] = imx_clk_gate("pll4_audio",
"pll4_bypass", base + 0x70, 13);
clks[IMX6UL_CLK_PLL5_VIDEO] = imx_clk_gate("pll5_video",
"pll5_bypass", base + 0xa0, 13);
clks[IMX6UL_CLK_PLL6_ENET]  = imx_clk_gate("pll6_enet", 
"pll6_bypass", base + 0xe0, 13);
clks[IMX6UL_CLK_PLL7_USB_HOST]  = imx_clk_gate("pll7_usb_host", 
"pll7_bypass", base + 0x20, 13);
@@ -196,8 +196,8 @@ static void __init imx6ul_clocks_init(struct device_node 
*ccm_node)
base + 0xe0, 2, 2, 0, clk_enet_ref_table, 
&imx_ccm_lock);
 
clks[IMX6UL_CLK_ENET2_REF_125M] = imx_clk_gate("enet_ref_125m", 
"enet2_ref", base + 0xe0, 20);
-   clks[IMX6UL_CLK_ENET_PTP_REF]   = imx_clk_fixed_factor("enet_ptp_ref", 
"pll6_enet", 1, 20);
-   clks[IMX6UL_CLK_ENET_PTP]   = imx_clk_gate("enet_ptp", 
"enet_ptp_ref", base + 0xe0, 21);
+   clks[IMX6UL_CLK_ENET_PTP_REF]   = imx_clk_fixed_factor("enet_ptp_ref", 
"pll6_enet", 1, 20);
+   clks[IMX6UL_CLK_ENET_PTP]   = imx_clk_gate("enet_ptp", 
"enet_ptp_ref", base + 0xe0, 21);
 
clks[IMX6UL_CLK_PLL4_POST_DIV]  = clk_register_divider_table(NULL, 
"pll4_post_div", "pll4_audio",
 CLK_SET_RATE_PARENT | CLK_SET_RATE_GATE, base + 0x70, 19, 2, 
0, post_div_table, &imx_ccm_lock);
@@ -210,8 +210,8 @@ static void __init imx6ul_clocks_init(struct device_node 
*ccm_node)
 
/* name 
parent_name  mult  div */
clks[IMX6UL_CLK_PLL2_198M] = imx_clk_fixed_factor("pll2_198m", 
"pll2_pfd2_396m", 1, 2);
-   clks[IMX6UL_CLK_PLL3_80M]  = imx_clk_fixed_factor("pll3_80m",  
"pll3_usb_otg",   1, 6);
-   clks[IMX6UL_CLK_PLL3_60M]  = imx_clk_fixed_factor("pll3_60m",  
"pll3_usb_otg",   1, 8);
+   clks[IMX6UL_CLK_PLL3_80M]  = imx_clk_fixed_factor("pll3_80m",  
"pll3_usb_otg",   1, 6);
+   clks[IMX6UL_CLK_PLL3_60M]  = imx_clk_fixed_factor("pll3_60m",  
"pll3_usb_otg",   1, 8);
clks[IMX6UL_CLK_GPT_3M]= imx_clk_fixed_factor("gpt_3m", "osc",  
 1, 8);
 
np = ccm_node;
@@ -219,34 +219,34 @@ static void __init imx6ul_clocks_init(struct device_node 
*ccm_node)
WARN_ON(!base);
 
clks[IMX6UL_CA7_SECONDARY_SEL]= imx_clk_mux("ca7_secondary_sel", 
base + 0xc, 3, 1, ca7_secondary_sels, ARRAY_SIZE(ca7_secondary_sels));
-   clks[IMX6UL_CLK_STEP] = imx_clk_mux("step", base + 0x0c, 8, 
1, step_sels, ARRAY_SIZE(step_sels));
-   clks[IMX6UL_CLK_PLL1_SW]  = imx_clk_mux_flags("pll1_sw",   base 
+ 0x0c, 2,  1, pll1_sw_sels, ARRAY_SIZE(pll1_sw_sels), 0);
+   clks[IMX6UL_CLK_STEP] = imx_clk_mux("step", base + 0x0c, 8, 
1, step_sels, ARRAY_SIZE(step_sels));
+   clks[IMX6UL_CLK_PLL1_SW]  = imx_clk_mux_flags("pll1_sw",   base 
+ 0x0c, 2,  1, pll1_sw_sels, ARRAY_SIZE(pll1_sw_sels), 0);
clks[IMX6UL_CLK_AXI_ALT_SEL]  = imx_clk_mux("axi_alt_sel",  
base + 0x14, 7,  1, axi_alt_sels, ARRAY_SIZE(axi_alt_sels));
-   clks[IMX6UL_CLK_AXI_SEL]  = imx_clk_mux_flags("axi_sel",
base + 0x14, 6,  1, axi_sels, ARRAY_SIZE(axi_sels), 0);
-   clks[IMX6UL_C

[PATCH 0/2] clk: imx6: add kpp clock for i.MX6UL

2016-01-12 Thread Lothar Waßmann
This patchset adds the clock which is necessary to operate the KPP
unit on i.MX6UL.
The first patch removes bogus whitespace before TABs in indentation.
The second patch adds the clock definition.

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCHv1 5/8] ASoC: sgtl5000: Revise the bugs about the sgt15000 codec.

2013-10-21 Thread Lothar Waßmann
Hi,

> > > diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
> > > index 1f4093f..4e2e4c9 100644
> > > --- a/sound/soc/codecs/sgtl5000.c
> > > +++ b/sound/soc/codecs/sgtl5000.c
> > > @@ -883,14 +883,19 @@ static int ldo_regulator_register(struct
> > snd_soc_codec *codec,
> > >   struct regulator_init_data *init_data,
> > >   int voltage)
> > >  {
> > > +#ifdef CONFIG_SND_SOC_FSL_SGTL5000
> > > + return 0;
> > > +#else
> > >   dev_err(codec->dev, "this setup needs regulator support in the
> > kernel\n");
> > >   return -EINVAL;
> > > +#endif
> > >
> > This looks wrong to me, as this will disable the error for unsolicited
> > platforms in a multi arch kernel!
> > 
> 
> The CONFIG_SND_SOC_FSL_SGTL5000 micro will be renamed to 
> CONFIG_SND_SOC_FSL_SGTL5000_VF610.
> In VF610, there has not Power Manager Module, so whether the CONFIG_REGULATOR 
> is enable or 
> Disabled, there will always some errors booting...
> 
Yes, but you are altering code that may be run on a different machine
than VF610 in a multiarch kernel! You should have a RUNTIME check for
the machine type if you need to do machine type specific stuff.


Lothar Waßmann
-- 
___

Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Geschäftsführer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | i...@karo-electronics.de
___
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCHv1 0/8] ALSA: Add SAI driver and enable SGT15000 codec.

2013-10-17 Thread Lothar Waßmann
Hi,

Xiubo Li  wrote:

The subject has a wrong name for the codec "SGT1..." instead of
"SGTL...", which will make it difficult to search for this thread in
mail archives or in commit messages once this patches should be applied!


Lothar Waßmann
-- 
___

Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Geschäftsführer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | i...@karo-electronics.de
___
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCHv1 5/8] ASoC: sgtl5000: Revise the bugs about the sgt15000 codec.

2013-10-17 Thread Lothar Waßmann
Hi,

Xiubo Li  wrote:
> When the CONFIG_REGULATOR is disabled there will be some warnings
> printed out.
> 
> Signed-off-by: Xiubo Li 
> ---
>  sound/soc/codecs/sgtl5000.c | 13 -
>  1 file changed, 12 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
> index 1f4093f..4e2e4c9 100644
> --- a/sound/soc/codecs/sgtl5000.c
> +++ b/sound/soc/codecs/sgtl5000.c
> @@ -883,14 +883,19 @@ static int ldo_regulator_register(struct snd_soc_codec 
> *codec,
>   struct regulator_init_data *init_data,
>   int voltage)
>  {
> +#ifdef CONFIG_SND_SOC_FSL_SGTL5000
> + return 0;
> +#else
>   dev_err(codec->dev, "this setup needs regulator support in the 
> kernel\n");
>   return -EINVAL;
> +#endif
>
This looks wrong to me, as this will disable the error for unsolicited
platforms in a multi arch kernel!

>  static int ldo_regulator_remove(struct snd_soc_codec *codec)
>  {
>   return 0;
>  }
> +
>  #endif
>  
Why do you add an extra empty line here?


Lothar Waßmann
-- 
___

Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Geschäftsführer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | i...@karo-electronics.de
___
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCHv1 1/8] ALSA: Add SAI SoC Digital Audio Interface driver.

2013-10-17 Thread Lothar Waßmann
Hi,

Xiubo Li  wrote:
[...]
> diff --git a/sound/soc/fsl/fsl-pcm-dma.c b/sound/soc/fsl/fsl-pcm-dma.c
> new file mode 100644
> index 000..c4d925e
> --- /dev/null
> +++ b/sound/soc/fsl/fsl-pcm-dma.c
> @@ -0,0 +1,51 @@
[...]
> +
> +static int fsl_sai_probe(struct platform_device *pdev)
> +{
> + struct of_phandle_args  dma_args;
> + int index;
> + struct resource *res;
> + struct fsl_sai *sai;
> + int ret = 0;
> + struct device_node *np = pdev->dev.of_node;
> +
> + sai = devm_kzalloc(&pdev->dev, sizeof(*sai), GFP_KERNEL);
> + if (!sai)
> + return -ENOMEM;
> +
> + sai->fbt = FSL_SAI_FBT_MSB;
> +
> + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> + sai->base = devm_ioremap_resource(&pdev->dev, res);
> + if (IS_ERR(sai->base)) {
> + ret = PTR_ERR(sai->base);
> + return ret;
>
could be:
return PTR_ERR(sai->base);

[...]
> +static const struct of_device_id fsl_sai_ids[] = {
> + { .compatible = "fsl,vf610-sai", },
> + { /*sentinel*/ },
>
The comma after the last entry in a struct initializer is there to make
patches that append another entry cleaner. Since this entry is and
always must be the last entry, the comma is useless here.

> diff --git a/sound/soc/fsl/fsl-sai.h b/sound/soc/fsl/fsl-sai.h
> new file mode 100644
> index 000..ab76a8e
> --- /dev/null
> +++ b/sound/soc/fsl/fsl-sai.h
> @@ -0,0 +1,127 @@
> +/*
> + * Copyright 2012-2013 Freescale Semiconductor, Inc.
> + *
> + * 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.
> + */
> +
> +#ifndef __FSL_SAI_H
> +#define __FSL_SAI_H
> +
> +#include 
> +
> +#define FSL_SAI_FORMATS (SNDRV_PCM_FMTBIT_S16_LE |\
> +  SNDRV_PCM_FMTBIT_S20_3LE |\
> +  SNDRV_PCM_FMTBIT_S24_LE)
> +
> +#define FSL_SAI_DMABUF_SIZE  (32 * 1024)
> +#define TCD_NUMBER   4
> +#define EDMA_PRIO_HIGH  6
> +
strange indentation with mixed spaces and tabs.

> +/* SAI Transmit and Recieve Configuration 2 Register */
> +#define SAI_TCR2 0x08
> +#define SAI_RCR2 0x88
> +#define SAI_CR2_SYNC BIT(30)
> +#define SAI_CR2_MSEL_MASK(0xff << 26)
> +#define SAI_CR2_MSEL_BUS 0
> +#define SAI_CR2_MSEL_MCLK1   BIT(26)
> +#define SAI_CR2_MSEL_MCLK2   BIT(27)
> +#define SAI_CR2_MSEL_MCLK3   (BIT(26)|BIT(27))
>
spaces around '|'?


Lothar Waßmann
-- 
___

Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Geschäftsführer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | i...@karo-electronics.de
___
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v6 1/3] usb: fsl-mxc-udc: replace cpu_is_xxx() with platform_device_id

2013-01-17 Thread Lothar Waßmann
Hi,

Fabio Estevam writes:
> On Thu, Jan 17, 2013 at 8:01 AM, Peter Chen  wrote:
> 
> > /* make sure USB_CLK is running at 60 MHz +/- 1000 Hz */
> > -   if (!cpu_is_mx51()) {
> > +   if (!strcmp(pdev->id_entry->name, "imx-udc-mx27")) {]]
> 
> Shouldn't this be:
>  if (!strcmp(pdev->id_entry->name, "imx-udc-mx51"))
>
The equivalent of !cpu_is_mx51() would be
strcmp(pdev->id_entry->name, "imx-udc-mx51") (without the '!') meaning
id_entry->name is different from "imx-udc-mx51".

I personally hate the '!strcmp()' notation and prefer 'strcmp() == 0'
though they are technically equivalent. Using '==' makes it much
clearer to the reader what is intended.
!strcmp() lets one assume that it is true when the comparison fails,
though actually the opposite is true.


Lothar Waßmann
-- 
___

Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Geschäftsführer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | i...@karo-electronics.de
___
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev