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

TOMOYO Linux Cross Reference
Linux/include/soc/tegra/ivc.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ 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.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-only */
  2 /*
  3  * Copyright (c) 2016, NVIDIA CORPORATION.  All rights reserved.
  4  */
  5 
  6 #ifndef __TEGRA_IVC_H
  7 #define __TEGRA_IVC_H
  8 
  9 #include <linux/device.h>
 10 #include <linux/dma-mapping.h>
 11 #include <linux/iosys-map.h>
 12 #include <linux/types.h>
 13 
 14 struct tegra_ivc_header;
 15 
 16 struct tegra_ivc {
 17         struct device *peer;
 18 
 19         struct {
 20                 struct iosys_map map;
 21                 unsigned int position;
 22                 dma_addr_t phys;
 23         } rx, tx;
 24 
 25         void (*notify)(struct tegra_ivc *ivc, void *data);
 26         void *notify_data;
 27 
 28         unsigned int num_frames;
 29         size_t frame_size;
 30 };
 31 
 32 /**
 33  * tegra_ivc_read_get_next_frame - Peek at the next frame to receive
 34  * @ivc         pointer of the IVC channel
 35  *
 36  * Peek at the next frame to be received, without removing it from
 37  * the queue.
 38  *
 39  * Returns a pointer to the frame, or an error encoded pointer.
 40  */
 41 int tegra_ivc_read_get_next_frame(struct tegra_ivc *ivc, struct iosys_map *map);
 42 
 43 /**
 44  * tegra_ivc_read_advance - Advance the read queue
 45  * @ivc         pointer of the IVC channel
 46  *
 47  * Advance the read queue
 48  *
 49  * Returns 0, or a negative error value if failed.
 50  */
 51 int tegra_ivc_read_advance(struct tegra_ivc *ivc);
 52 
 53 /**
 54  * tegra_ivc_write_get_next_frame - Poke at the next frame to transmit
 55  * @ivc         pointer of the IVC channel
 56  *
 57  * Get access to the next frame.
 58  *
 59  * Returns a pointer to the frame, or an error encoded pointer.
 60  */
 61 int tegra_ivc_write_get_next_frame(struct tegra_ivc *ivc, struct iosys_map *map);
 62 
 63 /**
 64  * tegra_ivc_write_advance - Advance the write queue
 65  * @ivc         pointer of the IVC channel
 66  *
 67  * Advance the write queue
 68  *
 69  * Returns 0, or a negative error value if failed.
 70  */
 71 int tegra_ivc_write_advance(struct tegra_ivc *ivc);
 72 
 73 /**
 74  * tegra_ivc_notified - handle internal messages
 75  * @ivc         pointer of the IVC channel
 76  *
 77  * This function must be called following every notification.
 78  *
 79  * Returns 0 if the channel is ready for communication, or -EAGAIN if a channel
 80  * reset is in progress.
 81  */
 82 int tegra_ivc_notified(struct tegra_ivc *ivc);
 83 
 84 /**
 85  * tegra_ivc_reset - initiates a reset of the shared memory state
 86  * @ivc         pointer of the IVC channel
 87  *
 88  * This function must be called after a channel is reserved before it is used
 89  * for communication. The channel will be ready for use when a subsequent call
 90  * to notify the remote of the channel reset.
 91  */
 92 void tegra_ivc_reset(struct tegra_ivc *ivc);
 93 
 94 size_t tegra_ivc_align(size_t size);
 95 unsigned tegra_ivc_total_queue_size(unsigned queue_size);
 96 int tegra_ivc_init(struct tegra_ivc *ivc, struct device *peer, const struct iosys_map *rx,
 97                    dma_addr_t rx_phys, const struct iosys_map *tx, dma_addr_t tx_phys,
 98                    unsigned int num_frames, size_t frame_size,
 99                    void (*notify)(struct tegra_ivc *ivc, void *data),
100                    void *data);
101 void tegra_ivc_cleanup(struct tegra_ivc *ivc);
102 
103 #endif /* __TEGRA_IVC_H */
104 

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