Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f10a4ab0 authored by David Collins's avatar David Collins
Browse files

input: qpnp-power-on: add device tree constants for power on/off types



Add PMIC PON peripheral power-on and power-off types in a device
tree header file.  Use these constants in the qpnp-power-on
driver enums to ensure that device tree and the driver are always
in-sync.  Also update device tree binding documentation to match
what is supported by the driver.

Change-Id: I77f924f846380a3eaf968de6c85a8680ed0ca6ea
Signed-off-by: default avatarDavid Collins <collinsd@codeaurora.org>
parent ad16cf89
Loading
Loading
Loading
Loading
+12 −5
Original line number Diff line number Diff line
@@ -103,9 +103,11 @@ Regulator sub-node required properties:
				controlled.

PON sub-node required properties:
- qcom,pon-type			The type of PON/RESET source. The driver
				currently supports KPDPWR(0), RESIN(1) and
				CBLPWR(2) pon/reset sources.
- qcom,pon-type			The type of PON/RESET source. Supported values:
				0 = KPDPWR
				1 = RESIN
				2 = CBLPWR
				3 = KPDPWR_RESIN

PON sub-node optional properties:
- qcom,pull-up			The initial state of the reset pin under
@@ -140,8 +142,13 @@ property is defined and is set to 1.
				Supported values are:
				- 0, 10, 50, 100, 250, 500, 1000, 2000
- qcom,s2-type			The type of reset associated with this source.
				The supported resets are:
				SOFT(0), WARM(1), SHUTDOWN(4), HARD(7)
				Supported values:
				0 = SOFT_RESET (legacy)
				1 = WARM_RESET
				4 = SHUTDOWN
				5 = DVDD_SHUTDOWN
				7 = HARD_RESET
				8 = DVDD_HARD_RESET

Example:
	qcom,power-on@800 {
+5 −5
Original line number Diff line number Diff line
/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -162,10 +162,10 @@ enum qpnp_pon_version {
};

enum pon_type {
	PON_KPDPWR,
	PON_RESIN,
	PON_CBLPWR,
	PON_KPDPWR_RESIN,
	PON_KPDPWR	 = PON_POWER_ON_TYPE_KPDPWR,
	PON_RESIN	 = PON_POWER_ON_TYPE_RESIN,
	PON_CBLPWR	 = PON_POWER_ON_TYPE_CBLPWR,
	PON_KPDPWR_RESIN = PON_POWER_ON_TYPE_KPDPWR_RESIN,
};

struct qpnp_pon_config {
+30 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#ifndef _DT_BINDINGS_INPUT_QCOM_POWER_ON_H
#define _DT_BINDINGS_INPUT_QCOM_POWER_ON_H

/* PMIC PON peripheral logical power on types: */
#define PON_POWER_ON_TYPE_KPDPWR		0
#define PON_POWER_ON_TYPE_RESIN			1
#define PON_POWER_ON_TYPE_CBLPWR		2
#define PON_POWER_ON_TYPE_KPDPWR_RESIN		3

/* PMIC PON peripheral physical power off types: */
#define PON_POWER_OFF_TYPE_WARM_RESET		0x01
#define PON_POWER_OFF_TYPE_SHUTDOWN		0x04
#define PON_POWER_OFF_TYPE_DVDD_SHUTDOWN	0x05
#define PON_POWER_OFF_TYPE_HARD_RESET		0x07
#define PON_POWER_OFF_TYPE_DVDD_HARD_RESET	0x08

#endif
+6 −4
Original line number Diff line number Diff line
/* Copyright (c) 2012-2015, 2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2015, 2017-2018, The Linux Foundation.
 * All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -13,6 +14,7 @@
#ifndef QPNP_PON_H
#define QPNP_PON_H

#include <dt-bindings/input/qcom,qpnp-power-on.h>
#include <linux/errno.h>

/**
@@ -44,9 +46,9 @@ enum pon_trigger_source {
 */
enum pon_power_off_type {
	PON_POWER_OFF_RESERVED		= 0x00,
	PON_POWER_OFF_WARM_RESET	= 0x01,
	PON_POWER_OFF_SHUTDOWN		= 0x04,
	PON_POWER_OFF_HARD_RESET	= 0x07,
	PON_POWER_OFF_WARM_RESET	= PON_POWER_OFF_TYPE_WARM_RESET,
	PON_POWER_OFF_SHUTDOWN		= PON_POWER_OFF_TYPE_SHUTDOWN,
	PON_POWER_OFF_HARD_RESET	= PON_POWER_OFF_TYPE_HARD_RESET,
	PON_POWER_OFF_MAX_TYPE		= 0x10,
};