pia35x: ems expansion fixes

- modalias is mcp2515 for can ic
- correct chip select for fourth rs485 ic
- gpio cs array must be declared in board file not in devices.c
- rename pia_ems => pia_ems_io
- don't use gpio cs for mcspi1 devices

Signed-off-by: Björn Krombholz <b.krombholz@pironex.de>
spi/omap_mcspi: Fix broken last word xfer

Commit adef658 "spi/omap_mcspi: catch xfers of non-multiple SPI word size"
broke the transmission of last word in cases where access is multiple of
word size and word size is 16 or 32 bits.

Fix this by replacing the test "c > (word_len>>3)" in do-while loops with
"c >= 'pointer increment size'". This ensures that the last word is
transmitted in above case and still allow to break the loop and prevent
variable c underflow in cases where word size != 'pointer increment size'.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Tested-by: Sourav Poddar<sourav.poddar@ti.com>
Acked-by: Michael Jones <michael.jones@matrix-vision.de>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
pia35x: fix spi configuration for ems expansion

- define controller_data for spi devices
- fix GPIO IRQ for RS485 devices

Signed-off-by: Björn Krombholz <b.krombholz@pironex.de>
serial: max3100: HACK invert RTS logic

- invert logic of RTS output because of a bug in the example schematic
- when nRTS was driven low DE was driver low as well, disabling the driver
  during send
- we also need to wait for the RTS release otherwise the release will happen
  during a data transmission,
- the tx buffer empty flag doesn't work as an indicator for the end of the
  physical transmission, as the flag is emptied immediately for a single byte
  transmission

Signed-off-by: Björn Krombholz <b.krombholz@pironex.de>
pia35x: add inverted rts logic confguration for EMS RS485 drivers

Signed-off-by: Björn Krombholz <b.krombholz@pironex.de>
omapdss: fix front/back porch for DEM480272d display

- correct display view offset

Signed-off-by: Björn Krombholz <b.krombholz@pironex.de>
pia35x: rework lcd board initialization

- change default I2C address to 0x48 for DEM displays
- update display switching by kernel parameter

Signed-off-by: Björn Krombholz <b.krombholz@pironex.de>
alsa: soc: am35xpia: fix mic input naming

- Mic In -> DMic for mic widget name

Signed-off-by: Björn Krombholz <b.krombholz@pironex.de>
alsa: soc: pia35x: fix mic routing names

Signed-off-by: Björn Krombholz <b.krombholz@pironex.de>
omapdss: add support for DT028ATFT display

Signed-off-by: Björn Krombholz <b.krombholz@pironex.de>
pia35x: add support for DT028a display board

Signed-off-by: Björn Krombholz <b.krombholz@pironex.de>
USB: serial/usb_wwan, fix tty NULL dereference

tty_port_tty_get may return without any problems NULL. Handle this
case and do not oops in usb_wwan_indat_callback by dereferencing it.

The oops:
Unable to handle kernel paging request for data at address 0x000000d8
Faulting instruction address: 0xc0175b3c
Oops: Kernel access of bad area, sig: 11 [#1]
PowerPC 40x Platform
last sysfs file:
/sys/devices/pci0000:00/0000:00:00.0/0000:01:00.0/0000:02:09.2/usb1/idVendor
Modules linked in:
NIP: c0175b3c LR: c0175e7c CTR: c0215c90
REGS: c77f7d50 TRAP: 0300   Not tainted  (2.6.37-rc5)
MSR: 00021030 <ME,CE,IR,DR>  CR: 88482028  XER: 2000005f
DEAR: 000000d8, ESR: 00000000
TASK = c7141b90[1149] 'wvdial' THREAD: c2750000
GPR00: 00021030 c77f7e00 c7141b90 00000000 0000000e 00000000 0000000e c0410680
GPR08: c683db00 00000000 00000001 c03c81f8 88482028 10073ef4 ffffffb9 ffffff94
GPR16: 00000000 fde036c0 00200200 00100100 00000001 ffffff8d c34fabcc 00000000
GPR24: c71120d4 00000000 00000000 0000000e 00021030 00000000 00000000 0000000e
NIP [c0175b3c] tty_buffer_request_room+0x2c/0x194
LR [c0175e7c] tty_insert_flip_string_fixed_flag+0x3c/0xb0
Call Trace:
[c77f7e00] [00000003] 0x3 (unreliable)
[c77f7e30] [c0175e7c] tty_insert_flip_string_fixed_flag+0x3c/0xb0
[c77f7e60] [c0215df4] usb_wwan_indat_callback+0x164/0x170
...

References: https://bugzilla.kernel.org/show_bug.cgi?id=24582
Cc: Amit Shah <amitshah@gmx.net>
Cc: baoyb <baoyb@avit.org.cn>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
pia35x: handle different revisions of lcd expansions

- we have 2 revisions of expansion boards using differnt I2C addresses

Signed-off-by: Björn Krombholz <b.krombholz@pironex.de>
pia35x: fix build error with pr_err(or)

Signed-off-by: Björn Krombholz <b.krombholz@pironex.de>
serial: max3100: fix half duplex handling

- make sure we switch off RTS signal when no data transmission is requested
  or active
- unify code for inverted and normal rts modes

Signed-off-by: Björn Krombholz <b.krombholz@pironex.de>
pia35x: add support for max3100 on non-prototype boards

- the rts logic was reverted in revision 1, we handle this by
  assigning a new revision != 0 for newer boards

Signed-off-by: Björn Krombholz <b.krombholz@pironex.de>
serial: max3100: fix dropped bytes

- sometimes a received byte was dropped when the received
 status changed during RTS clearing

Signed-off-by: Björn Krombholz <b.krombholz@pironex.de>
pia35x: add board-flash to build deps

- this fixes a build error when no board with this dependency is selected

Signed-off-by: Björn Krombholz <b.krombholz@pironex.de>
serial: max3100: force rts when internal state different than real state

- when the terminal is not reset on close and the internal state of the
  tty has RTS set while the pin is actually in its off state, the driver
  stays disabled as the RTS is only set when it changes
- in a half-duplex configuration where RTS drives the DE signal, this has
  caused a failure of transmissions
- TODO: differentiate between full/half duplex mode in driver, as the
  current state is not optimal for full-duplex operations

Signed-off-by: Björn Krombholz <b.krombholz@pironex.de>
n_gsm: Fix support for legacy encoding

The mux supports several encoding schemes. Encoding 0 is a "not
recommended" mode still sometimes used. This has now been tested with
hardware that supports this mode, and found wanting.

Fix the FCS handling in this mode and correct the state machine.

Signed-off-by: Ken Mills <ken.k.mills@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>