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

TOMOYO Linux Cross Reference
Linux/sound/aoa/soundbus/i2sbus/i2sbus.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  * i2sbus driver -- private definitions
  4  *
  5  * Copyright 2006 Johannes Berg <johannes@sipsolutions.net>
  6  */
  7 #ifndef __I2SBUS_H
  8 #define __I2SBUS_H
  9 #include <linux/interrupt.h>
 10 #include <linux/spinlock.h>
 11 #include <linux/mutex.h>
 12 #include <linux/completion.h>
 13 
 14 #include <sound/pcm.h>
 15 
 16 #include <asm/pmac_feature.h>
 17 #include <asm/dbdma.h>
 18 
 19 #include "interface.h"
 20 #include "../soundbus.h"
 21 
 22 struct i2sbus_control {
 23         struct list_head list;
 24         struct macio_chip *macio;
 25 };
 26 
 27 #define MAX_DBDMA_COMMANDS      32
 28 
 29 struct dbdma_command_mem {
 30         dma_addr_t bus_addr;
 31         dma_addr_t bus_cmd_start;
 32         struct dbdma_cmd *cmds;
 33         void *space;
 34         int size;
 35         u32 running:1;
 36         u32 stopping:1;
 37 };
 38 
 39 struct pcm_info {
 40         u32 created:1, /* has this direction been created with alsa? */
 41             active:1;  /* is this stream active? */
 42         /* runtime information */
 43         struct snd_pcm_substream *substream;
 44         int current_period;
 45         u32 frame_count;
 46         struct dbdma_command_mem dbdma_ring;
 47         volatile struct dbdma_regs __iomem *dbdma;
 48         struct completion *stop_completion;
 49 };
 50 
 51 enum {
 52         aoa_resource_i2smmio = 0,
 53         aoa_resource_txdbdma,
 54         aoa_resource_rxdbdma,
 55 };
 56 
 57 struct i2sbus_dev {
 58         struct soundbus_dev sound;
 59         struct macio_dev *macio;
 60         struct i2sbus_control *control;
 61         volatile struct i2s_interface_regs __iomem *intfregs;
 62 
 63         struct resource resources[3];
 64         struct resource *allocated_resource[3];
 65         int interrupts[3];
 66         char rnames[3][32];
 67 
 68         /* info about currently active substreams */
 69         struct pcm_info out, in;
 70         snd_pcm_format_t format;
 71         unsigned int rate;
 72 
 73         /* list for a single controller */
 74         struct list_head item;
 75         /* number of bus on controller */
 76         int bus_number;
 77         /* for use by control layer */
 78         struct pmf_function *enable,
 79                             *cell_enable,
 80                             *cell_disable,
 81                             *clock_enable,
 82                             *clock_disable;
 83 
 84         /* locks */
 85         /* spinlock for low-level interrupt locking */
 86         spinlock_t low_lock;
 87         /* mutex for high-level consistency */
 88         struct mutex lock;
 89 };
 90 
 91 #define soundbus_dev_to_i2sbus_dev(sdev) \
 92                 container_of(sdev, struct i2sbus_dev, sound)
 93 
 94 /* pcm specific functions */
 95 extern int
 96 i2sbus_attach_codec(struct soundbus_dev *dev, struct snd_card *card,
 97                     struct codec_info *ci, void *data);
 98 extern void
 99 i2sbus_detach_codec(struct soundbus_dev *dev, void *data);
100 extern irqreturn_t
101 i2sbus_tx_intr(int irq, void *devid);
102 extern irqreturn_t
103 i2sbus_rx_intr(int irq, void *devid);
104 
105 extern void i2sbus_wait_for_stop_both(struct i2sbus_dev *i2sdev);
106 extern void i2sbus_pcm_prepare_both(struct i2sbus_dev *i2sdev);
107 
108 /* control specific functions */
109 extern int i2sbus_control_init(struct macio_dev* dev,
110                                struct i2sbus_control **c);
111 extern void i2sbus_control_destroy(struct i2sbus_control *c);
112 extern int i2sbus_control_add_dev(struct i2sbus_control *c,
113                                   struct i2sbus_dev *i2sdev);
114 extern void i2sbus_control_remove_dev(struct i2sbus_control *c,
115                                       struct i2sbus_dev *i2sdev);
116 extern int i2sbus_control_enable(struct i2sbus_control *c,
117                                  struct i2sbus_dev *i2sdev);
118 extern int i2sbus_control_cell(struct i2sbus_control *c,
119                                struct i2sbus_dev *i2sdev,
120                                int enable);
121 extern int i2sbus_control_clock(struct i2sbus_control *c,
122                                 struct i2sbus_dev *i2sdev,
123                                 int enable);
124 #endif /* __I2SBUS_H */
125 

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