I2C: zynq: Avoid pointless zero-initializer

Avoid zero-initializaton of memory that has been allocated through
(devm_)kzalloc.

Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
I2C: zynq: Fix white space errors and comments

Fixup some white space issues and reformat some comments.

Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
I2C: zynq: Fix clock notifier documentation

Fixup the documentation regarding the driver's clock notifier callback.

Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
I2C: zynq: Be less magic

Replace some magic numbers with guaranteed non-magic #defines.

Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
I2C: zynq: Simplify control flow

Combine loops and if-statements where possible to improve code
readability.

Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
I2C: zynq: Use temp variables for registers

Use temporary variables to store register values. This way nesting
read/write accessors is avoided, which makes the code more readable and
achieves nicer indentation.

Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
I2C: zynq: Remove unused function parameter

Since commit 'I2C: zynq: Refactor frequency adjustment policy'
(0fdd34575efae5c8eced09b6b0a1b723bff4d225) the frequency error
returned by zynq_i2c_calc_divs() is no longer used. Thus, it can be
removed from the argument list.

Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
I2C: zynq: Use helper function to clear bus hold bit

Clearing the bus hold bit occurs rather often and causes questionable
indentation. A helper functions seem appropriate.

Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
I2C: zynq: Remove redundant headers

A few headers are apparently redundant and can be removed.

Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
I2C: Rename i2c-zynq to i2c-cadence

Zynq uses a Cadence I2C controller. Rename the driver accordingly.

Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
I2C: cadence: Remove legacy Zynq compat string

Users have migrated to the Cadence compat string. Remove the legacy one.

Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
I2C: cadence: Document DT binding

Add documentation for the DT binding for the i2c-cadence driver.

Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
hwmon: (pmbus) Support per-page exponent in linear mode

Some chips use different exponents for sensors on different pages
or rails. Detect and store exponent per page to support this situation.

This fixes a problem with wrong voltages seen on UCD90120.

Reported-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Tested-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
zynq: Use zynq-nand-1.00.a compatible string

Instead of ps7-nand-1.00.a.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
can: xilinx: Fixed the checkpatch warning

This patch fixes the checkpatch warning.
WARNING: networking block comments don't use an empty /* line,
use /* Comment...

Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
can: xilinx: Use proper fifo depths

The Axi CAN controller can be configured with different tx
and rx fifo depth. This patch add's support for this by reading
the hardware configured values from device-tree.Renamed the
variable xcan_echo_skb_max to xcan_echo_skb_max_tx.

Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
can: xilinx: Add NAPI support

This Patch Add's the NAPI support for the
receive side.

Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
can: xilinx: Update proper TEC and REC in xcan_get_berr_counter

This patch updates the proper Transmit error counter(TEC)
and Receive error counter(REC) in xcan_get_berr_counter routine.

Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
can: xilinx: Code cleanup in the transmit side

This patch cleans up the redundant code in the transmit side.

Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
can: xilinx: Code cleanup in the receive side

This patch removes the unnecessary endian conversion
in the receive side.

Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>