UPSTREAM: nfc: Cherry-pick upstream fixes to the PN533 driver.

This patch pulls in changes to the PN533 driver upto SHA
dfccd0f580445d176acea174175b3e6518cc91f7 from upstream.

The following is a short-log of the included changes:

Marina Makienko (1):
      NFC: pn533: Add missing usb_put_dev

Olivier Guiter (4):
      NFC: pn533: Fix ACR122 related debug output
      NFC: pn533: Add extended information frame decoding support
      NFC: pn533: Split large Tx frames in chunks
      NFC: pn533: Store the correct frame size (normal vs ext)

Samuel Ortiz (10):
      NFC: pn533: Turn radio on and off when bringing the device up and down
      NFC: pn533: Use 0x3 for SENSF_REQ Time Slot Number (TSN)
      NFC: pn533: Copy NFCID2 through ATR_REQ
      NFC: pn533: Fix hardware busy loop when establishing the LLCP link
      NFC: pn533: Fix the pn533 polling loop
      NFC: pn533: Request System code from SENSF_REQ
      NFC: pn533: Unconditionaly select the highest p2p bit rate
      NFC: pn533: Enable AUTO RFCA
      NFC: pn533: Add delay between each poll frame
      NFC: pn533: Add some polling entropy

Thierry Escande (2):
      NFC: pn533: Fix bad allocation size
      NFC: pn533: Fix target polling mode

Waldemar Rymarkiewicz (48):
      NFC: pn533: Remove unused definitions
      NFC: pn533: Add frame header length define
      NFC: pn533: Remove pointless flags param
      NFC: pn533: Add a new pn533_send_cmd_async iface
      NFC: pn533: Add a new pn533_send_data_async iface
      NFC: pn533: Add a new pn533_send_sync iface
      NFC: pn533: Add pn533_alloc_skb for req allocation
      NFC: pn533: Remove pn533_send_cmd_frame_sync
      NFC: pn533: Del frame logic from TgGet/SetData cmd
      NFC: pn533: Del frame logic from InJumForDep cmd
      NFC: pn533: Del frame logic from Data Exchange cmd
      NFC: pn533: Dump tx and rx data in debug mode
      NFC: pn533: Remove frame logic from poll cmds
      NFC: pn533: Fix quoted strings split across lines
      NFC: pn533: Fix spacing issues
      NFC: pn533: Fix open parenthesis alignment
      NFC: pn533: Fix minor style issues
      NFC: pn533: Remove unused pn533_send_cmd_frame_asy
      NFC: pn533: Fix urb->status handling
      NFC: pn533: Cleanup debug messages
      NFC: pn533: Don't use out_frame in pn533_send_ack
      NFC: pn533: Use skb in __pn533_send_cmd_frame_asyn
      NFC: pn533: Remove deprecated dev->out_frame buff
      NFC: pn533: Cleanup pn533_cmd_complete_t
      NFC: pn533: Remove unused dev->wq_in_frame
      NFC: pn533: Introduce ops for frame logic
      NFC: pn533: Fix missing parenthesis
      nfc: pn533: Use static poll_mod and std_frame_ops
      nfc: pn533: Remove unreachable code
      NFC: pn533: Reword all std frame logic funct
      NFC: pn533: Print out response status bits in hex
      NFC: pn533: Fix div by zero while stopping polling
      NFC: pn533: Update copyrights note
      NFC: pn533: Rename pn533_fw_reset appropriately
      NFC: pn533: Fix memleak while scheduling next cmd
      NFC: pn533: Optimise issued cmd context tracking
      NFC: pn533: Keep cmd context in pn533 struct
      NFC: pn533: Remove redundant cmd_ prefix in the struct
      NFC: pn533: Fix incorrect kfree of complete args
      NFC: pn533: Simplify __pn533_send_frame_async
      NFC: pn533: Avoid function declarations
      NFC: pn533: Re-group fields in struct pn533
      NFC: pn533: Move wq_in_error to cmd context
      NFC: pn533: Add protocol type for frame ops
      NFC: pn533: Add support for ACS ACR122U reader
      NFC: pn533: Add pn533_abort_cmd procedure
      NFC: pn533: Remove unused pn533_cmd_complete_t
      NFC: pn533: Increase version number

Wei Yongjun (1):
      NFC: pn533: Fix error return code in pn533_probe()

BUG=chromium:321920
TEST=1. USE="nfc" emerge-${BOARD} chromeos-kernel-next
     2. Test all changes using an SCL3711 PN533 based USB NFC adapter.

Signed-off-by: Arman Uguray <armansito@chromium.org>
Change-Id: I7af2c3bc79083549a9bc57053d723b82f470d3fe
Reviewed-on: https://chromium-review.googlesource.com/179551
Reviewed-by: Olof Johansson <olofj@chromium.org>
drm/exynos: Set mixer powered flag to true earlier

This patch moves the "ctx->powered = true" assignment above interrupt enable
and window reset/resume in the mixer. Aside from being the Right
Thing To Do (so we correctly track the state of the hardware),
it is also necessary. If this is not set before we run enable_vblank,
we will defer the enable indefinitely by just setting int_en instead
of actually flipping the bit in MXR_INT_EN.

BUG=chromium:331863
TEST=Tested on daisy, external screen updates on replug/resume

Change-Id: I15069caaeddb043b4d18df9744824f6cdae952b9
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/181641
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
UPSTREAM: video: add of helper for display timings/videomode

This adds support for reading display timings from DT into a struct
display_timings. The of_display_timing implementation supports multiple
subnodes. All children are read into an array, that can be queried.

If no native mode is specified, the first subnode will be used.

For cases where the graphics driver knows there can be only one
mode description or where the driver only supports one mode, a helper
function of_get_videomode is added, that gets a struct videomode from DT.

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Acked-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Thierry Reding <thierry.reding@avionic-design.de>
Acked-by: Thierry Reding <thierry.reding@avionic-design.de>
Tested-by: Thierry Reding <thierry.reding@avionic-design.de>
Tested-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Afzal Mohammed <Afzal@ti.com>
Tested-by: Rob Clark <robclark@gmail.com>
Tested-by: Leela Krishna Amudala <leelakrishna.a@gmail.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
(cherry picked from commit cc3f414cf2e404130584b63d373161ba6fd24bc2)

BUG=chromium:266008
TEST=Tested on spring

Change-Id: I98480c44cb850277e8077488324a819debc11664
Reviewed-on: https://chromium-review.googlesource.com/170353
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Commit-Queue: Sean Paul <seanpaul@chromium.org>
Tested-by: Sean Paul <seanpaul@chromium.org>
UPSTREAM: video: of: display_timing: add doubleclk flag

BUG=chromium:266008
TEST=Tested on spring

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
(cherry picked from commit 2d178a4abb33916fb8e1dea540921acdafe53875)

Change-Id: I510a12b28f64f9176764dafadfcd6bea38fad59b
Reviewed-on: https://chromium-review.googlesource.com/170354
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Commit-Queue: Sean Paul <seanpaul@chromium.org>
Tested-by: Sean Paul <seanpaul@chromium.org>
UPSTREAM: drm_modes: add of_videomode helpers

Add helper to get drm_display_mode from devicetree.

BUG=chromium:266008
TEST=Tested on spring

Change-Id: I0cad6753e05655eff435efbd8bf9a5915d27aae6
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Reviewed-by: Thierry Reding <thierry.reding@avionic-design.de>
Acked-by: Thierry Reding <thierry.reding@avionic-design.de>
Tested-by: Thierry Reding <thierry.reding@avionic-design.de>
Tested-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Afzal Mohammed <Afzal@ti.com>
Tested-by: Rob Clark <robclark@gmail.com>
Tested-by: Leela Krishna Amudala <leelakrishna.a@gmail.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
(cherry picked from commit edb37a95c58147f89713e6c5cd220fa8fdfb4833)
Reviewed-on: https://chromium-review.googlesource.com/175185
UPSTREAM: video: add display_timing and videomode

Add display_timing structure and the according helper functions. This allows
the description of a display via its supported timing parameters.

Also, add helper functions to convert from display timings to a generic videomode
structure.

The struct display_timing specifies all needed parameters to describe the signal
properties of a display in one mode. This includes
    - ranges for signals that may have min-, max- and typical values
    - single integers for signals that can be on, off or are ignored
    - booleans for signals that are either on or off

As a display may support multiple modes like this, a struct display_timings is
added, that holds all given struct display_timing pointers and declares the
native mode of the display.

Although a display may state that a signal can be in a range, it is driven with
fixed values that indicate a videomode. Therefore graphic drivers don't need all
the information of struct display_timing, but would generate a videomode from
the given set of supported signal timings and work with that.

The video subsystems all define their own structs that describe a mode and work
with that (e.g. fb_videomode or drm_display_mode). To slowly replace all those
various structures and allow code reuse across those subsystems, add struct
videomode as a generic description.

This patch only includes the most basic fields in struct videomode. All missing
fields that are needed to have a really generic video mode description can be
added at a later stage.

BUG=chromium:266008
TEST=Tested on spring

Change-Id: I4188f09fa246ec923f8d3229a4e34455319b395e
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Reviewed-by: Thierry Reding <thierry.reding@avionic-design.de>
Acked-by: Thierry Reding <thierry.reding@avionic-design.de>
Tested-by: Thierry Reding <thierry.reding@avionic-design.de>
Tested-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Afzal Mohammed <Afzal@ti.com>
Tested-by: Rob Clark <robclark@gmail.com>
Tested-by: Leela Krishna Amudala <leelakrishna.a@gmail.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
(cherry picked from commit 8714c0cecfc28f7ce73a520be4831f09743c4fd7)
Reviewed-on: https://chromium-review.googlesource.com/175186
UPSTREAM: video: display_timing: add doubleclk flag

BUG=chromium:266008
TEST=Tested on spring

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
(cherry picked from commit 267fdd92bb1a6da6beee5db476a7880269ac352d)

Change-Id: I51a740599a9a3eb91652b5c2373cf2b6f581c539
Reviewed-on: https://chromium-review.googlesource.com/175187
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Commit-Queue: Sean Paul <seanpaul@chromium.org>
Tested-by: Sean Paul <seanpaul@chromium.org>
UPSTREAM: of: fix incorrect return value of of_find_matching_node_and_match()

The of_find_matching_node_and_match() function incorrectly sets the matched
entry to 'matches' when the compatible value of a node matches one of the
possible values. This results in incorrectly selecting the the first entry in
the 'matches' list as the matched entry. Fix this by noting down the result of
the call to of_match_node() and setting that as the matched entry.

BUG=chromium:266008
TEST=Tested on spring

Change-Id: I85dd71ce16319fbec8128a2b77e232674c69e4d8
Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
(cherry picked from commit dc71bcf1b99c265fffdb1e8c60e7933612f3bca7)
Reviewed-on: https://chromium-review.googlesource.com/177756
CHROMIUM: config: exynos: Enable display timing

This enables some helpers that allow us to parse the
display-timings binding in the device tree.

BUG=chromium:266008
TEST=Tested on peach pit and spring

Change-Id: Iac72963662f43005833ed0ce757f98b68cde7f56
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/175188
Enable atmel 540s trackpad for atmel_mxt_ts driver

The Atmel 540s chip has an additional object in Atmel's object protocol
that was not used by previous ChromeOS devices.  This object T100 needs
to be supported if we are to use 540s touchpads in the future.  This CL
adds support to the atmel_mxt_ts drive for the T100 object and its
related parameters so that 540s touchpads will work.

BUG=chrome-os-partner:24559
TEST=Run evtest on new trackpad. Check the pointer moving and that
input events are arriving as expected.  This patched driver was also
tested on a Spring to make sure that the old Atmel pads that don't use
the new T100 format still work.

Change-Id: I4c4512b2b3c1f334196ad672cb17f7db16d293ee
Signed-off-by: Jongpil Jung <jongpil19.jung@samsung.com>
Signed-off-by: Charlie Mooney <charliemooney@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/180151
Reviewed-by: Wonjoon Lee <woojoo.lee@samsung.com>
Tested-by: Wonjoon Lee <woojoo.lee@samsung.com>
UPSTREAM: usb: core: get config and string descriptors for unauthorized devices

There is no need to skip querying the config and string descriptors for
unauthorized WUSB devices when usb_new_device is called.  It is allowed
by WUSB spec.  The only action that needs to be delayed until
authorization time is the set config.  This change allows user mode
tools to see the config and string descriptors earlier in enumeration
which is needed for some WUSB devices to function properly on Android
systems.  It also reduces the amount of divergent code paths needed
for WUSB devices.

Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 83e83ecb79a8225e79bc8e54e9aff3e0e27658a2)
Cherry picked from gregkh/usb.git/usb-next with trivial conflicts.

BUG=chrome-os-partner:24079
TEST=None

Change-Id: I024dafc90bb52004fb903100a46421ae0a5a4385
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/181801
Reviewed-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
UPSTREAM: mwifiex: send regulatory domain info to firmware only if alpha2 changed

On cfg80211 regulatory domain change, drivers gets alpha2 country
code or "00" in driver's notification handler.

In most cases, the pattern will be US, 00, US, 00, US, 00, US, ...
There is no need to send domain info to firmware in case of "00" or
with the same alpha2 country code.

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

BUG=chrome-os-partner:24845
TEST=Enable dynamic debug logs to confirm the domain info is sent only
at the first time of alpha2=US notificaiton or before associating to
an AP with US country code in beacons or probe responses.
Tested on Snow (kernel-next w/ wireless-3.8 and external SD8897 card).

Change-Id: Ifa7113e7d45f0b8182d882b394a5a1c627dc145c
Reviewed-on: https://chromium-review.googlesource.com/181701
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Bing Zhao <bzhao@marvell.com>
Tested-by: Bing Zhao <bzhao@marvell.com>
drm: edid: enable probing and listing of non rb modes

The current solution checks for the existing RB mode,
if available in the edid block returns by adding it,
but does not populate the connector with the modes
of same resolution but which are non-rb modes.

As a result the probing and listing of non-rb modes can't
be made, in case the rb mode's pixel clock is not
supported but non-rb mode is supported.

This patch changes the drm_mode_std mode selection to
collect all the supported modes and not just one mode.

BUG=chrome-os-partner:24846
TEST=connect 1080p monitor to Daisy, 1680x1050 should be available

Change-Id: I0d36a374cea52ad7f118daed37b55f292f124fcf
Signed-off-by: Shirish S <s.shirish@samsung.com>
Signed-off-by: Dominik Behr <dbehr@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/181822
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
UPSTREAM: mwifiex: add calibration data download feature

User can provide a text file containing calibration data in hex
format while loading mwifiex module. It will be downloaded to
firmware.
eg. insmod mwifiex.ko cal_data_cfg=cal_data.conf

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

BUG=chrome-os-partner:24845
TEST=Add debug prints to confirm cal_data_cfg cmd path works fine.
Tested on Snow (kernel-next w/ wireless-3.8 and external SD8897 card).

Change-Id: I5a14b70bdc7fcbfbafc127a2036dd5ebc5f69b3e
Reviewed-on: https://chromium-review.googlesource.com/181702
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Bing Zhao <bzhao@marvell.com>
Tested-by: Bing Zhao <bzhao@marvell.com>
UPSTREAM: mwifiex: remove cfg_data construction

The cfg_data buffer will include the cfg_data structure header
(action, type, data_len). This makes it work for all data types
without extra parsing.

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

BUG=chrome-os-partner:24845
TEST=Add debug logs to confirm that correct data is downloaded.
Tested on Snow (kernel-next w/ wireless-3.8 and external SD8897 card).

Change-Id: I917d0b4a152e5b36a31047a7436bdb18a450b7d1
Reviewed-on: https://chromium-review.googlesource.com/181703
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Bing Zhao <bzhao@marvell.com>
Tested-by: Bing Zhao <bzhao@marvell.com>
UPSTREAM: mwifiex: download cal-data from device-tree to firmware

Currently only conf file based cal-data downloading is supported.
On embedded platforms a better place to store the cal-data is in
device tree. Add cal-data downloading from device tree to firmware.
Both methods can co-exist.

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

BUG=chrome-os-partner:24845
TEST=Include sample cal-data to exynos5250-snow.dtsi, enable debug
logs, and check dmesg to confirm that sample cal-data stored in
device-tree is downloaded. Only code path is verified. The sample
cal-data may or may not be used by firmware.
Tested on Snow (kernel-next w/ wireless-3.8 and external SD8897 card).

Change-Id: Id927f13eeaa24db57b9840d383d523956d89388f
Reviewed-on: https://chromium-review.googlesource.com/181704
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Bing Zhao <bzhao@marvell.com>
Tested-by: Bing Zhao <bzhao@marvell.com>
UPSTREAM: mwifiex: download per country tx power table to firmware

When driver gets regulatory domain change notifications or before
associates to an AP with Country IE, the txpwrlimit table stored
in device tree for that country is downloaded to firmware.

The txpwrlimit downloading will happen only at the first time
when the alpha2 country code is changed. World regulatory domain
"00" notification doesn't trigger the downloading. This behavior
is same as domain_info command.

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

BUG=chrome-os-partner:24845
TEST=Include sample txpwrlimit table in exynos5250-snow.dtsi,
enable debug logs, and check dmesg to confirm that specific
country's txpwrlimit table in device-tree is downloaded.
Only code path is verified. The sample txpwrlimit table may or
may not be used by firmware.
Tested on Snow (kernel-next w/ wireless-3.8 and external SD8897 card).

Change-Id: I9a0f8ec8908736ead4da0d231460b8d4fd873a29
Reviewed-on: https://chromium-review.googlesource.com/181705
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Bing Zhao <bzhao@marvell.com>
CHROMIUM: alsa/soc: do not set AUI transmit when setting up infoframe

hdmi_reg_infoframe called from hdmi_conf_init unconditionally enables
sending AUI infoframe on every vsync. This register is also controlled
from hdmi_audio_control which is supposed to control HDMI audio.
Setting it from hdmi_reg_infoframe overrides hdmi_audio_control causing
HDMI audio to be always enabled, even on DVI monitors, which causes some
of them to blank when audio is playing in Chrome OS. This change removes
the unconditional setting of HDMI AUI transmit from hdmi_reg_infoframe
so hdmi_audio_control is really in control.
As a bonus, it also adds use of defines instead of literals for HDMI AUI
enable/disable in hdmi_audio_control.

BUG=chromium:331938
TEST=connect DVI monitor and play sound, it should not blank
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: Ibb299597e57b294beb57299bc132786f7f9af7a7
Reviewed-on: https://chromium-review.googlesource.com/181967
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
arm: dts: exynos542x: Refactor exynos5420 dts files

We are going to add a new variant of exynos5420 series which is almost
similar to exsisting exynos5420 SoC. This is ground work to add support
for new SoC.
In this patch we are just renaming file which will be used as common
file.

BUG=chrome-os-partner:24687
TEST=build and booted on pit, and everything works fine
Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>

Change-Id: I65c848e3219dac5d697a7d0003e92f020abeffe4
Reviewed-on: https://chromium-review.googlesource.com/181327
Reviewed-by: Doug Anderson <dianders@chromium.org>
Tested-by: Alim Akhtar <alim.akhtar@samsung.com>
Commit-Queue: Doug Anderson <dianders@chromium.org>
drm/exynos: Ensure mixer vsync irqs are enabled/disabled properly

This patch does the following:
- Ensures int_en always tracks the desired vsync state
- Clears MXR_INT_EN on power off to avoid the interrupts firing too
  early on poweron when we enable the clocks
- Refrains from enabling vsync until all window state has been restored

All together, this will avoid turning on vsync too early such that we
have inconsistent window state which causes iommu faults. Or, at least
that's the theory.

BUG=chrome-os-partner:24923,chromium:332599,chromium:331138
TEST=tested on daisy - hotplug/suspend-resume/resolution change

Change-Id: Iabeae6240dfd031a407a8517f5f74fc2cf97cdc1
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/181987