~ubuntu-branches/ubuntu/precise/alsa-driver/precise

« back to all changes in this revision

Viewing changes to alsa-kernel/include/sh_fsi.h

  • Committer: Bazaar Package Importer
  • Author(s): Luke Yelavich
  • Date: 2009-11-04 16:28:58 UTC
  • mfrom: (1.1.12 upstream) (3.1.7 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091104162858-7ky0tu33d7mn6oys
Tags: 1.0.21+dfsg-3ubuntu1
* Merge from debian unstable, remaining changes:
  - Script paths (/usr/sbin -> /sbin, /usr/bin -> /bin);
  - debian/rules:
    + Don't install snddevices and program-wrapper
    + install alsa-base apport hook
    + Package separate USB card list file
  - Vcs and maintainer fields mangling
  - Rename blacklist files in /etc/modprobe.d to be consistant with the rest
    of the distro
  - debian/alsa-base.init:
    + create /var/run/alsa if it doesn't exist
    + Run alsactl store before force unloading modules
    + Run alsactl restore after reloading unloaded modules
  - debian/linux-sound-base.postrm: Remove /etc/modprobe.d/blacklist* files
    on package removal
  - Add missing $CMDLINE_OPTS to all install rules.
  - Replace -Q with --quiet.
  - Add --use-blacklist to all rules so the blacklist still takes effect.
  - debian/alsa-base.postinst: Do not run snddevices
  - retain patches:
    + add_suspend_quirk_hp_nc6220_nw8240.patch,
    + refix_lp_68659_by_disabling_dxs_for_0x1458a002.patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef __SOUND_FSI_H
 
2
#define __SOUND_FSI_H
 
3
 
 
4
/*
 
5
 * Fifo-attached Serial Interface (FSI) support for SH7724
 
6
 *
 
7
 * Copyright (C) 2009 Renesas Solutions Corp.
 
8
 * Kuninori Morimoto <morimoto.kuninori@renesas.com>
 
9
 *
 
10
 * This program is free software; you can redistribute it and/or modify
 
11
 * it under the terms of the GNU General Public License version 2 as
 
12
 * published by the Free Software Foundation.
 
13
 */
 
14
 
 
15
/* flags format
 
16
 
 
17
 * 0xABCDEEFF
 
18
 *
 
19
 * A:  channel size for TDM (input)
 
20
 * B:  channel size for TDM (ooutput)
 
21
 * C:  inversion
 
22
 * D:  mode
 
23
 * E:  input format
 
24
 * F:  output format
 
25
 */
 
26
 
 
27
#include <linux/clk.h>
 
28
#include <sound/soc.h>
 
29
 
 
30
/* TDM channel */
 
31
#define SH_FSI_SET_CH_I(x)      ((x & 0xF) << 28)
 
32
#define SH_FSI_SET_CH_O(x)      ((x & 0xF) << 24)
 
33
 
 
34
#define SH_FSI_CH_IMASK         0xF0000000
 
35
#define SH_FSI_CH_OMASK         0x0F000000
 
36
#define SH_FSI_GET_CH_I(x)      ((x & SH_FSI_CH_IMASK) >> 28)
 
37
#define SH_FSI_GET_CH_O(x)      ((x & SH_FSI_CH_OMASK) >> 24)
 
38
 
 
39
/* clock inversion */
 
40
#define SH_FSI_INVERSION_MASK   0x00F00000
 
41
#define SH_FSI_LRM_INV          (1 << 20)
 
42
#define SH_FSI_BRM_INV          (1 << 21)
 
43
#define SH_FSI_LRS_INV          (1 << 22)
 
44
#define SH_FSI_BRS_INV          (1 << 23)
 
45
 
 
46
/* mode */
 
47
#define SH_FSI_MODE_MASK        0x000F0000
 
48
#define SH_FSI_IN_SLAVE_MODE    (1 << 16)  /* default master mode */
 
49
#define SH_FSI_OUT_SLAVE_MODE   (1 << 17)  /* default master mode */
 
50
 
 
51
/* DI format */
 
52
#define SH_FSI_FMT_MASK         0x000000FF
 
53
#define SH_FSI_IFMT(x)          (((SH_FSI_FMT_ ## x) & SH_FSI_FMT_MASK) << 8)
 
54
#define SH_FSI_OFMT(x)          (((SH_FSI_FMT_ ## x) & SH_FSI_FMT_MASK) << 0)
 
55
#define SH_FSI_GET_IFMT(x)      ((x >> 8) & SH_FSI_FMT_MASK)
 
56
#define SH_FSI_GET_OFMT(x)      ((x >> 0) & SH_FSI_FMT_MASK)
 
57
 
 
58
#define SH_FSI_FMT_MONO         (1 << 0)
 
59
#define SH_FSI_FMT_MONO_DELAY   (1 << 1)
 
60
#define SH_FSI_FMT_PCM          (1 << 2)
 
61
#define SH_FSI_FMT_I2S          (1 << 3)
 
62
#define SH_FSI_FMT_TDM          (1 << 4)
 
63
#define SH_FSI_FMT_TDM_DELAY    (1 << 5)
 
64
 
 
65
#define SH_FSI_IFMT_TDM_CH(x) \
 
66
        (SH_FSI_IFMT(TDM)       | SH_FSI_SET_CH_I(x))
 
67
#define SH_FSI_IFMT_TDM_DELAY_CH(x) \
 
68
        (SH_FSI_IFMT(TDM_DELAY) | SH_FSI_SET_CH_I(x))
 
69
 
 
70
#define SH_FSI_OFMT_TDM_CH(x) \
 
71
        (SH_FSI_OFMT(TDM)       | SH_FSI_SET_CH_O(x))
 
72
#define SH_FSI_OFMT_TDM_DELAY_CH(x) \
 
73
        (SH_FSI_OFMT(TDM_DELAY) | SH_FSI_SET_CH_O(x))
 
74
 
 
75
struct sh_fsi_platform_info {
 
76
        unsigned long porta_flags;
 
77
        unsigned long portb_flags;
 
78
};
 
79
 
 
80
extern struct snd_soc_dai fsi_soc_dai[2];
 
81
extern struct snd_soc_platform fsi_soc_platform;
 
82
 
 
83
#endif /* __SOUND_FSI_H */