diff options
author | Lee Jones <lee@kernel.org> | 2024-03-07 08:47:13 +0000 |
---|---|---|
committer | Lee Jones <lee@kernel.org> | 2024-03-07 08:47:13 +0000 |
commit | 888cd6e721558a818f9900a98744088f5fca3f5c (patch) | |
tree | 0eabb137032db8aa2bd5e7b0349e87ee230279ac /include | |
parent | 5b2dd77be1d85ac3a8be3749f5605bf0830e2998 (diff) | |
parent | 7774f3d1dd3822e938e236df67766436c0debd11 (diff) | |
download | linux-stable-888cd6e721558a818f9900a98744088f5fca3f5c.tar.gz linux-stable-888cd6e721558a818f9900a98744088f5fca3f5c.tar.bz2 linux-stable-888cd6e721558a818f9900a98744088f5fca3f5c.zip |
Merge branches 'ib-qcom-leds-6.9' and 'ib-leds-backlight-6.9' into ibs-for-leds-merged
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/leds-expresswire.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/include/linux/leds-expresswire.h b/include/linux/leds-expresswire.h new file mode 100644 index 000000000000..a422921f4159 --- /dev/null +++ b/include/linux/leds-expresswire.h @@ -0,0 +1,38 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Shared library for Kinetic's ExpressWire protocol. + * This protocol works by pulsing the ExpressWire IC's control GPIO. + * ktd2692 and ktd2801 are known to use this protocol. + */ + +#ifndef _LEDS_EXPRESSWIRE_H +#define _LEDS_EXPRESSWIRE_H + +#include <linux/types.h> + +struct gpio_desc; + +struct expresswire_timing { + unsigned long poweroff_us; + unsigned long detect_delay_us; + unsigned long detect_us; + unsigned long data_start_us; + unsigned long end_of_data_low_us; + unsigned long end_of_data_high_us; + unsigned long short_bitset_us; + unsigned long long_bitset_us; +}; + +struct expresswire_common_props { + struct gpio_desc *ctrl_gpio; + struct expresswire_timing timing; +}; + +void expresswire_power_off(struct expresswire_common_props *props); +void expresswire_enable(struct expresswire_common_props *props); +void expresswire_start(struct expresswire_common_props *props); +void expresswire_end(struct expresswire_common_props *props); +void expresswire_set_bit(struct expresswire_common_props *props, bool bit); +void expresswire_write_u8(struct expresswire_common_props *props, u8 val); + +#endif /* _LEDS_EXPRESSWIRE_H */ |