Age | Commit message (Collapse) | Author |
|
Fixes: '3f76b6ebb8c tegra: dc: events.c: fix error about packed' if
GCC < 9.0.1 is used.
| events.c:195:32: error: unknown option after '#pragma GCC diagnostic' kind [-Werror=pragmas]
| #pragma GCC diagnostic warning "-Waddress-of-packed-member"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
|
|
With GCC 9.2.0 we get the following error twice:
| events.c:194:36: error: taking address of packed member of 'struct <anonymous>'
| may result in an unaligned pointer value [-Werror=address-of-packed-member]
| tegra_dc_ext_queue_event(control, &pack.event);
| ^~~~~~~~~~~
Demote error to warning.
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
|
|
[ Upstream commit a6e60d84989fa0e91db7f236eda40453b0e44afa ]
The upcoming GCC 9 release extends the -Wmissing-attributes warnings
(enabled by -Wall) to C and aliases: it warns when particular function
attributes are missing in the aliases but not in their target.
In particular, it triggers for all the init/cleanup_module
aliases in the kernel (defined by the module_init/exit macros),
ending up being very noisy.
These aliases point to the __init/__exit functions of a module,
which are defined as __cold (among other attributes). However,
the aliases themselves do not have the __cold attribute.
Since the compiler behaves differently when compiling a __cold
function as well as when compiling paths leading to calls
to __cold functions, the warning is trying to point out
the possibly-forgotten attribute in the alias.
In order to keep the warning enabled, we decided to silence
this case. Ideally, we would mark the aliases directly
as __init/__exit. However, there are currently around 132 modules
in the kernel which are missing __init/__exit in their init/cleanup
functions (either because they are missing, or for other reasons,
e.g. the functions being called from somewhere else); and
a section mismatch is a hard error.
A conservative alternative was to mark the aliases as __cold only.
However, since we would like to eventually enforce __init/__exit
to be always marked, we chose to use the new __copy function
attribute (introduced by GCC 9 as well to deal with this).
With it, we copy the attributes used by the target functions
into the aliases. This way, functions that were not marked
as __init/__exit won't have their aliases marked either,
and therefore there won't be a section mismatch.
Note that the warning would go away marking either the extern
declaration, the definition, or both. However, we only mark
the definition of the alias, since we do not want callers
(which only see the declaration) to be compiled as if the function
was __cold (and therefore the paths leading to those calls
would be assumed to be unlikely).
Cc: <stable@vger.kernel.org> # 4.14+
Link: https://lore.kernel.org/lkml/20190123173707.GA16603@gmail.com/
Link: https://lore.kernel.org/lkml/20190206175627.GA20399@gmail.com/
Suggested-by: Martin Sebor <msebor@gcc.gnu.org>
Acked-by: Jessica Yu <jeyu@kernel.org>
Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Signed-off-by: Stefan Agner <stefan@agner.ch>
(cherry picked from commit dbc40d3d4afafbce1d64acedc28dfbeb4bf20695)
Conflicts:
include/linux/module.h Changed code has moved to a different file
|
|
[ Upstream commit c0d9782f5b6d7157635ae2fd782a4b27d55a6013
From the GCC manual:
copy
copy(function)
The copy attribute applies the set of attributes with which function
has been declared to the declaration of the function to which
the attribute is applied. The attribute is designed for libraries
that define aliases or function resolvers that are expected
to specify the same set of attributes as their targets. The copy
attribute can be used with functions, variables, or types. However,
the kind of symbol to which the attribute is applied (either
function or variable) must match the kind of symbol to which
the argument refers. The copy attribute copies only syntactic and
semantic attributes but not attributes that affect a symbol’s
linkage or visibility such as alias, visibility, or weak.
The deprecated attribute is also not copied.
https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html
The upcoming GCC 9 release extends the -Wmissing-attributes warnings
(enabled by -Wall) to C and aliases: it warns when particular function
attributes are missing in the aliases but not in their target, e.g.:
void __cold f(void) {}
void __alias("f") g(void);
diagnoses:
warning: 'g' specifies less restrictive attribute than
its target 'f': 'cold' [-Wmissing-attributes]
Using __copy(f) we can copy the __cold attribute from f to g:
void __cold f(void) {}
void __copy(f) __alias("f") g(void);
This attribute is most useful to deal with situations where an alias
is declared but we don't know the exact attributes the target has.
For instance, in the kernel, the widely used module_init/exit macros
define the init/cleanup_module aliases, but those cannot be marked
always as __init/__exit since some modules do not have their
functions marked as such.
Cc: <stable@vger.kernel.org> # 4.14+
Suggested-by: Martin Sebor <msebor@gcc.gnu.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Signed-off-by: Stefan Agner <stefan@agner.ch>
(cherry picked from commit c4fa716aa388078b44017d25ebc66fb661cef7c3)
Conflicts:
include/linux/compiler.h
|
|
According to the manual [1], SYS_MCLK should base on SYS_FS, not on sample rate.
Calculating SYS_MCLK using sample rate only prevents playing/recording
samples with rate < 16 kHz:
---------------------------------------------------------------
root@apalis-tk1:~# aplay test-8k-sample.wav
Playing WAVE 'test-8k-sample.wav' : Signed 16 bit
[...] tegra-snd-apalis-tk1-sgtl5000 tegra-snd-apalis-tk1-sgtl5000.0: ASoC: machine hw_params failed: -22
Little Endian, Rate 8000 Hz, Stereo
aplay: set_params:1403: Unable to install hw params:
...
---------------------------------------------------------------
Using the helper from sgtl5000.h fixes this issue.
To keep determination of sys_fs solid, use a helper in device driver.
[1] https://www.nxp.com/docs/en/data-sheet/SGTL5000.pdf
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
|
|
Calculate SYS_MCLK using sample rate or SYS_FS.
These helpers allow to simplify a code to set up external system clock
for different sample rates.
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
|
|
This makes able to switch ADC on automatically when recording
starts.
Commit 6b01f0b022a (Fix enabling ZCD for HP and ADC) fixes
initial setting of SGTL5000_CHIP_ANA_CTRL, keeping muted
HP, DAC and ADC blocks on probing device. HP and DAC mute issue
was fixed with 60f67ac489 (Add on/off control for HP/LINE out).
This commit fixes ADC mute issue in the same manner as HP/DAC.
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
|
|
All displays sold by Toradex have now a common typical frequency
for dimming backlight. This commit sets that frequency to 150Hz and
put some better brightness values.
Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
|
|
Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
|
|
Add handlers for HP/DAC/ADC power on/off event.
Mute outputs on power on/off of any chip block to
avoid pops.
Improve logic for VAG to power on/off to avoid muxing pops.
Fix DAPM widgets' definitions to use new handlers.
Related to: #48500
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
|
|
Define SND_SOC_DAPM_PRE_POST_PMU to reduce code.
Related to: #48500
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
|
|
- adding mute/unmute controls for headphone and lineout allows
alsa-compatible sound players automatically unmute output
port to play music.
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
|
|
- increase trailing delay after VAG power down to reduce trailing pop;
- mute HP/LINE output before VAG power up.
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
|
|
- set VDDD voltage ONLY if use internal ldo regulator;
- assign manually the source of charge pump ONLY if
automatic selection can't perform.
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
|
|
- change HP_ZCD_EN/ADC_ZCD_EN bits only in CHIP_ANA_CTRL register.
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
|
|
- define the SMALL_POP as a 1-bit mask, not value;
- properly set the SMALL_POP on device probing.
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
|
|
- ldo_regulator_remove() doesn't reset sgtl5000->ldo so it is
possible to dereference members of previously freed struct ldo.
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
|
|
- Name headphone mux related data objects correctly.
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
|
|
- the code to fallback to internal ldo regulator instead of external
vddd is completely wrong. According to TDM and Errata of sgtl5000
chips revision < 0x11 strongly need to use external vddd due to ER1.
For chips revision >= 0x11 there is no limitation to use either
external vddd or internal ldo regulator.
- fix logical error in cleanup sequence.
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
|
|
commit c251ea7bd7a04f1f2575467e0de76e803cf59149 upstream
On a mx28evk with a sgtl5000 codec we notice a loud 'click' sound to happen
5 seconds after the end of a playback.
The SMALL_POP bit should fix this, but its definition is incorrect:
according to the sgtl5000 manual it is bit 0 of CHIP_REF_CTRL register, not
bit 1.
Fix the definition accordingly and enable the bit as intended per the code
comment.
After applying this change, no loud 'click' sound is heard after playback
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
|
|
commit f091f3f07328f75d20a2a5970d1f8b58d95fc990 upstream
When a sound capture/playback is terminated while a playback/capture
is running, power_vag_event() will clear SGTL5000_CHIP_ANA_POWER in
the SND_SOC_DAPM_PRE_PMD event, thus muting the respective other
channel.
Don't clear SGTL5000_CHIP_ANA_POWER when both DAC and ADC are active
to prevent this.
Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Reviewed-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
|
|
commit dd4d2d6dfb49e8916064f2cb07f0ad7b32a82fb7 upstream
The VAG_POWER must be enabled after all other bits in CHIP_ANA_POWER
and disabled before any other bit in CHIP_ANA_POWER. See the SGTL5000
datasheet (Table 31, BIT 7, page 42-43). Failing to follow this order
will result in ugly loud "POP" noise at the end of playback.
To achieve such order, use the _PRE and _POST DAPM widgets to trigger
the power_vag_event, where the event type check has to be fixed
accordingly as well.
Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
|
|
(cherry picked from commit 0a8984655b5239833a3e6e0d54c7c867dbc7ea63)
This fixes the dual camera use case.
Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
|
|
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
Related to: #40373
|
|
Fix a type of flag of disabling HS200 mode on tegra sdhci.
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
|
|
Set vddio_sdmmc, vqmmc, vmmc regulators for eMMC.
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
Related to: #40373
|
|
Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com>
|
|
If the OTG port is configured for USB 3.0 operation
using usb_port_owner_info kernel cmd line argument
operate in host mode only.
Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com>
|
|
Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com>
|
|
Prioritize CAN TX trafic, and move from edge to level triggered
interrupts.
Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com>
|
|
Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com>
|
|
Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com>
Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
|
|
Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com>
Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
|
|
Previously fw was not released when K20 was flashed successfully
Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com>
Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
|
|
Signed-off-by: Rolf Eike Beer <eb@emlix.com>
Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
|
|
Signed-off-by: Rolf Eike Beer <eb@emlix.com>
Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
|
|
Signed-off-by: Rolf Eike Beer <eb@emlix.com>
Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
|
|
Signed-off-by: Rolf Eike Beer <eb@emlix.com>
Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
|
|
Signed-off-by: Rolf Eike Beer <eb@emlix.com>
Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
|
|
Causes build failures with gcc 8.
Signed-off-by: Rolf Eike Beer <eb@emlix.com>
Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
|
|
u
This fixes breakage to iproute2 build with recent kernel headers
caused by:
commit a263653ed798216c0069922d7b5237ca49436007
Author: Pablo Neira Ayuso <pablo@netfilter.org>
Date: Wed Jun 17 10:28:27 2015 -0500
netfilter: don't pull include/linux/netfilter.h from netns headers
The issue is that definitions in linux/in.h overlap with those
in netinet/in.h. This patch solves this by introducing the same
mechanism as was used to solve the same problem with linux/in6.h
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 279c6c7fa64f5763e6b9f05e7ab3840092e702e7)
|
|
Resolve conflicts between glibc definition of IPV6 socket options
and those defined in Linux headers. Looks like earlier efforts to
solve this did not cover all the definitions.
It resolves warnings during iproute2 build.
Please consider for stable as well.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 6d08acd2d32e3e877579315dc3202d7a5f336d98)
|
|
Solution:
=========
- Synchronize linux's `include/uapi/linux/in6.h'
with glibc's `inet/netinet/in.h'.
- Synchronize glibc's `inet/netinet/in.h with linux's
`include/uapi/linux/in6.h'.
- Allow including the headers in either other.
- First header included defines the structures and macros.
Details:
========
The kernel promises not to break the UAPI ABI so I don't
see why we can't just have the two userspace headers
coordinate?
If you include the kernel headers first you get those,
and if you include the glibc headers first you get those,
and the following patch arranges a coordination and
synchronization between the two.
Let's handle `include/uapi/linux/in6.h' from linux,
and `inet/netinet/in.h' from glibc and ensure they compile
in any order and preserve the required ABI.
These two patches pass the following compile tests:
cat >> test1.c <<EOF
int main (void) {
return 0;
}
EOF
gcc -c test1.c
cat >> test2.c <<EOF
int main (void) {
return 0;
}
EOF
gcc -c test2.c
One wrinkle is that the kernel has a different name for one of
the members in ipv6_mreq. In the kernel patch we create a macro
to cover the uses of the old name, and while that's not entirely
clean it's one of the best solutions (aside from an anonymous
union which has other issues).
I've reviewed the code and it looks to me like the ABI is
assured and everything matches on both sides.
Notes:
- You want netinet/in.h to include bits/in.h as early as possible,
but it needs in_addr so define in_addr early.
- You want bits/in.h included as early as possible so you can use
the linux specific code to define __USE_KERNEL_DEFS based on
the _UAPI_* macro definition and use those to cull in.h.
- glibc was missing IPPROTO_MH, added here.
Compile tested and inspected.
Reported-by: Thomas Backlund <tmb@mageia.org>
Cc: Thomas Backlund <tmb@mageia.org>
Cc: libc-alpha@sourceware.org
Cc: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Cc: David S. Miller <davem@davemloft.net>
Tested-by: Cong Wang <amwang@redhat.com>
Signed-off-by: Carlos O'Donell <carlos@redhat.com>
Signed-off-by: Cong Wang <amwang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit cfd280c91253cc28e4919e349fa7a813b63e71e8)
|
|
Previously, lvds-drive-strength was located in a wrong node and
there was no control of the 5th lane.
Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com>
Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
|
|
Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com>
Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
|
|
The current reset-gpio support triggers an interrupt storm on platforms
using the maxtouch with level based interrupt. The Motorola Droid 4,
which I used for some of the tests is not affected, since it uses a edge
based interrupt.
This change avoids the interrupt storm by enabling the device while its
interrupt is disabled. Afterwards we wait 100ms. This is important for
two reasons: The device is unresponsive for some time (~22ms for
mxt224E) and the CHG (interrupt) line is not working properly for 100ms.
We don't need to wait for any following interrupts, since the following
mxt_initialize() checks for bootloader mode anyways.
This fixes a boot issue on GE PPD (watchdog kills device due to
interrupt storm) and does not cause regression on Motorola Droid 4.
Fixes: f657b00df22e ("Input: atmel_mxt_ts - add support for reset line")
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Reviewed-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
(cherry picked from commit ca1cd36cef00260db6b35b32d863e0c580c0488d)
Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com>
Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
|
|
Align with mainline Atmel MXT driver.
Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com>
Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
|
|
Provide support for controlling reset pin. If this is not driven
correctly the device will be held in reset and will not respond.
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
(cherry picked from commit f657b00df22e231da217ca0162a75db452475e8f)
Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com>
Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
|
|
Switch mxt_data and interrupt to resource managed allocation methods,
which cleans up the driver slightly and prepares for adding
reset GPIO support.
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
(cherry picked from commit 8cc8446b9b62ef954b630ed30e53bd1553e916a6)
|
|
When using the 'object' sysfs attribute, T100 is not displayed in
the output.
Signed-off-by: Maxime Roussin-Bélanger <maxime.roussinbelanger@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
(cherry picked from commit 089b50d95948f691589cca4d81f1f8761747dbaa)
|