Ignore:
Timestamp:
Aug 21, 2021, 3:35:34 AM (4 years ago)
Author:
David Azarewicz
Message:

Merge changes from next branch.

Location:
GPL/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk

  • GPL/trunk/alsa-kernel/hda/ext/hdac_ext_controller.c

    r629 r695  
    134134
    135135/**
    136  * snd_hdac_ext_bus_get_link_index - get link based on codec name
     136 * snd_hdac_ext_bus_get_link - get link based on codec name
    137137 * @bus: the pointer to HDAC bus object
    138138 * @codec_name: codec name
     
    333333}
    334334EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_link_put);
     335
     336static void hdac_ext_codec_link_up(struct hdac_device *codec)
     337{
     338        const char *devname = dev_name(&codec->dev);
     339        struct hdac_ext_link *hlink =
     340                snd_hdac_ext_bus_get_link(codec->bus, devname);
     341
     342        if (hlink)
     343                snd_hdac_ext_bus_link_get(codec->bus, hlink);
     344}
     345
     346static void hdac_ext_codec_link_down(struct hdac_device *codec)
     347{
     348        const char *devname = dev_name(&codec->dev);
     349        struct hdac_ext_link *hlink =
     350                snd_hdac_ext_bus_get_link(codec->bus, devname);
     351
     352        if (hlink)
     353                snd_hdac_ext_bus_link_put(codec->bus, hlink);
     354}
     355
     356void snd_hdac_ext_bus_link_power(struct hdac_device *codec, bool enable)
     357{
     358        struct hdac_bus *bus = codec->bus;
     359        bool oldstate = test_bit(codec->addr, &bus->codec_powered);
     360
     361        if (enable == oldstate)
     362                return;
     363
     364        snd_hdac_bus_link_power(codec, enable);
     365
     366        if (enable)
     367                hdac_ext_codec_link_up(codec);
     368        else
     369                hdac_ext_codec_link_down(codec);
     370}
     371EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_link_power);
  • GPL/trunk/alsa-kernel/hda/ext/hdac_ext_stream.c

    r629 r695  
    134134
    135135/**
    136  * snd_hdac_ext_linkstream_start - start a stream
     136 * snd_hdac_ext_link_stream_start - start a stream
    137137 * @stream: HD-audio ext core stream to start
    138138 */
  • GPL/trunk/alsa-kernel/hda/hdac_bus.c

    r637 r695  
    2525        .command = snd_hdac_bus_send_cmd,
    2626        .get_response = snd_hdac_bus_get_response,
     27        .link_power = snd_hdac_bus_link_power,
    2728};
    2829
     
    276277EXPORT_SYMBOL_GPL(snd_hdac_aligned_write);
    277278#endif /* CONFIG_SND_HDA_ALIGNED_MMIO */
     279
     280void snd_hdac_codec_link_up(struct hdac_device *codec)
     281{
     282        struct hdac_bus *bus = codec->bus;
     283
     284        if (bus->ops->link_power)
     285                bus->ops->link_power(codec, true);
     286        else
     287                snd_hdac_bus_link_power(codec, true);
     288}
     289EXPORT_SYMBOL_GPL(snd_hdac_codec_link_up);
     290
     291void snd_hdac_codec_link_down(struct hdac_device *codec)
     292{
     293        struct hdac_bus *bus = codec->bus;
     294
     295        if (bus->ops->link_power)
     296                bus->ops->link_power(codec, false);
     297        else
     298                snd_hdac_bus_link_power(codec, false);
     299}
     300EXPORT_SYMBOL_GPL(snd_hdac_codec_link_down);
  • GPL/trunk/alsa-kernel/hda/hdac_controller.c

    r637 r695  
    655655}
    656656EXPORT_SYMBOL_GPL(snd_hdac_bus_free_stream_pages);
     657
     658/**
     659 * snd_hdac_bus_link_power - power up/down codec link
     660 * @codec: HD-audio device
     661 * @enable: whether to power-up the link
     662 */
     663void snd_hdac_bus_link_power(struct hdac_device *codec, bool enable)
     664{
     665        if (enable)
     666                set_bit(codec->addr, &codec->bus->codec_powered);
     667        else
     668                clear_bit(codec->addr, &codec->bus->codec_powered);
     669}
     670EXPORT_SYMBOL_GPL(snd_hdac_bus_link_power);
  • GPL/trunk/alsa-kernel/hda/hdac_regmap.c

    r629 r695  
    387387
    388388/**
    389  * snd_hdac_regmap_init - Release the regmap from HDA codec
     389 * snd_hdac_regmap_exit - Release the regmap from HDA codec
    390390 * @codec: the codec object
    391391 */
  • GPL/trunk/alsa-kernel/hda/hdac_stream.c

    r637 r695  
    441441        if (!azx_dev->no_period_wakeup && pos_adj > 0) {
    442442                pos_align = pos_adj;
    443                 pos_adj = (pos_adj * runtime->rate + 47999) / 48000;
     443                pos_adj = DIV_ROUND_UP(pos_adj * runtime->rate, 48000);
    444444                if (!pos_adj)
    445445                        pos_adj = pos_align;
    446446                else
    447                         pos_adj = ((pos_adj + pos_align - 1) / pos_align) *
    448                                 pos_align;
     447                        pos_adj = roundup(pos_adj, pos_align);
    449448                pos_adj = frames_to_bytes(runtime, pos_adj);
    450449                if (pos_adj >= period_bytes) {
     
    625624
    626625/**
    627  * snd_hdac_stream_sync - sync with start/strop trigger operation
     626 * snd_hdac_stream_sync - sync with start/stop trigger operation
    628627 * @azx_dev: HD-audio core stream (master stream)
    629628 * @start: true = start, false = stop
  • GPL/trunk/alsa-kernel/hda/hdac_sysfs.c

    r615 r695  
    6767};
    6868
    69 static struct attribute_group hdac_dev_attr_group = {
     69static const struct attribute_group hdac_dev_attr_group = {
    7070        .attrs  = hdac_dev_attrs,
    7171};
Note: See TracChangeset for help on using the changeset viewer.