WDT: Zynq: Correct clock prescaler value

Clock pre-scaler bits, when set to 2, use divisor 512, not 256.

Signed-off-by: Harini Katakam <harinik@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
WDT: Zynq: Load timeout variable correctly

Use proper OF reading function for timeout property.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
WDT: zynq: Remove magic numbers

Remove magic numbers

Signed-off-by: Harini Katakam <harinik@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
WDT: zynq: Change order of input parameters to write_reg

Change order of input parameters to zynq_wdt_write_reg to be
consistent with other xilinx drivers.

Signed-off-by: Harini Katakam <harinik@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
WDT: zynq: Use static inline for write_reg

Use static inline function for zynq_wdt_writereg.

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

Remove paranthesis where not required. Add space after /* end of table */

Signed-off-by: Harini Katakam <harinik@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
WDT: zynq: Declare variables of same type on the same line

Declare variables of same type on the same line

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

Remove #ifdef CONFIG_PM_SLEEP and use __maybe_unused instead

Signed-off-by: Harini Katakam <harinik@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
WDT: zynq: Correct alignment

Correct alignment of multi-line statements using spaces

Signed-off-by: Harini Katakam <harinik@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
WDT: zynq: Remove PEEP related clock config in probe

Remove PEEP related clock config in probe as it is no longer necessary

Signed-off-by: Harini Katakam <harinik@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
WDT: zynq: Comment cleanup

Cleanup comments for better explanation.
Remove full stops where not required.

Signed-off-by: Harini Katakam <harinik@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
WDT: zynq: Remove raw_writel

Remove raw write and use writel_relaxed instead.

Signed-off-by: Harini Katakam <harinik@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
WDT: zynq: Remove unecessary header files

Dont include unecessary header files.

Signed-off-by: Harini Katakam <harinik@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
WDT: zynq: Simplify probe

Move register_reboot_notifier below register interrupt.
Remove goto err_notifier after request_irq and directly return.

Signed-off-by: Harini Katakam <harinik@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
WDT: zynq: Modify remove function

Remove check for nowayout and the else condition with a message.
This is not required. Mainline drivers still use nowayout but
this check is not required in remove.

Signed-off-by: Harini Katakam <harinik@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
WDT: zynq: Remove module_init and module_exit

Use module_platform_driver. Remove MODULE alias.

Signed-off-by: Harini Katakam <harinik@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
WDT: zynq: Revise device structure use

- Dont use a global instance variable.
- Declare struct zynq_wdt *wdt internal to a function.
- Include watchdog_device and notifier_block in zynq_wdt structure.
- Use watchog_get_drv_data, platform_get_drv_data, container_of etc.
  to get the required structure inside each function.
- Initialize members of zynq_wdt as required in probe.
- Remove busy check in the beginning of probe.

Signed-off-by: Harini Katakam <harinik@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
WDT: Rename zynq-wdt to cadence-wdt

- Change all prefixes/names/comments in zynq-wdt driver to use cdns.
- Change name in Kconfig and Makefile.
- Remove ARCH_ZYNQ dependency in Kconfig.
- Change compatible string to "xlxn,cdns-wdt-r1p2".
- Reflect above changes in dts and def_config.

Keep dependency on ARM and IOMEM because of i386
has no writel_relaxed IO helper functions.

Signed-off-by: Harini Katakam <harinik@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
WDT: cadence: Rename bindings property timeout to timeout-sec

Correct "timeout" property name to "timeout-sec" in driver and
relevant dts.

Signed-off-by: Harini Katakam <harinik@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
devicetree: Add Cadence WDT bindings documentation

Add cadence-wdt.txt for devicetree bindings documentation.

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