ASoC: Suppress restore of default register values for rbtree cache sync

Currently the rbtree code will write out the entire register map when
doing a cache sync which is wasteful and will slow things down. Check
to see if the value we're about to write is the default and don't bother
restoring it if it is, either the value will have been retained or the
device will have been reset and holds the value already.

We should really store the defaults in the nodes but this resolves the
immediate issue.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
(cherry picked from commit ffdaa48aed8dae94037b26a2f9050128facfaa2e)
ASoC: Factor out I2C usage in WM8962 driver

The chip can actually support SPI so we shouldn't assume we've got an I2C
device even though that's the most common configuration.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
(cherry picked from commit c7356da9e2ede4a89d000bde8a8a4408890943b9)
ASoC: Report errors when we have a WM8962 IRQ and don't get FLL lock

We really should be getting the interrupt - if we don't get one it's very
likely that the configuration is incorrect and audio will fail. Also
increase the timeout substantially in this case for safety.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
(cherry picked from commit 649a1a0ef28e5db99e838060f415a111566c63ea)
ASoC: Implement base 5 band EQ control for WM8962

ReTune Mobile modes are not currently supported.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
(cherry picked from commit 8f63aaa887d723f52d44b41074486defcd42ad95)
ASoC: Defer all WM8962 clocking configuration until power up

Don't require an audio rate SYSCLK in hw_params() in order to better
support microphone detection use cases.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
(cherry picked from commit 417ceff939bc61d4c71d24f071fad3f20ba4a1bd)
ASoC: Support Speyside build variants with WM8962 fitted

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
(cherry picked from commit 22cb839bc8545b3a68ae00107cae3636752bb94d)
ASoC: Fix mismerge of Speyside set_bias_level_post()

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
(cherry picked from commit 995e54f5fe4606043e695cd3327b18fcfc88bc62)
gpio/pca953x: Fix IRQ support.

It seems that in the normal case, IRQ_NOREQUEST needs to be explicitly
cleared, otherwise claiming the interrupt fails.
In the case of sparse interrupts, the descriptor needs to be allocated
first.

Signed-off-by: David Jander <david@protonic.nl>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
(cherry picked from commit 910c8fb6b4b8c9e0be576b6a78f4cccf228a4bfd)
gpio/pca953x: Interrupt pin is active-low

The interrupt pin of the PCA953x is active low, and on the rising edge
no interrupt should be produced.

Signed-off-by: David Jander <david@protonic.nl>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
(cherry picked from commit 17e8b42c17c3e9735ea03c4e6b67cedf5de170f4)
gpio/pca953x: Fix warning of enabled interrupts in handler

When using nested threaded irqs, use handle_nested_irq(). This function
does not call the chip handler, so no handler is set.

Signed-off-by: David Jander <david@protonic.nl>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
(cherry picked from commit 6dd599f8af0166805951f4421a78ba716d78321a)
ASoC: twl6040 - According to TWL6040 specification, gain start at 6dB and not -6dB.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@ti.com>
(cherry picked from commit 2763f45d40028721e8994d7cefa5df73727469c0)
regulator: Properly register dummy regulator driver

Recent changes in the driver core appear to mean that the data structures
for the driver core are not fully initialised unless the driver is bound.
Make sure the driver core knows the dummy driver is in use by binding it
to a driver.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
(cherry picked from commit c08957a2cf3c4a14e68d72c845d3c52cf3d826e1)
Bluetooth: Allow unsegmented SDU retries on sock_queue_rcv_skb failure

In L2CAP_SDU_UNSEGMENTED case, if sock_queue_rcv_skb returns error,
l2cap_ertm_reassembly_sdu should not return 0 so as to insert the
skb into BUSY_QUEUE for later retries.

Signed-off-by: Ruiyi Zhang <Ruiyi.Zhang@Atheros.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
(cherry picked from commit 224f8af0db1cd50e9d954ca9d5a7d7716f63d2b0)

Conflicts:

	net/bluetooth/l2cap_core.c
Bluetooth: fix set but not used warning

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
(cherry picked from commit 78676a06260a4162b6837a8a2fb954445004ebc2)
Bluetooth: Kill set but not used variable 'l2cap_sk' in rfcomm_sock_getsockopt_old()

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
(cherry picked from commit 75fde9ee1bca0c0c004aadaebdedf17370f93f18)

Conflicts:

	net/bluetooth/rfcomm/sock.c
Bluetooth: Remove unnecessary use of hci_dev_list_lock

The get_connections function has no need to use hci_dev_list_lock. The
code was there probably because of a copy-paste mistake.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
(cherry picked from commit 37e1c55de7b1edd3fb8fc3411ad0c32a213723d0)
Bluetooth: Create __l2cap_chan_close()

This is actually __l2cap_sock_close() renamed to __l2cap_chan_close().
At a first look it may not make sense, but with the further cleanups that
will come it will.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
(cherry picked from commit 4519de9a0478d8de438f8b80ab2e94668ef63ab4)

Conflicts:

	include/net/bluetooth/l2cap.h
	net/bluetooth/l2cap_sock.c
Bluetooth: Create l2cap_chan_send()

This move all the sending logic to l2cap_core.c, but we still have a
socket dependence there, struct msghdr. It will be removed in some of the
further commits.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
(cherry picked from commit 9a91a04a95d30a18909e2aec9d7b17b4c86088a7)
Bluetooth: Add chan->chan_type struct member

chan_type says if our chan is raw(direclty access to HCI),
connection less or connection oriented.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
(cherry picked from commit 715ec005cd10c5d53109ffe513e4d403644e3e48)
Bluetooth: create channel timer to replace sk_timer

The new timer does not belong to struct sock, tought it still touch some
sock things, but this will be sorted out soon.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
(cherry picked from commit ab07801d28985090ac38047b5a4d8952a7e1689f)