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

TOMOYO Linux Cross Reference
Linux/include/linux/usb/ljca.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ 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.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /include/linux/usb/ljca.h (Architecture m68k) and /include/linux/usb/ljca.h (Architecture sparc)


  1 /* SPDX-License-Identifier: GPL-2.0-only */         1 /* SPDX-License-Identifier: GPL-2.0-only */
  2 /*                                                  2 /*
  3  * Copyright (c) 2023, Intel Corporation. All       3  * Copyright (c) 2023, Intel Corporation. All rights reserved.
  4  */                                                 4  */
  5 #ifndef _LINUX_USB_LJCA_H_                          5 #ifndef _LINUX_USB_LJCA_H_
  6 #define _LINUX_USB_LJCA_H_                          6 #define _LINUX_USB_LJCA_H_
  7                                                     7 
  8 #include <linux/auxiliary_bus.h>                    8 #include <linux/auxiliary_bus.h>
  9 #include <linux/list.h>                             9 #include <linux/list.h>
 10 #include <linux/spinlock.h>                        10 #include <linux/spinlock.h>
 11 #include <linux/types.h>                           11 #include <linux/types.h>
 12                                                    12 
 13 #define LJCA_MAX_GPIO_NUM 64                       13 #define LJCA_MAX_GPIO_NUM 64
 14                                                    14 
 15 #define auxiliary_dev_to_ljca_client(auxiliary     15 #define auxiliary_dev_to_ljca_client(auxiliary_dev)                     \
 16                 container_of(auxiliary_dev, st     16                 container_of(auxiliary_dev, struct ljca_client, auxdev)
 17                                                    17 
 18 struct ljca_adapter;                               18 struct ljca_adapter;
 19                                                    19 
 20 /**                                                20 /**
 21  * typedef ljca_event_cb_t - event callback fu     21  * typedef ljca_event_cb_t - event callback function signature
 22  *                                                 22  *
 23  * @context: the execution context of who regi     23  * @context: the execution context of who registered this callback
 24  * @cmd: the command from device for this even     24  * @cmd: the command from device for this event
 25  * @evt_data: the event data payload               25  * @evt_data: the event data payload
 26  * @len: the event data payload length             26  * @len: the event data payload length
 27  *                                                 27  *
 28  * The callback function is called in interrup     28  * The callback function is called in interrupt context and the data payload is
 29  * only valid during the call. If the user nee     29  * only valid during the call. If the user needs later access of the data, it
 30  * must copy it.                                   30  * must copy it.
 31  */                                                31  */
 32 typedef void (*ljca_event_cb_t)(void *context,     32 typedef void (*ljca_event_cb_t)(void *context, u8 cmd, const void *evt_data, int len);
 33                                                    33 
 34 /**                                                34 /**
 35  * struct ljca_client - represent a ljca clien     35  * struct ljca_client - represent a ljca client device
 36  *                                                 36  *
 37  * @type: ljca client type                         37  * @type: ljca client type
 38  * @id: ljca client id within same client type     38  * @id: ljca client id within same client type
 39  * @link: ljca client on the same ljca adapter     39  * @link: ljca client on the same ljca adapter
 40  * @auxdev: auxiliary device object                40  * @auxdev: auxiliary device object
 41  * @adapter: ljca adapter the ljca client sit      41  * @adapter: ljca adapter the ljca client sit on
 42  * @context: the execution context of the even     42  * @context: the execution context of the event callback
 43  * @event_cb: ljca client driver register this     43  * @event_cb: ljca client driver register this callback to get
 44  *      firmware asynchronous rx buffer pendin     44  *      firmware asynchronous rx buffer pending notifications
 45  * @event_cb_lock: spinlock to protect event c     45  * @event_cb_lock: spinlock to protect event callback
 46  */                                                46  */
 47 struct ljca_client {                               47 struct ljca_client {
 48         u8 type;                                   48         u8 type;
 49         u8 id;                                     49         u8 id;
 50         struct list_head link;                     50         struct list_head link;
 51         struct auxiliary_device auxdev;            51         struct auxiliary_device auxdev;
 52         struct ljca_adapter *adapter;              52         struct ljca_adapter *adapter;
 53                                                    53 
 54         void *context;                             54         void *context;
 55         ljca_event_cb_t event_cb;                  55         ljca_event_cb_t event_cb;
 56         /* lock to protect event_cb */             56         /* lock to protect event_cb */
 57         spinlock_t event_cb_lock;                  57         spinlock_t event_cb_lock;
 58 };                                                 58 };
 59                                                    59 
 60 /**                                                60 /**
 61  * struct ljca_gpio_info - ljca gpio client de     61  * struct ljca_gpio_info - ljca gpio client device info
 62  *                                                 62  *
 63  * @num: ljca gpio client device pin number        63  * @num: ljca gpio client device pin number
 64  * @valid_pin_map: ljca gpio client device val     64  * @valid_pin_map: ljca gpio client device valid pin mapping
 65  */                                                65  */
 66 struct ljca_gpio_info {                            66 struct ljca_gpio_info {
 67         unsigned int num;                          67         unsigned int num;
 68         DECLARE_BITMAP(valid_pin_map, LJCA_MAX     68         DECLARE_BITMAP(valid_pin_map, LJCA_MAX_GPIO_NUM);
 69 };                                                 69 };
 70                                                    70 
 71 /**                                                71 /**
 72  * struct ljca_i2c_info - ljca i2c client devi     72  * struct ljca_i2c_info - ljca i2c client device info
 73  *                                                 73  *
 74  * @id: ljca i2c client device identification      74  * @id: ljca i2c client device identification number
 75  * @capacity: ljca i2c client device capacity      75  * @capacity: ljca i2c client device capacity
 76  * @intr_pin: ljca i2c client device interrupt     76  * @intr_pin: ljca i2c client device interrupt pin number if exists
 77  */                                                77  */
 78 struct ljca_i2c_info {                             78 struct ljca_i2c_info {
 79         u8 id;                                     79         u8 id;
 80         u8 capacity;                               80         u8 capacity;
 81         u8 intr_pin;                               81         u8 intr_pin;
 82 };                                                 82 };
 83                                                    83 
 84 /**                                                84 /**
 85  * struct ljca_spi_info - ljca spi client devi     85  * struct ljca_spi_info - ljca spi client device info
 86  *                                                 86  *
 87  * @id: ljca spi client device identification      87  * @id: ljca spi client device identification number
 88  * @capacity: ljca spi client device capacity      88  * @capacity: ljca spi client device capacity
 89  */                                                89  */
 90 struct ljca_spi_info {                             90 struct ljca_spi_info {
 91         u8 id;                                     91         u8 id;
 92         u8 capacity;                               92         u8 capacity;
 93 };                                                 93 };
 94                                                    94 
 95 /**                                                95 /**
 96  * ljca_register_event_cb - register a callbac     96  * ljca_register_event_cb - register a callback function to receive events
 97  *                                                 97  *
 98  * @client: ljca client device                     98  * @client: ljca client device
 99  * @event_cb: callback function                    99  * @event_cb: callback function
100  * @context: execution context of event callba    100  * @context: execution context of event callback
101  *                                                101  *
102  * Return: 0 in case of success, negative valu    102  * Return: 0 in case of success, negative value in case of error
103  */                                               103  */
104 int ljca_register_event_cb(struct ljca_client     104 int ljca_register_event_cb(struct ljca_client *client, ljca_event_cb_t event_cb, void *context);
105                                                   105 
106 /**                                               106 /**
107  * ljca_unregister_event_cb - unregister the c    107  * ljca_unregister_event_cb - unregister the callback function for an event
108  *                                                108  *
109  * @client: ljca client device                    109  * @client: ljca client device
110  */                                               110  */
111 void ljca_unregister_event_cb(struct ljca_clie    111 void ljca_unregister_event_cb(struct ljca_client *client);
112                                                   112 
113 /**                                               113 /**
114  * ljca_transfer - issue a LJCA command and wa    114  * ljca_transfer - issue a LJCA command and wait for a response
115  *                                                115  *
116  * @client: ljca client device                    116  * @client: ljca client device
117  * @cmd: the command to be sent to the device     117  * @cmd: the command to be sent to the device
118  * @obuf: the buffer to be sent to the device;    118  * @obuf: the buffer to be sent to the device; it can be NULL if the user
119  *      doesn't need to transmit data with thi    119  *      doesn't need to transmit data with this command
120  * @obuf_len: the size of the buffer to be sen    120  * @obuf_len: the size of the buffer to be sent to the device; it should
121  *      be 0 when obuf is NULL                    121  *      be 0 when obuf is NULL
122  * @ibuf: any data associated with the respons    122  * @ibuf: any data associated with the response will be copied here; it can be
123  *      NULL if the user doesn't need the resp    123  *      NULL if the user doesn't need the response data
124  * @ibuf_len: must be initialized to the input    124  * @ibuf_len: must be initialized to the input buffer size
125  *                                                125  *
126  * Return: the actual length of response data     126  * Return: the actual length of response data for success, negative value for errors
127  */                                               127  */
128 int ljca_transfer(struct ljca_client *client,     128 int ljca_transfer(struct ljca_client *client, u8 cmd, const u8 *obuf,
129                   u8 obuf_len, u8 *ibuf, u8 ib    129                   u8 obuf_len, u8 *ibuf, u8 ibuf_len);
130                                                   130 
131 /**                                               131 /**
132  * ljca_transfer_noack - issue a LJCA command     132  * ljca_transfer_noack - issue a LJCA command without a response
133  *                                                133  *
134  * @client: ljca client device                    134  * @client: ljca client device
135  * @cmd: the command to be sent to the device     135  * @cmd: the command to be sent to the device
136  * @obuf: the buffer to be sent to the device;    136  * @obuf: the buffer to be sent to the device; it can be NULL if the user
137  *      doesn't need to transmit data with thi    137  *      doesn't need to transmit data with this command
138  * @obuf_len: the size of the buffer to be sen    138  * @obuf_len: the size of the buffer to be sent to the device
139  *                                                139  *
140  * Return: 0 for success, negative value for e    140  * Return: 0 for success, negative value for errors
141  */                                               141  */
142 int ljca_transfer_noack(struct ljca_client *cl    142 int ljca_transfer_noack(struct ljca_client *client, u8 cmd, const u8 *obuf,
143                         u8 obuf_len);             143                         u8 obuf_len);
144                                                   144 
145 #endif                                            145 #endif
146                                                   146 

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

kernel.org | git.kernel.org | LWN.net | Project Home | 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.

sflogo.php