09 Nov, 2014

2 commits

  • This function has no more non regmap user, which means we can remove the
    implementation of the function and associated functions and structure
    fields.

    For convenience we keep a static inline version of the function that
    forwards calls to regcache_sync() unconditionally.

    Signed-off-by: Lars-Peter Clausen
    Signed-off-by: Mark Brown

    Lars-Peter Clausen
     
  • For convenience for drivers that do not want to keep their own pointer to
    regmap struct around forward calls to snd_soc_cache_sync() to
    regcache_sync() if the driver is using regmap. This is similar to what we do
    for snd_soc_read()/snd_soc_write().

    This patch also fixes drivers which already have been converted to regmap,
    but still use snd_soc_cache_sync() for trying to the sync the cache.

    Signed-off-by: Lars-Peter Clausen
    Signed-off-by: Mark Brown

    Lars-Peter Clausen
     

22 Jun, 2014

1 commit


02 Jun, 2014

2 commits


15 Apr, 2014

1 commit


04 Mar, 2014

1 commit

  • For the snd_soc_cache_init(), the reg_size maybe zero and then the value
    of codec->reg_cache, which is alloced via kzalloc, maybe equal to
    ZERO_SIZE_PTR. If the reg parameter of snd_soc_cache_write() is large enough,
    the cache[idx] = val maybe cause the kernel crash...

    So this patch fix this via doing the zero pionter check of it.

    Signed-off-by: Xiubo Li
    Signed-off-by: Mark Brown

    Xiubo Li
     

08 Nov, 2013

2 commits


17 Sep, 2013

4 commits

  • The only cache type left is the flat cache and new other cache types won't be
    added since new drivers are supposed to use regmap directly for IO and caching.
    This patch removes the snd_soc_cache_ops indirection that was added to support
    multiple cache types and modifies the code to always use the flat cache
    directly.

    Signed-off-by: Lars-Peter Clausen
    Signed-off-by: Mark Brown

    Lars-Peter Clausen
     
  • The reg_size field is calculated in snd_soc_register_codec() and then used
    exactly once in snd_soc_flat_cache_init(). Since it is calculated based on other
    fields from the codec struct just move the calculation to
    snd_soc_flat_cache_init() and remove the 'reg_size' field from the codec struct.

    Signed-off-by: Lars-Peter Clausen
    Signed-off-by: Mark Brown

    Lars-Peter Clausen
     
  • reg_def_copy was introduced in commit 3335ddca ("ASoC: soc-cache: Use
    reg_def_copy instead of reg_cache_default") to keep a copy of the register
    defaults around in case the register defaults where placed in the __devinitdata
    section. With the __devinitdata section gone we effectivly keep the same data
    around twice. This patch removes reg_def_copy and uses reg_cache_default
    directly instead.

    Signed-off-by: Lars-Peter Clausen
    Signed-off-by: Mark Brown

    Lars-Peter Clausen
     
  • No users of reg_access_defaults are left and new drivers are going to use regmap
    for this, so support for it can be removed.

    Signed-off-by: Lars-Peter Clausen
    Signed-off-by: Mark Brown

    Lars-Peter Clausen
     

21 Nov, 2012

1 commit

  • Currently ASoC has a mixture of message prefixes e.g. "ASoC", "asoc"
    or none and message types e.g. pr_debug or dev_dbg.

    Make sure all ASoC core messages use the same "ASoC" prefix and
    convert any component device specific messages to use dev_dbg
    instead of pr_debug.

    Signed-off-by: Liam Girdwood
    Signed-off-by: Mark Brown

    Liam Girdwood
     

13 Dec, 2011

1 commit


10 Nov, 2011

1 commit


01 Nov, 2011

1 commit


31 Aug, 2011

2 commits


15 Aug, 2011

2 commits


14 Jun, 2011

1 commit


13 Jun, 2011

1 commit


08 Jun, 2011

1 commit

  • Currently the rbtree code will write out the entire register map when
    doing a cache sync which is wasteful and will slow things down. Check
    to see if the value we're about to write is the default and don't bother
    restoring it if it is, either the value will have been retained or the
    device will have been reset and holds the value already.

    We should really store the defaults in the nodes but this resolves the
    immediate issue.

    Signed-off-by: Mark Brown
    Acked-by: Liam Girdwood

    Mark Brown
     

07 Jun, 2011

2 commits


30 May, 2011

1 commit


27 May, 2011

3 commits


24 May, 2011

1 commit


20 May, 2011

2 commits

  • Whenever we are doing a read or a write through the rbtree code, we'll
    cache a pointer to the rbnode. To avoid looking up the register
    everytime we do a read or a write, we first check if it can be found in
    the cached register block, otherwise we traverse the rbtree and finally
    cache the rbnode for future use.

    Signed-off-by: Dimitris Papastamos
    Acked-by: Liam Girdwood
    Signed-off-by: Mark Brown

    Dimitris Papastamos
     
  • This patch prepares the ground for the actual rbtree optimization patch
    which will save a pointer to the last accessed rbnode that was used
    in either the read() or write() functions.

    Each rbnode manages a variable length block of registers. There can be no
    two nodes with overlapping blocks. Each block has a base register and a
    currently top register, all the other registers, if any, lie in between these
    two and in ascending order.

    The reasoning behind the construction of this rbtree is simple. In the
    snd_soc_rbtree_cache_init() function, we iterate over the register defaults
    provided by the driver. For each register value that is non-zero we
    insert it in the rbtree. In order to determine in which rbnode we need
    to add the register, we first look if there is another register already
    added that is adjacent to the one we are about to add. If that is the case
    we append it in that rbnode block, otherwise we create a new rbnode
    with a single register in its block and add it to the tree.

    In the next patch, where a cached rbnode is used by both the write() and the
    read() functions, we also check if the register we are about to add is in the
    cached rbnode (the least recently accessed one) and if so we append it in that
    rbnode block.

    Signed-off-by: Dimitris Papastamos
    Acked-by: Liam Girdwood
    Signed-off-by: Mark Brown

    Dimitris Papastamos
     

15 May, 2011

1 commit

  • There is an unfortunate difference in return values between spi_write()
    and i2c_master_send() so we need an adaptor function to translate.

    Reported-by: Lars-Peter Clausen
    Signed-off-by: Mark Brown
    Acked-by: Liam Girdwood

    Mark Brown
     

11 May, 2011

3 commits

  • do_spi_write() is just an open coded copy of do_spi_write() so we can
    delete it and just call spi_write() directly. Indeed, as a result of
    recent refactoring all the SPI write functions are just very long
    wrappers around spi_write() which don't add anything except for some
    pointless copies so we can just use spi_write() as the hw_write
    operation directly. It should be as type safe to do this as it is to do
    the same thing with I2C and it saves us a bunch of code.

    Signed-off-by: Mark Brown
    Acked-by: Liam Girdwood

    Mark Brown
     
  • snd_soc_4_12_spi_write() contains a byte swap. Since this code was written
    for an Analog CODEC on a Blackfin reference board it appears that this is
    done because while Blackfin is little endian the CODEC is big endian (as
    are most CODECs).

    Push this up into the generic 4x12 write function and use cpu_to_be16() to
    do the byte swap so things are more regular and things work on both CPU
    endiannesses.

    Signed-off-by: Mark Brown
    Acked-by: Liam Girdwood

    Mark Brown
     
  • Currently we'll force all registers to fit in 8 bits before passing
    down to the I/O function. Looks like a cut'n'paste bug.

    Signed-off-by: Mark Brown
    Acked-by: Liam Girdwood

    Mark Brown
     

08 May, 2011

1 commit


20 Apr, 2011

1 commit


05 Apr, 2011

1 commit