1. 14 12月, 2010 1 次提交
  2. 13 12月, 2010 1 次提交
  3. 08 12月, 2010 1 次提交
  4. 07 12月, 2010 5 次提交
  5. 06 12月, 2010 3 次提交
  6. 04 12月, 2010 5 次提交
  7. 03 12月, 2010 3 次提交
  8. 01 12月, 2010 1 次提交
  9. 30 11月, 2010 1 次提交
    • J
      ASoC: Add support for optional auxiliary dailess codecs · 2eea392d
      Jarkko Nikula 提交于
      This makes possible to register auxiliary dailess codecs in a machine
      driver. Term dailess is used here for amplifiers and codecs without DAI or
      DAI being unused.
      
      Dailess auxiliary codecs are kept in struct snd_soc_aux_dev and those codecs
      are probed after initializing the DAI links. There are no major differences
      between DAI link codecs and dailess codecs in ASoC core point of view. DAPM
      handles them equally and sysfs and debugfs directories for dailess codecs
      are similar except the pmdown_time node is not created.
      
      Only suspend and resume functions are modified to traverse all probed codecs
      instead of DAI link codecs.
      
      Example below shows a dailess codec registration.
      
      struct snd_soc_aux_dev foo_aux_dev[] = {
      	{
      		.name = "Amp",
      		.codec_name = "codec.2",
      		.init = foo_init2,
      	},
      };
      
      static struct snd_soc_card card = {
      	...
      	.aux_dev = foo_aux_dev,
      	.num_aux_devs = ARRAY_SIZE(foo_aux_dev),
      };
      Signed-off-by: NJarkko Nikula <jhnikula@gmail.com>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      2eea392d
  10. 22 11月, 2010 1 次提交
  11. 15 11月, 2010 1 次提交
    • J
      ASoC: Add optional name_prefix for codec kcontrol, widget and route names · ead9b919
      Jarkko Nikula 提交于
      There is a need to prefix codec kcontrol, widget and internal route names in
      an ASoC machine that has multiple codecs with conflicting names. The name
      collision would occur when codec drivers try to registering kcontrols with
      the same name or when building audio paths.
      
      This patch introduces optional prefix_map into struct snd_soc_card. With it
      machine drivers can specify a unique name prefix to each codec that have
      conflicting names with anothers. Prefix to codec is matched with codec
      name.
      
      Following example illustrates a machine that has two same codec instances.
      Name collision from kcontrol registration is avoided by specifying a name
      prefix "foo" for the second codec. As the codec widget names are prefixed
      then second audio map for that codec shows a prefixed widget name.
      
      static const struct snd_soc_dapm_route map0[] = {
      	{"Spk", NULL, "MONO"},
      };
      
      static const struct snd_soc_dapm_route map1[] = {
      	{"Vibra", NULL, "foo MONO"},
      };
      
      static struct snd_soc_prefix_map codec_prefix[] = {
      	{
      		.dev_name = "codec.2",
      		.name_prefix = "foo",
      	},
      };
      
      static struct snd_soc_card card = {
      	...
      	.prefix_map = codec_prefix,
      	.num_prefixes = ARRAY_SIZE(codec_prefix),
      };
      Signed-off-by: NJarkko Nikula <jhnikula@gmail.com>
      Acked-by: NLiam Girdwood <lrg@slimlogic.co.uk>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      ead9b919
  12. 11 11月, 2010 2 次提交
  13. 10 11月, 2010 1 次提交
  14. 06 11月, 2010 4 次提交
    • J
      ASoC: Move pop time from DAPM context to sound card · 3a45b867
      Jarkko Nikula 提交于
      Based on discussion the dapm_pop_time in debugsfs should be per card rather
      than per device. Single pop time value for entire card is cleaner when the
      DAPM sequencing is extended to cross-device paths.
      
      debugfs/asoc/{card->name}/{codec dir}/dapm_pop_time
      ->
      debugfs/asoc/{card->name}/dapm_pop_time
      Signed-off-by: NJarkko Nikula <jhnikula@gmail.com>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      3a45b867
    • J
      ASoC: Move codec debugfs directories under parent card directory · d6ce4cf3
      Jarkko Nikula 提交于
      Make use of sound card debugfs directory and move codec directories under
      the parent card debugfs directory.
      
      debugfs/asoc/{codec dir} -> debugfs/asoc/{card->name}/{codec dir}.
      Signed-off-by: NJarkko Nikula <jhnikula@gmail.com>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      d6ce4cf3
    • J
      ASoC: Add sound card directory under debugfs/asoc/ · a6052154
      Jarkko Nikula 提交于
      There will be need to have sound card specific debugfs entries. This patch
      introduces a new debugfs/asoc/{card->name}/ directory but does not add yet
      any entries there.
      Signed-off-by: NJarkko Nikula <jhnikula@gmail.com>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      a6052154
    • L
      ASoC: Decouple DAPM from CODECs · ce6120cc
      Liam Girdwood 提交于
      Decoupling Dynamic Audio Power Management (DAPM) from codec devices is
      required when developing ASoC further. Such as for other ASoC components to
      have DAPM widgets or when extending DAPM to handle cross-device paths.
      
      This patch decouples DAPM related variables from struct snd_soc_codec and
      moves them to new struct snd_soc_dapm_context that is used to encapsulate
      DAPM context of a device. ASoC core and API of DAPM functions are modified
      to use DAPM context instead of codec.
      
      This patch does not change current functionality and a large part of changes
      come because of structure and internal API changes.
      
      Core implementation is from Liam Girdwood <lrg@slimlogic.co.uk> with some
      minor core changes, codecs and machine driver conversions from
      Jarkko Nikula <jhnikula@gmail.com>.
      Signed-off-by: NLiam Girdwood <lrg@slimlogic.co.uk>
      Signed-off-by: NJarkko Nikula <jhnikula@gmail.com>
      Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
      Cc: Manuel Lauss <manuel.lauss@googlemail.com>
      Cc: Mike Frysinger <vapier.adi@gmail.com>
      Cc: Cliff Cai <cliff.cai@analog.com>
      Cc: Kevin Hilman <khilman@deeprootsystems.com>
      Cc: Ryan Mallon <ryan@bluewatersys.com>
      Cc: Timur Tabi <timur@freescale.com>
      Cc: Sascha Hauer <s.hauer@pengutronix.de>
      Cc: Lars-Peter Clausen <lars@metafoo.de>
      Cc: Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org>
      Cc: Wan ZongShun <mcuos.com@gmail.com>
      Cc: Eric Miao <eric.y.miao@gmail.com>
      Cc: Jassi Brar <jassi.brar@samsung.com>
      Cc: Daniel Gloeckner <dg@emlix.com>
      Cc: Kuninori Morimoto <morimoto.kuninori@renesas.com>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      ce6120cc
  15. 04 11月, 2010 1 次提交
  16. 03 11月, 2010 1 次提交
  17. 29 10月, 2010 1 次提交
  18. 22 10月, 2010 1 次提交
  19. 19 10月, 2010 1 次提交
  20. 15 10月, 2010 1 次提交
    • A
      llseek: automatically add .llseek fop · 6038f373
      Arnd Bergmann 提交于
      All file_operations should get a .llseek operation so we can make
      nonseekable_open the default for future file operations without a
      .llseek pointer.
      
      The three cases that we can automatically detect are no_llseek, seq_lseek
      and default_llseek. For cases where we can we can automatically prove that
      the file offset is always ignored, we use noop_llseek, which maintains
      the current behavior of not returning an error from a seek.
      
      New drivers should normally not use noop_llseek but instead use no_llseek
      and call nonseekable_open at open time.  Existing drivers can be converted
      to do the same when the maintainer knows for certain that no user code
      relies on calling seek on the device file.
      
      The generated code is often incorrectly indented and right now contains
      comments that clarify for each added line why a specific variant was
      chosen. In the version that gets submitted upstream, the comments will
      be gone and I will manually fix the indentation, because there does not
      seem to be a way to do that using coccinelle.
      
      Some amount of new code is currently sitting in linux-next that should get
      the same modifications, which I will do at the end of the merge window.
      
      Many thanks to Julia Lawall for helping me learn to write a semantic
      patch that does all this.
      
      ===== begin semantic patch =====
      // This adds an llseek= method to all file operations,
      // as a preparation for making no_llseek the default.
      //
      // The rules are
      // - use no_llseek explicitly if we do nonseekable_open
      // - use seq_lseek for sequential files
      // - use default_llseek if we know we access f_pos
      // - use noop_llseek if we know we don't access f_pos,
      //   but we still want to allow users to call lseek
      //
      @ open1 exists @
      identifier nested_open;
      @@
      nested_open(...)
      {
      <+...
      nonseekable_open(...)
      ...+>
      }
      
      @ open exists@
      identifier open_f;
      identifier i, f;
      identifier open1.nested_open;
      @@
      int open_f(struct inode *i, struct file *f)
      {
      <+...
      (
      nonseekable_open(...)
      |
      nested_open(...)
      )
      ...+>
      }
      
      @ read disable optional_qualifier exists @
      identifier read_f;
      identifier f, p, s, off;
      type ssize_t, size_t, loff_t;
      expression E;
      identifier func;
      @@
      ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off)
      {
      <+...
      (
         *off = E
      |
         *off += E
      |
         func(..., off, ...)
      |
         E = *off
      )
      ...+>
      }
      
      @ read_no_fpos disable optional_qualifier exists @
      identifier read_f;
      identifier f, p, s, off;
      type ssize_t, size_t, loff_t;
      @@
      ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off)
      {
      ... when != off
      }
      
      @ write @
      identifier write_f;
      identifier f, p, s, off;
      type ssize_t, size_t, loff_t;
      expression E;
      identifier func;
      @@
      ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off)
      {
      <+...
      (
        *off = E
      |
        *off += E
      |
        func(..., off, ...)
      |
        E = *off
      )
      ...+>
      }
      
      @ write_no_fpos @
      identifier write_f;
      identifier f, p, s, off;
      type ssize_t, size_t, loff_t;
      @@
      ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off)
      {
      ... when != off
      }
      
      @ fops0 @
      identifier fops;
      @@
      struct file_operations fops = {
       ...
      };
      
      @ has_llseek depends on fops0 @
      identifier fops0.fops;
      identifier llseek_f;
      @@
      struct file_operations fops = {
      ...
       .llseek = llseek_f,
      ...
      };
      
      @ has_read depends on fops0 @
      identifier fops0.fops;
      identifier read_f;
      @@
      struct file_operations fops = {
      ...
       .read = read_f,
      ...
      };
      
      @ has_write depends on fops0 @
      identifier fops0.fops;
      identifier write_f;
      @@
      struct file_operations fops = {
      ...
       .write = write_f,
      ...
      };
      
      @ has_open depends on fops0 @
      identifier fops0.fops;
      identifier open_f;
      @@
      struct file_operations fops = {
      ...
       .open = open_f,
      ...
      };
      
      // use no_llseek if we call nonseekable_open
      ////////////////////////////////////////////
      @ nonseekable1 depends on !has_llseek && has_open @
      identifier fops0.fops;
      identifier nso ~= "nonseekable_open";
      @@
      struct file_operations fops = {
      ...  .open = nso, ...
      +.llseek = no_llseek, /* nonseekable */
      };
      
      @ nonseekable2 depends on !has_llseek @
      identifier fops0.fops;
      identifier open.open_f;
      @@
      struct file_operations fops = {
      ...  .open = open_f, ...
      +.llseek = no_llseek, /* open uses nonseekable */
      };
      
      // use seq_lseek for sequential files
      /////////////////////////////////////
      @ seq depends on !has_llseek @
      identifier fops0.fops;
      identifier sr ~= "seq_read";
      @@
      struct file_operations fops = {
      ...  .read = sr, ...
      +.llseek = seq_lseek, /* we have seq_read */
      };
      
      // use default_llseek if there is a readdir
      ///////////////////////////////////////////
      @ fops1 depends on !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier readdir_e;
      @@
      // any other fop is used that changes pos
      struct file_operations fops = {
      ... .readdir = readdir_e, ...
      +.llseek = default_llseek, /* readdir is present */
      };
      
      // use default_llseek if at least one of read/write touches f_pos
      /////////////////////////////////////////////////////////////////
      @ fops2 depends on !fops1 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier read.read_f;
      @@
      // read fops use offset
      struct file_operations fops = {
      ... .read = read_f, ...
      +.llseek = default_llseek, /* read accesses f_pos */
      };
      
      @ fops3 depends on !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier write.write_f;
      @@
      // write fops use offset
      struct file_operations fops = {
      ... .write = write_f, ...
      +	.llseek = default_llseek, /* write accesses f_pos */
      };
      
      // Use noop_llseek if neither read nor write accesses f_pos
      ///////////////////////////////////////////////////////////
      
      @ fops4 depends on !fops1 && !fops2 && !fops3 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier read_no_fpos.read_f;
      identifier write_no_fpos.write_f;
      @@
      // write fops use offset
      struct file_operations fops = {
      ...
       .write = write_f,
       .read = read_f,
      ...
      +.llseek = noop_llseek, /* read and write both use no f_pos */
      };
      
      @ depends on has_write && !has_read && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier write_no_fpos.write_f;
      @@
      struct file_operations fops = {
      ... .write = write_f, ...
      +.llseek = noop_llseek, /* write uses no f_pos */
      };
      
      @ depends on has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier read_no_fpos.read_f;
      @@
      struct file_operations fops = {
      ... .read = read_f, ...
      +.llseek = noop_llseek, /* read uses no f_pos */
      };
      
      @ depends on !has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      @@
      struct file_operations fops = {
      ...
      +.llseek = noop_llseek, /* no read or write fn */
      };
      ===== End semantic patch =====
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Cc: Julia Lawall <julia@diku.dk>
      Cc: Christoph Hellwig <hch@infradead.org>
      6038f373
  21. 13 10月, 2010 4 次提交