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

TOMOYO Linux Cross Reference
Linux/include/linux/mfd/dln2.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/mfd/dln2.h (Version linux-6.12-rc7) and /include/linux/mfd/dln2.h (Version linux-5.18.19)


  1 /* SPDX-License-Identifier: GPL-2.0 */              1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef __LINUX_USB_DLN2_H                          2 #ifndef __LINUX_USB_DLN2_H
  3 #define __LINUX_USB_DLN2_H                          3 #define __LINUX_USB_DLN2_H
  4                                                     4 
  5 #define DLN2_CMD(cmd, id)               ((cmd)      5 #define DLN2_CMD(cmd, id)               ((cmd) | ((id) << 8))
  6                                                     6 
  7 struct dln2_platform_data {                         7 struct dln2_platform_data {
  8         u16 handle;             /* sub-driver       8         u16 handle;             /* sub-driver handle (internally used only) */
  9         u8 port;                /* I2C/SPI por      9         u8 port;                /* I2C/SPI port */
 10 };                                                 10 };
 11                                                    11 
 12 /**                                                12 /**
 13  * dln2_event_cb_t - event callback function s     13  * dln2_event_cb_t - event callback function signature
 14  *                                                 14  *
 15  * @pdev - the sub-device that registered this     15  * @pdev - the sub-device that registered this callback
 16  * @echo - the echo header field received in t     16  * @echo - the echo header field received in the message
 17  * @data - the data payload                        17  * @data - the data payload
 18  * @len  - the data payload length                 18  * @len  - the data payload length
 19  *                                                 19  *
 20  * The callback function is called in interrup     20  * The callback function is called in interrupt context and the data payload is
 21  * only valid during the call. If the user nee     21  * only valid during the call. If the user needs later access of the data, it
 22  * must copy it.                                   22  * must copy it.
 23  */                                                23  */
 24                                                    24 
 25 typedef void (*dln2_event_cb_t)(struct platfor     25 typedef void (*dln2_event_cb_t)(struct platform_device *pdev, u16 echo,
 26                                 const void *da     26                                 const void *data, int len);
 27                                                    27 
 28 /**                                                28 /**
 29  * dl2n_register_event_cb - register a callbac     29  * dl2n_register_event_cb - register a callback function for an event
 30  *                                                 30  *
 31  * @pdev - the sub-device that registers the c     31  * @pdev - the sub-device that registers the callback
 32  * @event - the event for which to register a      32  * @event - the event for which to register a callback
 33  * @event_cb - the callback function               33  * @event_cb - the callback function
 34  *                                                 34  *
 35  * @return 0 in case of success, negative valu     35  * @return 0 in case of success, negative value in case of error
 36  */                                                36  */
 37 int dln2_register_event_cb(struct platform_dev     37 int dln2_register_event_cb(struct platform_device *pdev, u16 event,
 38                            dln2_event_cb_t eve     38                            dln2_event_cb_t event_cb);
 39                                                    39 
 40 /**                                                40 /**
 41  * dln2_unregister_event_cb - unregister the c     41  * dln2_unregister_event_cb - unregister the callback function for an event
 42  *                                                 42  *
 43  * @pdev - the sub-device that registered the      43  * @pdev - the sub-device that registered the callback
 44  * @event - the event for which to register a      44  * @event - the event for which to register a callback
 45  */                                                45  */
 46 void dln2_unregister_event_cb(struct platform_     46 void dln2_unregister_event_cb(struct platform_device *pdev, u16 event);
 47                                                    47 
 48 /**                                                48 /**
 49  * dln2_transfer - issue a DLN2 command and wa     49  * dln2_transfer - issue a DLN2 command and wait for a response and the
 50  * associated data                                 50  * associated data
 51  *                                                 51  *
 52  * @pdev - the sub-device which is issuing thi     52  * @pdev - the sub-device which is issuing this transfer
 53  * @cmd - the command to be sent to the device     53  * @cmd - the command to be sent to the device
 54  * @obuf - the buffer to be sent to the device     54  * @obuf - the buffer to be sent to the device; it can be NULL if the user
 55  *      doesn't need to transmit data with thi     55  *      doesn't need to transmit data with this command
 56  * @obuf_len - the size of the buffer to be se     56  * @obuf_len - the size of the buffer to be sent to the device
 57  * @ibuf - any data associated with the respon     57  * @ibuf - any data associated with the response will be copied here; it can be
 58  *      NULL if the user doesn't need the resp     58  *      NULL if the user doesn't need the response data
 59  * @ibuf_len - must be initialized to the inpu     59  * @ibuf_len - must be initialized to the input buffer size; it will be modified
 60  *      to indicate the actual data transferre     60  *      to indicate the actual data transferred;
 61  *                                                 61  *
 62  * @return 0 for success, negative value for e     62  * @return 0 for success, negative value for errors
 63  */                                                63  */
 64 int dln2_transfer(struct platform_device *pdev     64 int dln2_transfer(struct platform_device *pdev, u16 cmd,
 65                   const void *obuf, unsigned o     65                   const void *obuf, unsigned obuf_len,
 66                   void *ibuf, unsigned *ibuf_l     66                   void *ibuf, unsigned *ibuf_len);
 67                                                    67 
 68 /**                                                68 /**
 69  * dln2_transfer_rx - variant of @dln2_transfe     69  * dln2_transfer_rx - variant of @dln2_transfer() where TX buffer is not needed
 70  *                                                 70  *
 71  * @pdev - the sub-device which is issuing thi     71  * @pdev - the sub-device which is issuing this transfer
 72  * @cmd - the command to be sent to the device     72  * @cmd - the command to be sent to the device
 73  * @ibuf - any data associated with the respon     73  * @ibuf - any data associated with the response will be copied here; it can be
 74  *      NULL if the user doesn't need the resp     74  *      NULL if the user doesn't need the response data
 75  * @ibuf_len - must be initialized to the inpu     75  * @ibuf_len - must be initialized to the input buffer size; it will be modified
 76  *      to indicate the actual data transferre     76  *      to indicate the actual data transferred;
 77  *                                                 77  *
 78  * @return 0 for success, negative value for e     78  * @return 0 for success, negative value for errors
 79  */                                                79  */
 80                                                    80 
 81 static inline int dln2_transfer_rx(struct plat     81 static inline int dln2_transfer_rx(struct platform_device *pdev, u16 cmd,
 82                                    void *ibuf,     82                                    void *ibuf, unsigned *ibuf_len)
 83 {                                                  83 {
 84         return dln2_transfer(pdev, cmd, NULL,      84         return dln2_transfer(pdev, cmd, NULL, 0, ibuf, ibuf_len);
 85 }                                                  85 }
 86                                                    86 
 87 /**                                                87 /**
 88  * dln2_transfer_tx - variant of @dln2_transfe     88  * dln2_transfer_tx - variant of @dln2_transfer() where RX buffer is not needed
 89  *                                                 89  *
 90  * @pdev - the sub-device which is issuing thi     90  * @pdev - the sub-device which is issuing this transfer
 91  * @cmd - the command to be sent to the device     91  * @cmd - the command to be sent to the device
 92  * @obuf - the buffer to be sent to the device     92  * @obuf - the buffer to be sent to the device; it can be NULL if the
 93  *      user doesn't need to transmit data wit     93  *      user doesn't need to transmit data with this command
 94  * @obuf_len - the size of the buffer to be se     94  * @obuf_len - the size of the buffer to be sent to the device
 95  *                                                 95  *
 96  * @return 0 for success, negative value for e     96  * @return 0 for success, negative value for errors
 97  */                                                97  */
 98 static inline int dln2_transfer_tx(struct plat     98 static inline int dln2_transfer_tx(struct platform_device *pdev, u16 cmd,
 99                                    const void      99                                    const void *obuf, unsigned obuf_len)
100 {                                                 100 {
101         return dln2_transfer(pdev, cmd, obuf,     101         return dln2_transfer(pdev, cmd, obuf, obuf_len, NULL, NULL);
102 }                                                 102 }
103                                                   103 
104 #endif                                            104 #endif
105                                                   105 

~ [ 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