# SPDX-License-Identifier: GPL-2.0-only

#
# Watchdog device configuration
#

menuconfig WATCHDOG
	bool "Watchdog Timer Support"
	---help---
	  If you say Y here (and to one of the following options) and create a
	  character special file /dev/watchdog with major number 10 and minor
	  number 130 using mknod ("man mknod"), you will get a watchdog, i.e.:
	  subsequently opening the file and then failing to write to it for
	  longer than 1 minute will result in rebooting the machine. This
	  could be useful for a networked machine that needs to come back
	  on-line as fast as possible after a lock-up. There's both a watchdog
	  implementation entirely in software (which can sometimes fail to
	  reboot the machine) and a driver for hardware watchdog boards, which
	  are more robust and can also keep track of the temperature inside
	  your computer. For details, read
	  <file:Documentation/watchdog/watchdog-api.rst> in the kernel source.

	  The watchdog is usually used together with the watchdog daemon
	  which is available from
	  <ftp://ibiblio.org/pub/Linux/system/daemons/watchdog/>. This daemon can
	  also monitor NFS connections and can reboot the machine when the process
	  table is full.

	  If unsure, say N.

if WATCHDOG

config WATCHDOG_CORE
	tristate "WatchDog Timer Driver Core"
	---help---
	  Say Y here if you want to use the new watchdog timer driver core.
	  This driver provides a framework for all watchdog timer drivers
	  and gives them the /dev/watchdog interface (and later also the
	  sysfs interface).

config WATCHDOG_NOWAYOUT
	bool "Disable watchdog shutdown on close"
	help
	  The default watchdog behaviour (which you get if you say N here) is
	  to stop the timer if the process managing it closes the file
	  /dev/watchdog. It's always remotely possible that this process might
	  get killed. If you say Y here, the watchdog cannot be stopped once
	  it has been started.

config WATCHDOG_HANDLE_BOOT_ENABLED
	bool "Update boot-enabled watchdog until userspace takes over"
	default y
	help
	  The default watchdog behaviour (which you get if you say Y here) is
	  to ping watchdog devices that were enabled before the driver has
	  been loaded until control is taken over from userspace using the
	  /dev/watchdog file. If you say N here, the kernel will not update
	  the watchdog on its own. Thus if your userspace does not start fast
	  enough your device will reboot.

config WATCHDOG_OPEN_TIMEOUT
	int "Timeout value for opening watchdog device"
	default 0
	help
	  The maximum time, in seconds, for which the watchdog framework takes
	  care of pinging a hardware watchdog.  A value of 0 means infinite. The
	  value set here can be overridden by the commandline parameter
	  "watchdog.open_timeout".

config WATCHDOG_SYSFS
	bool "Read different watchdog information through sysfs"
	help
	  Say Y here if you want to enable watchdog device status read through
	  sysfs attributes.

comment "Watchdog Pretimeout Governors"

config WATCHDOG_PRETIMEOUT_GOV
	bool "Enable watchdog pretimeout governors"
	depends on WATCHDOG_CORE
	help
	  The option allows to select watchdog pretimeout governors.

config WATCHDOG_PRETIMEOUT_GOV_SEL
	tristate
	depends on WATCHDOG_PRETIMEOUT_GOV
	default m
	select WATCHDOG_PRETIMEOUT_GOV_PANIC if WATCHDOG_PRETIMEOUT_GOV_NOOP=n

if WATCHDOG_PRETIMEOUT_GOV

config WATCHDOG_PRETIMEOUT_GOV_NOOP
	tristate "Noop watchdog pretimeout governor"
	depends on WATCHDOG_CORE
	default WATCHDOG_CORE
	help
	  Noop watchdog pretimeout governor, only an informational
	  message is added to kernel log buffer.

config WATCHDOG_PRETIMEOUT_GOV_PANIC
	tristate "Panic watchdog pretimeout governor"
	depends on WATCHDOG_CORE
	default WATCHDOG_CORE
	help
	  Panic watchdog pretimeout governor, on watchdog pretimeout
	  event put the kernel into panic.

choice
	prompt "Default Watchdog Pretimeout Governor"
	default WATCHDOG_PRETIMEOUT_DEFAULT_GOV_PANIC
	help
	  This option selects a default watchdog pretimeout governor.
	  The governor takes its action, if a watchdog is capable
	  to report a pretimeout event.

config WATCHDOG_PRETIMEOUT_DEFAULT_GOV_NOOP
	bool "noop"
	depends on WATCHDOG_PRETIMEOUT_GOV_NOOP
	help
	  Use noop watchdog pretimeout governor by default. If noop
	  governor is selected by a user, write a short message to
	  the kernel log buffer and don't do any system changes.

config WATCHDOG_PRETIMEOUT_DEFAULT_GOV_PANIC
	bool "panic"
	depends on WATCHDOG_PRETIMEOUT_GOV_PANIC
	help
	  Use panic watchdog pretimeout governor by default, if
	  a watchdog pretimeout event happens, consider that
	  a watchdog feeder is dead and reboot is unavoidable.

endchoice

endif # WATCHDOG_PRETIMEOUT_GOV

#
# General Watchdog drivers
#

comment "Watchdog Device Drivers"

# Architecture Independent

config SOFT_WATCHDOG
	tristate "Software watchdog"
	select WATCHDOG_CORE
	help
	  A software monitoring watchdog. This will fail to reboot your system
	  from some situations that the hardware watchdog will recover
	  from. Equally it's a lot cheaper to install.

	  To compile this driver as a module, choose M here: the
	  module will be called softdog.

config SOFT_WATCHDOG_PRETIMEOUT
	bool "Software watchdog pretimeout governor support"
	depends on SOFT_WATCHDOG && WATCHDOG_PRETIMEOUT_GOV
	help
	  Enable this if you want to use pretimeout governors with the software
	  watchdog. Be aware that governors might affect the watchdog because it
	  is purely software, e.g. the panic governor will stall it!

config BD70528_WATCHDOG
	tristate "ROHM BD70528 PMIC Watchdog"
	depends on MFD_ROHM_BD70528
	select WATCHDOG_CORE
	help
	  Support for the watchdog in the ROHM BD70528 PMIC. Watchdog trigger
	  cause system reset.

	  Say Y here to include support for the ROHM BD70528 watchdog.
	  Alternatively say M to compile the driver as a module,
	  which will be called bd70528_wdt.

config DA9052_WATCHDOG
	tristate "Dialog DA9052 Watchdog"
	depends on PMIC_DA9052 || COMPILE_TEST
	select WATCHDOG_CORE
	help
	  Support for the watchdog in the DA9052 PMIC. Watchdog trigger
	  cause system reset.

	  Say Y here to include support for the DA9052 watchdog.
	  Alternatively say M to compile the driver as a module,
	  which will be called da9052_wdt.

config DA9055_WATCHDOG
	tristate "Dialog Semiconductor DA9055 Watchdog"
	depends on MFD_DA9055 || COMPILE_TEST
	select WATCHDOG_CORE
	help
	  If you say yes here you get support for watchdog on the Dialog
	  Semiconductor DA9055 PMIC.

	  This driver can also be built as a module.  If so, the module
	  will be called da9055_wdt.

config DA9063_WATCHDOG
	tristate "Dialog DA9063 Watchdog"
	depends on MFD_DA9063 || COMPILE_TEST
	select WATCHDOG_CORE
	help
	  Support for the watchdog in the DA9063 PMIC.

	  This driver can be built as a module. The module name is da9063_wdt.

config DA9062_WATCHDOG
	tristate "Dialog DA9062/61 Watchdog"
	depends on MFD_DA9062 || COMPILE_TEST
	select WATCHDOG_CORE
	help
	  Support for the watchdog in the DA9062 and DA9061 PMICs.

	  This driver can be built as a module. The module name is da9062_wdt.

config GPIO_WATCHDOG
	tristate "Watchdog device controlled through GPIO-line"
	depends on OF_GPIO
	select WATCHDOG_CORE
	help
	  If you say yes here you get support for watchdog device
	  controlled through GPIO-line.

config GPIO_WATCHDOG_ARCH_INITCALL
	bool "Register the watchdog as early as possible"
	depends on GPIO_WATCHDOG=y
	help
	  In some situations, the default initcall level (module_init)
	  in not early enough in the boot process to avoid the watchdog
	  to be triggered.
	  If you say yes here, the initcall level would be raised to
	  arch_initcall.
	  If in doubt, say N.

config MENF21BMC_WATCHDOG
	tristate "MEN 14F021P00 BMC Watchdog"
	depends on MFD_MENF21BMC || COMPILE_TEST
	depends on I2C
	select WATCHDOG_CORE
	help
	  Say Y here to include support for the MEN 14F021P00 BMC Watchdog.

	  This driver can also be built as a module. If so the module
	  will be called menf21bmc_wdt.

config MENZ069_WATCHDOG
	tristate "MEN 16Z069 Watchdog"
	depends on MCB
	select WATCHDOG_CORE
	help
	  Say Y here to include support for the MEN 16Z069 Watchdog.

	  This driver can also be built as a module. If so the module
	  will be called menz069_wdt.

config TANGOX_WATCHDOG
	tristate "Sigma Designs SMP86xx/SMP87xx watchdog"
	select WATCHDOG_CORE
	depends on ARCH_TANGO || COMPILE_TEST
	depends on HAS_IOMEM
	help
	  Support for the watchdog in Sigma Designs SMP86xx (tango3)
	  and SMP87xx (tango4) family chips.

	  This driver can be built as a module. The module name is tangox_wdt.

config WDAT_WDT
	tristate "ACPI Watchdog Action Table (WDAT)"
	depends on ACPI
	select WATCHDOG_CORE
	select ACPI_WATCHDOG
	help
	  This driver adds support for systems with ACPI Watchdog Action
	  Table (WDAT) table. Servers typically have this but it can be
	  found on some desktop machines as well. This driver will take
	  over the native iTCO watchdog driver found on many Intel CPUs.

	  To compile this driver as module, choose M here: the module will
	  be called wdat_wdt.

config WM831X_WATCHDOG
	tristate "WM831x watchdog"
	depends on MFD_WM831X
	select WATCHDOG_CORE
	help
	  Support for the watchdog in the WM831x AudioPlus PMICs.  When
	  the watchdog triggers the system will be reset.

config WM8350_WATCHDOG
	tristate "WM8350 watchdog"
	depends on MFD_WM8350
	select WATCHDOG_CORE
	help
	  Support for the watchdog in the WM8350 AudioPlus PMIC.  When
	  the watchdog triggers the system will be reset.

config XILINX_WATCHDOG
	tristate "Xilinx Watchdog timer"
	depends on HAS_IOMEM
	select WATCHDOG_CORE
	help
	  Watchdog driver for the xps_timebase_wdt ip core.

	  To compile this driver as a module, choose M here: the
	  module will be called of_xilinx_wdt.

config ZIIRAVE_WATCHDOG
	tristate "Zodiac RAVE Watchdog Timer"
	depends on I2C
	select WATCHDOG_CORE
	help
	  Watchdog driver for the Zodiac Aerospace RAVE Switch Watchdog
	  Processor.

	  To compile this driver as a module, choose M here: the
	  module will be called ziirave_wdt.

config RAVE_SP_WATCHDOG
	tristate "RAVE SP Watchdog timer"
	depends on RAVE_SP_CORE
	depends on NVMEM || !NVMEM
	select WATCHDOG_CORE
	help
	  Support for the watchdog on RAVE SP device.

config MLX_WDT
	tristate "Mellanox Watchdog"
	depends on MELLANOX_PLATFORM
	select WATCHDOG_CORE
	select REGMAP
	help
	  This is the driver for the hardware watchdog on Mellanox systems.
	  If you are going to use it, say Y here, otherwise N.
	  This driver can be used together with the watchdog daemon.
	  It can also watch your kernel to make sure it doesn't freeze,
	  and if it does, it reboots your system after a certain amount of
	  time.

	  To compile this driver as a module, choose M here: the
	  module will be called mlx-wdt.

# ALPHA Architecture

# ARM Architecture

config ARM_SP805_WATCHDOG
	tristate "ARM SP805 Watchdog"
	depends on (ARM || ARM64 || COMPILE_TEST) && ARM_AMBA
	select WATCHDOG_CORE
	help
	  ARM Primecell SP805 Watchdog timer. This will reboot your system when
	  the timeout is reached.

config ARM_SBSA_WATCHDOG
	tristate "ARM SBSA Generic Watchdog"
	depends on ARM64
	depends on ARM_ARCH_TIMER
	select WATCHDOG_CORE
	help
	  ARM SBSA Generic Watchdog has two stage timeouts:
	  the first signal (WS0) is for alerting the system by interrupt,
	  the second one (WS1) is a real hardware reset.
	  More details: ARM DEN0029B - Server Base System Architecture (SBSA)

	  This driver can operate ARM SBSA Generic Watchdog as a single stage
	  or a two stages watchdog, it depends on the module parameter "action".

	  Note: the maximum timeout in the two stages mode is half of that in
	  the single stage mode.

	  To compile this driver as module, choose M here: The module
	  will be called sbsa_gwdt.

config ARMADA_37XX_WATCHDOG
	tristate "Armada 37xx watchdog"
	depends on ARCH_MVEBU || COMPILE_TEST
	depends on HAS_IOMEM
	select MFD_SYSCON
	select WATCHDOG_CORE
	help
	   Say Y here to include support for the watchdog timer found on
	   Marvell Armada 37xx SoCs.
	   To compile this driver as a module, choose M here: the
	   module will be called armada_37xx_wdt.

config ASM9260_WATCHDOG
	tristate "Alphascale ASM9260 watchdog"
	depends on MACH_ASM9260 || COMPILE_TEST
	depends on OF
	select WATCHDOG_CORE
	select RESET_CONTROLLER
	help
	  Watchdog timer embedded into Alphascale asm9260 chips. This will reboot your
	  system when the timeout is reached.

config AT91RM9200_WATCHDOG
	tristate "AT91RM9200 watchdog"
	depends on (SOC_AT91RM9200 && MFD_SYSCON) || COMPILE_TEST
	help
	  Watchdog timer embedded into AT91RM9200 chips. This will reboot your
	  system when the timeout is reached.

config AT91SAM9X_WATCHDOG
	tristate "AT91SAM9X / AT91CAP9 watchdog"
	depends on ARCH_AT91 || COMPILE_TEST
	select WATCHDOG_CORE
	help
	  Watchdog timer embedded into AT91SAM9X and AT91CAP9 chips. This will
	  reboot your system when the timeout is reached.

config SAMA5D4_WATCHDOG
	tristate "Atmel SAMA5D4 Watchdog Timer"
	depends on ARCH_AT91 || COMPILE_TEST
	select WATCHDOG_CORE
	help
	  Atmel SAMA5D4 watchdog timer is embedded into SAMA5D4 chips.
	  Its Watchdog Timer Mode Register can be written more than once.
	  This will reboot your system when the timeout is reached.

config CADENCE_WATCHDOG
	tristate "Cadence Watchdog Timer"
	depends on HAS_IOMEM
	select WATCHDOG_CORE
	help
	  Say Y here if you want to include support for the watchdog
	  timer in the Xilinx Zynq.

config 21285_WATCHDOG
	tristate "DC21285 watchdog"
	depends on FOOTBRIDGE
	help
	  The Intel Footbridge chip contains a built-in watchdog circuit. Say Y
	  here if you wish to use this. Alternatively say M to compile the
	  driver as a module, which will be called wdt285.

	  This driver does not work on all machines. In particular, early CATS
	  boards have hardware problems that will cause the machine to simply
	  lock up if the watchdog fires.

	  "If in doubt, leave it out" - say N.

config 977_WATCHDOG
	tristate "NetWinder WB83C977 watchdog"
	depends on (FOOTBRIDGE && ARCH_NETWINDER) || (ARM && COMPILE_TEST)
	help
	  Say Y here to include support for the WB977 watchdog included in
	  NetWinder machines. Alternatively say M to compile the driver as
	  a module, which will be called wdt977.

	  Not sure? It's safe to say N.

config FTWDT010_WATCHDOG
	tristate "Faraday Technology FTWDT010 watchdog"
	depends on ARM || COMPILE_TEST
	select WATCHDOG_CORE
	default ARCH_GEMINI
	help
	  Say Y here if to include support for the Faraday Technology
	  FTWDT010 watchdog timer embedded in the Cortina Systems Gemini
	  family of devices.

	  To compile this driver as a module, choose M here: the
	  module will be called ftwdt010_wdt.

config IXP4XX_WATCHDOG
	tristate "IXP4xx Watchdog"
	depends on ARCH_IXP4XX
	help
	  Say Y here if to include support for the watchdog timer
	  in the Intel IXP4xx network processors. This driver can
	  be built as a module by choosing M. The module will
	  be called ixp4xx_wdt.

	  Note: The internal IXP4xx watchdog does a soft CPU reset
	  which doesn't reset any peripherals. There are circumstances
	  where the watchdog will fail to reset the board correctly
	  (e.g., if the boot ROM is in an unreadable state).

	  Say N if you are unsure.

config HAVE_S3C2410_WATCHDOG
	bool
	help
	  This will include watchdog timer support for Samsung SoCs. If
	  you want to include watchdog support for any machine, kindly
	  select this in the respective mach-XXXX/Kconfig file.

config S3C2410_WATCHDOG
	tristate "S3C2410 Watchdog"
	depends on HAVE_S3C2410_WATCHDOG || COMPILE_TEST
	select WATCHDOG_CORE
	select MFD_SYSCON if ARCH_EXYNOS
	help
	  Watchdog timer block in the Samsung SoCs. This will reboot
	  the system when the timer expires with the watchdog enabled.

	  The driver is limited by the speed of the system's PCLK
	  signal, so with reasonably fast systems (PCLK around 50-66MHz)
	  then watchdog intervals of over approximately 20seconds are
	  unavailable.

	  The driver can be built as a module by choosing M, and will
	  be called s3c2410_wdt

config SA1100_WATCHDOG
	tristate "SA1100/PXA2xx watchdog"
	depends on ARCH_SA1100 || ARCH_PXA
	help
	  Watchdog timer embedded into SA11x0 and PXA2xx chips. This will
	  reboot your system when timeout is reached.

	  NOTE: once enabled, this timer cannot be disabled.

	  To compile this driver as a module, choose M here: the
	  module will be called sa1100_wdt.

config DW_WATCHDOG
	tristate "Synopsys DesignWare watchdog"
	depends on HAS_IOMEM
	select WATCHDOG_CORE
	help
	  Say Y here if to include support for the Synopsys DesignWare
	  watchdog timer found in many chips.
	  To compile this driver as a module, choose M here: the
	  module will be called dw_wdt.

config EP93XX_WATCHDOG
	tristate "EP93xx Watchdog"
	depends on ARCH_EP93XX || COMPILE_TEST
	select WATCHDOG_CORE
	help
	  Say Y here if to include support for the watchdog timer
	  embedded in the Cirrus Logic EP93xx family of devices.

	  To compile this driver as a module, choose M here: the
	  module will be called ep93xx_wdt.

config OMAP_WATCHDOG
	tristate "OMAP Watchdog"
	depends on ARCH_OMAP16XX || ARCH_OMAP2PLUS || COMPILE_TEST
	select WATCHDOG_CORE
	help
	  Support for TI OMAP1610/OMAP1710/OMAP2420/OMAP3430/OMAP4430 watchdog.  Say 'Y'
	  here to enable the OMAP1610/OMAP1710/OMAP2420/OMAP3430/OMAP4430 watchdog timer.

config PNX4008_WATCHDOG
	tristate "LPC32XX Watchdog"
	depends on ARCH_LPC32XX || COMPILE_TEST
	select WATCHDOG_CORE
	help
	  Say Y here if to include support for the watchdog timer
	  in the LPC32XX processor.
	  This driver can be built as a module by choosing M. The module
	  will be called pnx4008_wdt.

	  Say N if you are unsure.

config IOP_WATCHDOG
	tristate "IOP Watchdog"
	depends on ARCH_IOP13XX
	select WATCHDOG_NOWAYOUT if (ARCH_IOP32X || ARCH_IOP33X)
	help
	  Say Y here if to include support for the watchdog timer
	  in the Intel IOP3XX & IOP13XX I/O Processors.  This driver can
	  be built as a module by choosing M. The module will
	  be called iop_wdt.

	  Note: The IOP13XX watchdog does an Internal Bus Reset which will
	  affect both cores and the peripherals of the IOP.  The ATU-X
	  and/or ATUe configuration registers will remain intact, but if
	  operating as an Root Complex and/or Central Resource, the PCI-X
	  and/or PCIe busses will also be reset.  THIS IS A VERY BIG HAMMER.

config DAVINCI_WATCHDOG
	tristate "DaVinci watchdog"
	depends on ARCH_DAVINCI || ARCH_KEYSTONE || COMPILE_TEST
	select WATCHDOG_CORE
	help
	  Say Y here if to include support for the watchdog timer
	  in the DaVinci DM644x/DM646x or Keystone processors.
	  To compile this driver as a module, choose M here: the
	  module will be called davinci_wdt.

	  NOTE: once enabled, this timer cannot be disabled.
	  Say N if you are unsure.

config ORION_WATCHDOG
	tristate "Orion watchdog"
	depends on ARCH_ORION5X || ARCH_DOVE || MACH_DOVE || ARCH_MVEBU || (COMPILE_TEST && !ARCH_EBSA110)
	depends on ARM
	select WATCHDOG_CORE
	help
	  Say Y here if to include support for the watchdog timer
	  in the Marvell Orion5x and Kirkwood ARM SoCs.
	  To compile this driver as a module, choose M here: the
	  module will be called orion_wdt.

config RN5T618_WATCHDOG
	tristate "Ricoh RN5T618 watchdog"
	depends on MFD_RN5T618 || COMPILE_TEST
	select WATCHDOG_CORE
	help
	  If you say yes here you get support for watchdog on the Ricoh
	  RN5T618 PMIC.

	  This driver can also be built as a module.  If so, the module
	  will be called rn5t618_wdt.

config SUNXI_WATCHDOG
	tristate "Allwinner SoCs watchdog support"
	depends on ARCH_SUNXI || COMPILE_TEST
	select WATCHDOG_CORE
	help
	  Say Y here to include support for the watchdog timer
	  in Allwinner SoCs.
	  To compile this driver as a module, choose M here: the
	  module will be called sunxi_wdt.

config COH901327_WATCHDOG
	bool "ST-Ericsson COH 901 327 watchdog"
	depends on ARCH_U300 || (ARM && COMMON_CLK && COMPILE_TEST)
	default y if MACH_U300
	select WATCHDOG_CORE
	help
	  Say Y here to include Watchdog timer support for the
	  watchdog embedded into the ST-Ericsson U300 series platforms.
	  This watchdog is used to reset the system and thus cannot be
	  compiled as a module.

config NPCM7XX_WATCHDOG
	tristate "Nuvoton NPCM750 watchdog"
	depends on ARCH_NPCM || COMPILE_TEST
	default y if ARCH_NPCM7XX
	select WATCHDOG_CORE
	help
	  Say Y here to include Watchdog timer support for the
	  watchdog embedded into the NPCM7xx.
	  This watchdog is use                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              