![]() |
|
|||
0001 /* SPDX-License-Identifier: GPL-2.0-only */ 0002 /* 0003 * cec-pin.h - low-level CEC pin control 0004 * 0005 * Copyright 2017 Cisco Systems, Inc. and/or its affiliates. All rights reserved. 0006 */ 0007 0008 #ifndef LINUX_CEC_PIN_H 0009 #define LINUX_CEC_PIN_H 0010 0011 #include <linux/types.h> 0012 #include <media/cec.h> 0013 0014 /** 0015 * struct cec_pin_ops - low-level CEC pin operations 0016 * @read: read the CEC pin. Returns > 0 if high, 0 if low, or an error 0017 * if negative. 0018 * @low: drive the CEC pin low. 0019 * @high: stop driving the CEC pin. The pull-up will drive the pin 0020 * high, unless someone else is driving the pin low. 0021 * @enable_irq: optional, enable the interrupt to detect pin voltage changes. 0022 * @disable_irq: optional, disable the interrupt. 0023 * @free: optional. Free any allocated resources. Called when the 0024 * adapter is deleted. 0025 * @status: optional, log status information. 0026 * @read_hpd: optional. Read the HPD pin. Returns > 0 if high, 0 if low or 0027 * an error if negative. 0028 * @read_5v: optional. Read the 5V pin. Returns > 0 if high, 0 if low or 0029 * an error if negative. 0030 * @received: optional. High-level CEC message callback. Allows the driver 0031 * to process CEC messages. 0032 * 0033 * These operations (except for the @received op) are used by the 0034 * cec pin framework to manipulate the CEC pin. 0035 */ 0036 struct cec_pin_ops { 0037 int (*read)(struct cec_adapter *adap); 0038 void (*low)(struct cec_adapter *adap); 0039 void (*high)(struct cec_adapter *adap); 0040 bool (*enable_irq)(struct cec_adapter *adap); 0041 void (*disable_irq)(struct cec_adapter *adap); 0042 void (*free)(struct cec_adapter *adap); 0043 void (*status)(struct cec_adapter *adap, struct seq_file *file); 0044 int (*read_hpd)(struct cec_adapter *adap); 0045 int (*read_5v)(struct cec_adapter *adap); 0046 0047 /* High-level CEC message callback */ 0048 int (*received)(struct cec_adapter *adap, struct cec_msg *msg); 0049 }; 0050 0051 /** 0052 * cec_pin_changed() - update pin state from interrupt 0053 * 0054 * @adap: pointer to the cec adapter 0055 * @value: when true the pin is high, otherwise it is low 0056 * 0057 * If changes of the CEC voltage are detected via an interrupt, then 0058 * cec_pin_changed is called from the interrupt with the new value. 0059 */ 0060 void cec_pin_changed(struct cec_adapter *adap, bool value); 0061 0062 /** 0063 * cec_pin_allocate_adapter() - allocate a pin-based cec adapter 0064 * 0065 * @pin_ops: low-level pin operations 0066 * @priv: will be stored in adap->priv and can be used by the adapter ops. 0067 * Use cec_get_drvdata(adap) to get the priv pointer. 0068 * @name: the name of the CEC adapter. Note: this name will be copied. 0069 * @caps: capabilities of the CEC adapter. This will be ORed with 0070 * CEC_CAP_MONITOR_ALL and CEC_CAP_MONITOR_PIN. 0071 * 0072 * Allocate a cec adapter using the cec pin framework. 0073 * 0074 * Return: a pointer to the cec adapter or an error pointer 0075 */ 0076 struct cec_adapter *cec_pin_allocate_adapter(const struct cec_pin_ops *pin_ops, 0077 void *priv, const char *name, u32 caps); 0078 0079 #endif
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.1.0 LXR engine. The LXR team |
![]() ![]() |