aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mfd
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-08-06 00:01:33 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-08-06 00:01:33 -0400
commita157b3aaa44829998d5a079174df989e5d8c20ff (patch)
tree35db2b0e47acebdc666fb58f185c84a219d78606 /include/linux/mfd
parent32199ec3cf8db2de1709cec9339844555b55c16e (diff)
parent53de7c26ded7f5e954bfc202dffc43c0dd165337 (diff)
Merge tag 'pwm/for-4.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm
Pull pwm updates from Thierry Reding: "This set of changes improve some aspects of the atomic API as well as make use of this new API in the regulator framework to allow properly dealing with critical regulators controlled by a PWM. Aside from that there's a bunch of updates and cleanups for existing drivers, as well as the addition of new drivers for the Broadcom iProc, STMPE and ChromeOS EC controllers" * tag 'pwm/for-4.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm: (44 commits) regulator: pwm: Document pwm-dutycycle-unit and pwm-dutycycle-range regulator: pwm: Support extra continuous mode cases pwm: Add ChromeOS EC PWM driver dt-bindings: pwm: Add binding for ChromeOS EC PWM mfd: cros_ec: Add EC_PWM function definitions mfd: cros_ec: Add cros_ec_cmd_xfer_status() helper pwm: atmel: Use of_device_get_match_data() pwm: atmel: Fix checkpatch warnings pwm: atmel: Fix disabling of PWM channels dt-bindings: pwm: Add R-Car H3 device tree bindings pwm: rcar: Use ARCH_RENESAS pwm: tegra: Add support for Tegra186 dt-bindings: pwm: tegra: Add compatible string for Tegra186 pwm: tegra: Avoid overflow when calculating duty cycle pwm: tegra: Allow 100 % duty cycle pwm: tegra: Add support for reset control pwm: tegra: Rename mmio_base to regs pwm: tegra: Remove useless padding pwm: tegra: Drop NUM_PWM macro pwm: lpc32xx: Set PWM_PIN_LEVEL bit to default value ...
Diffstat (limited to 'include/linux/mfd')
-rw-r--r--include/linux/mfd/cros_ec.h15
-rw-r--r--include/linux/mfd/cros_ec_commands.h31
2 files changed, 46 insertions, 0 deletions
diff --git a/include/linux/mfd/cros_ec.h b/include/linux/mfd/cros_ec.h
index 64184d27e3cd..d641a18abacb 100644
--- a/include/linux/mfd/cros_ec.h
+++ b/include/linux/mfd/cros_ec.h
@@ -226,6 +226,21 @@ int cros_ec_cmd_xfer(struct cros_ec_device *ec_dev,
226 struct cros_ec_command *msg); 226 struct cros_ec_command *msg);
227 227
228/** 228/**
229 * cros_ec_cmd_xfer_status - Send a command to the ChromeOS EC
230 *
231 * This function is identical to cros_ec_cmd_xfer, except it returns success
232 * status only if both the command was transmitted successfully and the EC
233 * replied with success status. It's not necessary to check msg->result when
234 * using this function.
235 *
236 * @ec_dev: EC device
237 * @msg: Message to write
238 * @return: Num. of bytes transferred on success, <0 on failure
239 */
240int cros_ec_cmd_xfer_status(struct cros_ec_device *ec_dev,
241 struct cros_ec_command *msg);
242
243/**
229 * cros_ec_remove - Remove a ChromeOS EC 244 * cros_ec_remove - Remove a ChromeOS EC
230 * 245 *
231 * Call this to deregister a ChromeOS EC, then clean up any private data. 246 * Call this to deregister a ChromeOS EC, then clean up any private data.
diff --git a/include/linux/mfd/cros_ec_commands.h b/include/linux/mfd/cros_ec_commands.h
index 13b630c10d4c..7e7a8d4b4551 100644
--- a/include/linux/mfd/cros_ec_commands.h
+++ b/include/linux/mfd/cros_ec_commands.h
@@ -949,6 +949,37 @@ struct ec_params_pwm_set_fan_duty {
949 uint32_t percent; 949 uint32_t percent;
950} __packed; 950} __packed;
951 951
952#define EC_CMD_PWM_SET_DUTY 0x25
953/* 16 bit duty cycle, 0xffff = 100% */
954#define EC_PWM_MAX_DUTY 0xffff
955
956enum ec_pwm_type {
957 /* All types, indexed by board-specific enum pwm_channel */
958 EC_PWM_TYPE_GENERIC = 0,
959 /* Keyboard backlight */
960 EC_PWM_TYPE_KB_LIGHT,
961 /* Display backlight */
962 EC_PWM_TYPE_DISPLAY_LIGHT,
963 EC_PWM_TYPE_COUNT,
964};
965
966struct ec_params_pwm_set_duty {
967 uint16_t duty; /* Duty cycle, EC_PWM_MAX_DUTY = 100% */
968 uint8_t pwm_type; /* ec_pwm_type */
969 uint8_t index; /* Type-specific index, or 0 if unique */
970} __packed;
971
972#define EC_CMD_PWM_GET_DUTY 0x26
973
974struct ec_params_pwm_get_duty {
975 uint8_t pwm_type; /* ec_pwm_type */
976 uint8_t index; /* Type-specific index, or 0 if unique */
977} __packed;
978
979struct ec_response_pwm_get_duty {
980 uint16_t duty; /* Duty cycle, EC_PWM_MAX_DUTY = 100% */
981} __packed;
982
952/*****************************************************************************/ 983/*****************************************************************************/
953/* 984/*
954 * Lightbar commands. This looks worse than it is. Since we only use one HOST 985 * Lightbar commands. This looks worse than it is. Since we only use one HOST