extcon: palmas: enable ID_GND and ID_FLOAT detection always

When integrating driver with Tegra platform, it is found that
the ID pins get detected only once after booting system and
further removal and re-insert does not detect the ID pin.

Fixing this issue with enabling interrupt on ID_GND and ID_FLOAT
always  and clearing the status on LATCH register which actually
occurred.

Also if interrupt occurs with line status as zero then based on
previous status, set the cable state.

Add debug prints to display the cable state when any cable
insertion/removal happen.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: Graeme Gregory <gg@slimlogic.co.uk>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
extcon: palams: add support for suspend/resume

Add suspend/resume callbacks and support for wakeup from
suspend on USB HOST or USB Device cable insertion or removal.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: Graeme Gregory <gg@slimlogic.co.uk>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
extcon: palmas: Option to disable ID/VBUS detection based on platform

Based on system design, platform needs to detect the VBUS or ID or
both. Provide option to select this through platform data to
disable part of cable detection through palmas-usb.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: Graeme Gregory <gg@slimlogic.co.uk>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
extcon: arizona: Use power efficient workqueue

None of the delayed work the driver schedules has particularly short delays
and it is not performance sensitive so let the scheduler run it wherever
is most efficient rather than in a per CPU workqueue by using the system
power efficient workqueue.

Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
extcon: gpio: Use power efficient workqueue for debounce

The debounce timeout is generally quite long and the work not performance
critical so allow the scheduler to run the work anywhere rather than in
the normal per-CPU workqueue.

Signed-off-by: Mark Brown <broonie@linaro.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
extcon: adc-jack: Use power efficient workqueue

The debounce timeout is generally quite long and the work not performance
critical so allow the scheduler to run the work anywhere rather than in
the normal per-CPU workqueue.

Signed-off-by: Mark Brown <broonie@linaro.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
Merge 3.11-rc4 into usb-next

We want those fixes in here also.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Merge tag 'iio-for-3.12a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

First round of new IIO drivers, features and cleanups for the 3.12 cycle.

There has been a lot of good work going into IIO recently, some of which
missed this pull request purely because I haven't caught up with all my
emails.

Core changes

1) Introduction of devm_iio_device_alloc/free and conversions of lots of
   drivers (37 + patches so far mostly from Sachin)
2) A Kconfig option to enabled some debug logging subsystem wide.

New drivers

1) Nuvoton NAU7802 adc driver
2) Avago APDS9300 ambient light sensor driver.

Staging graduations
1) ADIS16260 gyroscope (after a lot fo cleaning up from Lars-Peter)

New driver features

1) ST-sensors gain control of which pin is used for dataready.
2) mcp4725 gains eeprom saving (a later fix deals with a wrong return type
   bug in that patch)
3) A number of drivers have gained module alias' to aid autoloading.

Cleanups and minor bug fixes.

1) A number of typos in Kconfig comments
2) Drop remaining mentions of ring buffers (now just buffers)
3) Overrestrictive i2c function checking in the invensense mpu6050 driver
4) Some help text clarifications.
5) store_eeprom is now used in several drivers so move to generic abi docs.
6) Update dac power down options.
7) Add some error handlign to mxs-lradc on stmp_reset_block call.
8) Lars fixed the alphabetical order in various files and added comments
   to try and prevent them getting messed up again.
9) Dropped some remaining 'reset' attributes for drivers.  We have never
   seen a reason why these should be available.  Finally the macro
   used to define many of these has gone.
10) lps331ap gets an easier to check temperature scale implementation.
11) Various cleanups for the hmc5843 from Peter with a view to getting
    it ready for a staging graduation.

Quite a few other little typo fixes etc.
Revert "iio: add configuration option for debug support"

This reverts commit 98a5e9e99d05e9b6a14778b85631b55e8e349990.

IIO, like the rest of the kernel, should rely on dynamic debugging, not
have a special config option for it.  That way, no user has to rebuild
their kernel to have debug messages, which is a good thing, let's not
revert back to the bad old days of the 2000's.

Cc: Otavio Salvador <otavio@ossystems.com.br>
Cc: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Merge tag 'extcon-next-for-3.12' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon into char-misc-next

Chanwoo writes:

Update extcon for 3.12

This patchset add new file for OF helper API and modify small fix of extcon-palmas
driver. Also, extcon core dirver use power_efficient_wq instead of system_wq.

Detailed description for patchset:
1. Add new file for OF helper API
- Add OF(OpenFirmware) Helper API which is of_extcon_get_extcon_device().
  This helper API get the extcon device name on extcon consumer device.
- Add usase case about OF helper API of extcon in dwc3-omap.c. dwc3-omap driver
  use extcon subsystem to detect the state of USB/USB-Host cable so dwc3-omap
  call of_extcon_get_extcon_device() to need extcon device name.

2. Modify extcon-palmas.c driver
- Provide option to select whether interrupt is used or not
- Support suspend/resume for palmas driver
- Update palmas interrupt register to detect ID pin
- Code clean to remove unused data
- Rename filename for device tree binding (extcon-twl.txt -> extcon-palmas.txt)

3. Use power_effcient_wq on extcon core driver/extcon-arizona instead of system_wq
- extcon core driver(extcon-gpio.c/extcon-adc-jack.c) use power_effcient_wq
instead of system_wq.
Tools: hv: in kvp_set_ip_info free mac_addr right after usage

... to simplify error path in upcoming changes.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Tools: hv: check return value of system in hv_kvp_daemon

hv_kvp_daemon.c: In function 'main':
hv_kvp_daemon.c:1441:8: warning: ignoring return value of 'daemon', declared with attribute warn_unused_result [-Wunused-result]

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging/zcache: Fix memory leak while dropping an o2net_sock_container object

Free sc->sc_page when releasing a struct o2net_sock_container
object to avoid memory leaks.

This issue has been fixed by Younger Liu for OCFS2, so I sync
that patch to zcache as we share the same network code base.

Cc: Younger Liu <younger.liu@huawei.com>
Cc: Bob Liu <bob.liu@oracle.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Jie Liu <jeff.liu@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
serial: mxs: enable the DMA only when the RTS/CTS is valid

The original DMA support works only when RTS/CTS is enabled.
(see the "e800163 serial: mxs-auart: add the DMA support for mx28")
But after several patches, DMA support has lost this limit.
(see the "bcc20f9 serial: mxs-auart: move to use generic DMA helper")

So an UART without the RTS/CTS lines may also enables the DMA support,
in which case the UART may gets unpredictable results.

This patch adds an optional property for the UART DT node
which indicates the UART has RTS and CTS lines, and it also means you
enable the DMA support for this UART.

This patch also adds a macro MXS_AUART_RTSCTS, and uses it to check
RTS/CTS before we enable the DMA for the UART.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Huang Shijie <shijie8@gmail.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
serial: mxs: remove the MXS_AUART_DMA_CONFIG

The MXS_AUART_DMA_CONFIG is originally used to check if the DT node
is configured with the DMA property.

But now, the MXS_AUART_DMA_CONFIG is set unconditionally in the
serial_mxs_probe_dt(), so the check in the mxs_auart_settermios() is
not necessary anymore. This patch removes this macro.

Signed-off-by: Huang Shijie <shijie8@gmail.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ARM: dts: imx28-evk: add the RTS/CTS property for auart0

Add the RTS/CTS property for auart0 which means we enable the
DMA support for it.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
vt: make the default color configurable

The virtual console has (undocumented) module parameters to set the
colors for italic and underlined text, but the default text color was
hardcoded for some reason.  This made it impossible to change the color
for startup messages, or to set the default for new virtual consoles.
Add a module parameter for that, and document the entire bunch.

Any hacker who thinks that a command prompt on a "black screen with
white font" is not supicious enough can now use the kernel parameter
vt.color=10 to get a nice, evil green.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
register_console: prevent adding the same console twice

This patch guards the console_drivers list to be corrupted. The
for_each_console() macro insist on a strictly forward list ended by NULL:

 con0->next->con1->next->NULL

Without this patch it may happen easily to destroy this list for example by
adding 'earlyprintk' twice, especially on embedded devices where the early
console is often a single static instance.  This will result in the following
list:

 con0->next->con0

This in turn will result in an endless loop in console_unlock() later on by
printing the first __log_buf line endlessly.

Signed-off-by: Andreas Bießmann <andreas@biessmann.de>
Cc: Kay Sievers <kay@vrfy.org>
Cc: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
spi: bcm2835: Use SPI_BPW_MASK macro for bits_per_word_mask setting

We have a SPI_BPW_MASK macro defined in spi.h, use it instead of open-coded.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
spi: octeon: Remove my_master pointer from struct octeon_spi

Pass master to platform_set_drvdata() then we can remove my_master pointer.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>