~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/media/cec-pin.h

Version: ~ [ linux-5.10-rc5 ] ~ [ linux-5.9.10 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.79 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.159 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.208 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.245 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.245 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.85 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-only */
  2 /*
  3  * cec-pin.h - low-level CEC pin control
  4  *
  5  * Copyright 2017 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  6  */
  7 
  8 #ifndef LINUX_CEC_PIN_H
  9 #define LINUX_CEC_PIN_H
 10 
 11 #include <linux/types.h>
 12 #include <media/cec.h>
 13 
 14 /**
 15  * struct cec_pin_ops - low-level CEC pin operations
 16  * @read:       read the CEC pin. Return true if high, false if low.
 17  * @low:        drive the CEC pin low.
 18  * @high:       stop driving the CEC pin. The pull-up will drive the pin
 19  *              high, unless someone else is driving the pin low.
 20  * @enable_irq: optional, enable the interrupt to detect pin voltage changes.
 21  * @disable_irq: optional, disable the interrupt.
 22  * @free:       optional. Free any allocated resources. Called when the
 23  *              adapter is deleted.
 24  * @status:     optional, log status information.
 25  * @read_hpd:   read the HPD pin. Return true if high, false if low or
 26  *              an error if negative. If NULL or -ENOTTY is returned,
 27  *              then this is not supported.
 28  * @read_5v:    read the 5V pin. Return true if high, false if low or
 29  *              an error if negative. If NULL or -ENOTTY is returned,
 30  *              then this is not supported.
 31  *
 32  * These operations are used by the cec pin framework to manipulate
 33  * the CEC pin.
 34  */
 35 struct cec_pin_ops {
 36         bool (*read)(struct cec_adapter *adap);
 37         void (*low)(struct cec_adapter *adap);
 38         void (*high)(struct cec_adapter *adap);
 39         bool (*enable_irq)(struct cec_adapter *adap);
 40         void (*disable_irq)(struct cec_adapter *adap);
 41         void (*free)(struct cec_adapter *adap);
 42         void (*status)(struct cec_adapter *adap, struct seq_file *file);
 43         int  (*read_hpd)(struct cec_adapter *adap);
 44         int  (*read_5v)(struct cec_adapter *adap);
 45 };
 46 
 47 /**
 48  * cec_pin_changed() - update pin state from interrupt
 49  *
 50  * @adap:       pointer to the cec adapter
 51  * @value:      when true the pin is high, otherwise it is low
 52  *
 53  * If changes of the CEC voltage are detected via an interrupt, then
 54  * cec_pin_changed is called from the interrupt with the new value.
 55  */
 56 void cec_pin_changed(struct cec_adapter *adap, bool value);
 57 
 58 /**
 59  * cec_pin_allocate_adapter() - allocate a pin-based cec adapter
 60  *
 61  * @pin_ops:    low-level pin operations
 62  * @priv:       will be stored in adap->priv and can be used by the adapter ops.
 63  *              Use cec_get_drvdata(adap) to get the priv pointer.
 64  * @name:       the name of the CEC adapter. Note: this name will be copied.
 65  * @caps:       capabilities of the CEC adapter. This will be ORed with
 66  *              CEC_CAP_MONITOR_ALL and CEC_CAP_MONITOR_PIN.
 67  *
 68  * Allocate a cec adapter using the cec pin framework.
 69  *
 70  * Return: a pointer to the cec adapter or an error pointer
 71  */
 72 struct cec_adapter *cec_pin_allocate_adapter(const struct cec_pin_ops *pin_ops,
 73                                         void *priv, const char *name, u32 caps);
 74 
 75 #endif
 76 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp