SPI: cadence: Use one line comments

Changed multi line comments to one line comments where possible.
Corrected multi line comment in one place.

Signed-off-by: Harini Katakam <harinik@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
SPI: cadence: Declare variables of same type in one line.

Declare variables of same type in the same line.

Signed-off-by: Harini Katakam <harinik@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
SPI: cadence: Changes to improve readability in config_clock function

Changed statements writing to req_hz, ctrl_reg variables and aligned
while loop statement to improve readability in cdns_spi_config_clock()

Signed-off-by: Harini Katakam <harinik@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
SPI: cadence: Remove paranthesis

Remove paranthesis where unecessary.

Signed-off-by: Harini Katakam <harinik@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
SPI: cadence: Use one more blank line for consintency

No functional change.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
SPI: cadence: Add short description in cdns_transfer_one_message

Add short description for function to fix kernel-doc warning.

Signed-off-by: Harini Katakam <harinik@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
SPI: cadence: Readability change in transfer_one_message

Change if statement in transfer_one_message to improve readability.

Signed-off-by: Harini Katakam <harinik@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
SPI: cadence: Remove #ifdef CONFIG_PM_SLEEP and use __maybe_unused

Remove #ifdef CONFIG_PM_SLEEP and use __maybe_unused.

Signed-off-by: Harini Katakam <harinik@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
SPI: cadence: Make irq a local variable

Remove irq from cdns_spi structure and make it a local variable in
probe function because that's the only place where it is used.

Signed-off-by: Harini Katakam <harinik@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
SPI: cadence: Dont typecast master->num_chipselect

Use a local integer variable to get property and then write the same
in master->num_chipselect.

There is an option to use of_property_read_u16 but for
that different device-tree description has to be used
num-chip-select = /bits/ 16 <4>;
This change will be discussed in mainling process.

Signed-off-by: Harini Katakam <harinik@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
SPI: cadence: Add space after compatible string and comment

Add space after compatible string statement and "end of table" comment

Signed-off-by: Harini Katakam <harinik@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
SPI: cadence: Simplify return logic in prepare_transfer_hardware function

Simplify return logic in prepare_transfer_hardware function

Signed-off-by: Harini Katakam <harinik@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
SPI: cadence: Use separate variables for status and length

In transfer one message, use separate variables for transfer and length
in transfer_one_message.
The start_transfer function returns number of bytes transferred or an
error status (a negative value).
So use "length" to store the return of this function.

If length != transfer length, then
check if length > 0 - in which case status should be -EMSGSIZE.
if length < 0, then the function returned error status which should
be reflected in status variable.

If the length is equal to transfer length, above loop wont be entered;
the length should be reflected in msg length and status should be set
to 0 for success.

Signed-off-by: Harini Katakam <harinik@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
SPI: cadence: Set default baud rate divisor to 4

Set default config register value with baud rate 4 as that is the
default valid value. Reflect the same in xspi->speed_hz in probe.

Signed-off-by: Harini Katakam <harinik@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
SPI: cadence: Adjust alignment in driver

Adjust alignment of all statement extending over one line by using spaces.

Signed-off-by: Harini Katakam <harinik@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
mtd: m25p80: Fix the incorrect ear value on startup

The current implementation always assume that the ear/bank register
value is always zero on startup and this would cause issue if the u-boot
which launches linux might have set it to any arbitrary value. When this
happens all initial accesses to bank 0 will return incorrect data from
the wrong bank.
On startup, this fix ensure that the curbank field is updated with the
ear/bank register value and avoid accessing the wrong bank data.

Signed-off-by: Punnaiah Choudary Kalluri <punnaia@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>