1. 24 Jan, 2019 1 commit
    • Takashi Sakamoto's avatar
      ALSA: fireface: comment cleanup about destination address of async transactions for MIDI messages · d8002539
      Takashi Sakamoto authored
      In Fireface series, registration of higher 4 bytes of destination
      address for asynchronous transaction of MIDI messages is done by
      a write transaction to model-specific register.
      
      On the other hand, registration of lower 4 bytes of the address is
      selectable from 4 options. A register for this registration includes
      the other purpose options such as input attenuation. Thus this
      driver expects userspace applications to configure the register.
      
      Actual behaviour for the asynchronous transaction is different
      depending on protocols. In former protocol, destination offset
      of each transaction is the same as the registered address even if
      it is block request. In latter models, destination offset of each
      transaction is the offset of previous transaction plus 4 byte
      and the transaction is quadlet request.
      
      This commit cleanups comments about the above mechanism.
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      d8002539
  2. 22 Jan, 2019 12 commits
    • Takashi Sakamoto's avatar
      ALSA: fireface: support rx MIDI functionality for Fireface UCX · f0f9f497
      Takashi Sakamoto authored
      In latter model of Fireface series, asynchronous transaction includes
      a prefix byte to indicate the way to decode included MIDI bytes.
      
      Upper 4 bits of the prefix byte indicates port number, and the rest 4
      bits indicate the way to decode rest of bytes for MIDI messages.
      
      Basically the rest bits indicates the number of bytes for MIDI message.
      However, if the last byte of each MIDi message is included, the rest
      bits are 0xf. For example:
      
      message: f0 00 00 66 14 20 00 00 f7
      offset: content (big endian, port 0)
       '0030: 0x02f00000
       '0030: 0x03006614
       '0030: 0x03200000
       '0030: 0x0ff70000
      
      This commit supports encoding scheme for the above and allows
      applications to transfer MIDI messages via ALSA rawmidi interface.
      An unused member (running_status) is reused to keep state of
      transmission of system exclusive messages.
      
      For your information, this is a dump of config rom.
      
      $ sudo ./hinawa-config-rom-printer /dev/fw1
      { 'bus-info': { 'bmc': False,
                      'chip_ID': 13225063715,
                      'cmc': False,
                      'cyc_clk_acc': 0,
                      'imc': False,
                      'isc': True,
                      'max_rec': 512,
                      'name': '1394',
                      'node_vendor_ID': 2613},
        'root-directory': [ [ 'NODE_CAPABILITIES',
                              { 'addressing': {'64': True, 'fix': True, 'prv': False},
                                'misc': {'int': False, 'ms': False, 'spt': True},
                                'state': { 'atn': False,
                                           'ded': False,
                                           'drq': True,
                                           'elo': False,
                                           'init': False,
                                           'lst': True,
                                           'off': False},
                                'testing': {'bas': False, 'ext': False}}],
                            ['VENDOR', 2613],
                            ['DESCRIPTOR', 'RME!'],
                            ['EUI_64', 2873037108442403],
                            [ 'UNIT',
                              [ ['SPECIFIER_ID', 2613],
                                ['VERSION', 4],
                                ['MODEL', 1054720],
                                ['DESCRIPTOR', 'Fireface UCX']]]]}
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      f0f9f497
    • Takashi Sakamoto's avatar
      ALSA: fireface: add protocol-specific operation to fill transaction buffer with MIDI messages · 82b6297b
      Takashi Sakamoto authored
      Between former and latter models, content of asynchronous transaction
      for MIDI messages from driver to device is different.
      
      This commit is a preparation to support latter models. A protocol-specific
      operation is added to encode MIDI messages to the transaction.
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      82b6297b
    • Takashi Sakamoto's avatar
      ALSA: fireface: add model-dependent parameter for address to receive async... · 481e09ac
      Takashi Sakamoto authored
      ALSA: fireface: add model-dependent parameter for address to receive async transaction for MIDI messages
      
      Between former and latter models, destination address to receive
      asynchronous transactions for MIDI messages is different.
      
      This commit adds model-dependent parameter for the addresses.
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      481e09ac
    • Takashi Sakamoto's avatar
      ALSA: fireface: support tx MIDI functionality of Fireface UCX · 73f5537f
      Takashi Sakamoto authored
      Fireface UCX transfers asynchronous transactions for MIDI messages.
      One transaction includes quadlet data therefore it can transfer 3
      message bytes as maximum. Base address of the destination is
      configured by two settings; a register for higher 8 byte of the
      address, and a bitflag to option register indicates lower 8byte.
      
      The register for higher address is 0x'ffff'0000'0034. Unfortunately,
      firmware v24 includes a bug to ignore registered value for the
      destination address and transfers to 0x0001xxxxxxxx always. This
      driver doesn't work well if the bug exists, therefore users should
      install the latest firmware (v27).
      
      The bitflag is a part of value to be written to option register
      (0x'ffff'0000'0014).
      
      lower addr:  bitflag (little endian)
       '0000'0000: 0x00002000
       '0000'0080: 0x00004000
       '0000'0100: 0x00008000
       '0000'0180: 0x00010000
      
      This register includes more options but they are not relevant to
      packet streaming or MIDI functionality. This driver don't touch it.
      
      Furthermore, the transaction is sent to address offset incremented
      by 4 byte to the offset in previous time. When it reaches base address
      plus 0x7c, next offset is the base address.
      
      Content of the transaction includes a prefix byte. Upper 4 bits of
      the byte indicates port number, and the rest 4 bits indicate the way
      to decode rest of bytes for MIDI message.
      
      Except for system exclusive messages, the rest bits are the same as
      status bits of the message without channel bits. For system exclusive
      messages, the rest bits are encoded according to included message bytes.
      For example:
      
      message: f0 7e 7f 09 01 f7
      offset: content (little endian, port 0)
       '0000: 0x04f07e7f
       '0004: 0x070901f7
      
      message: f0 00 00 66 14 20 00 00 00 f7
      offset: content (little endian, port 1)
       '0014: 0x14f00000
       '0018: 0x14661420
       '001c: 0x14000000
       '0020: 0x15f70000
      
      message: f0 00 00 66 14 20 00 00 f7
      offset: content (little endian, port 0)
       '0078: 0x04f00000
       '007c: 0x04661420
       '0000: 0x070000f7
      
      This commit supports decoding scheme for the above and allows
      applications to receive MIDI messages via ALSA rawmidi interface.
      The lower 8 bytes of destination address is fixed to 0x'0000'0000,
      thus this driver expects userspace applications to configure option
      register with bitflag 0x00002000 in advance.
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      73f5537f
    • Takashi Sakamoto's avatar
      ALSA: fireface: add model-dependent parameter for address range to receive async transaction · 90089677
      Takashi Sakamoto authored
      In Fireface series, drivers can register destination address for
      asynchronous transaction which transfers MIDI messages from device.
      
      In former models, all of the transactions arrive at the registered
      address without any offset. In latter models, each of the transaction
      arrives at the registered address with sequential offset within 0x00
      to 0x7f. This seems to be for discontinuity detection.
      
      This commit adds model-dependent member for the address range.
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      90089677
    • Takashi Sakamoto's avatar
      ALSA: fireface: change prototype of handler for async transaction with MIDI messages · 6c644e4e
      Takashi Sakamoto authored
      In a series of Fireface, devices transfer asynchronous transaction with
      MIDI messages. In the transaction, content is different depending on
      models. ALSA fireface driver has protocol-dependent handler to pick up
      MIDI messages from the content.
      
      In latter models of the series, the transaction is transferred to range
      of address sequentially. This seems to check continuity of transferred
      messages.
      
      This commit changes prototype of the handler to receive offset of
      address for received transactions.
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      6c644e4e
    • Sameer Pujar's avatar
      ALSA: hda/tegra: add driver flag for runtime PM · 9935d55b
      Sameer Pujar authored
      AZX_DCAPS_PM_RUNTIME flag is added to indicate support for runtime PM.
      azx_has_pm_runtime() is used to check if above is enabled and thus
      forbid runtime PM calls if needed.
      Signed-off-by: default avatarSameer Pujar <spujar@nvidia.com>
      Reviewed-by: default avatarRavindra Lokhande <rlokhande@nvidia.com>
      Reviewed-by: default avatarMohan Kumar D <mkumard@nvidia.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      9935d55b
    • Sameer Pujar's avatar
      ALSA: hda/tegra: implement runtime suspend/resume · 707e0759
      Sameer Pujar authored
      This patch moves clock enable/disable from system resume/suspend to
      runtime resume/suspend respectively. Along with this hda controller
      chip init or stop is also moved. System resume/suspend can invoke
      runtime callbacks and do necessary setup.
      
      chip->running can be used to check for probe completion and device
      access during runtime_resume or runtime_suspend can be avoided if
      probe is not yet finished. This helps to avoid kernel panic during
      boot where runtime PM callbacks can happen from system PM.
      Signed-off-by: default avatarSameer Pujar <spujar@nvidia.com>
      Reviewed-by: default avatarRavindra Lokhande <rlokhande@nvidia.com>
      Reviewed-by: default avatarMohan Kumar D <mkumard@nvidia.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      707e0759
    • Sameer Pujar's avatar
      ALSA: hda/tegra: remove redundant clock enable API · 091aa420
      Sameer Pujar authored
      Explicit clock enable is not required during probe, as this would be
      managed by runtime PM calls. Clock can be enabled/disabled in runtime
      resume/suspend. This way it is easier to balance clock enable/disable
      counts.
      Signed-off-by: default avatarSameer Pujar <spujar@nvidia.com>
      Reviewed-by: default avatarRavindra Lokhande <rlokhande@nvidia.com>
      Reviewed-by: default avatarMohan Kumar D <mkumard@nvidia.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      091aa420
    • Sameer Pujar's avatar
      ALSA: hda/tegra: add runtime PM callbacks · f2974aa2
      Sameer Pujar authored
      This patch adds skeleton of runtime suspend and resume callbacks.
      Signed-off-by: default avatarSameer Pujar <spujar@nvidia.com>
      Reviewed-by: default avatarRavindra Lokhande <rlokhande@nvidia.com>
      Reviewed-by: default avatarMohan Kumar D <mkumard@nvidia.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      f2974aa2
    • Sameer Pujar's avatar
      ALSA: hda/tegra: get clock handles early in probe · 65af2122
      Sameer Pujar authored
      Moved devm_clk_get() API calls to a separate function and the same
      can be called early in the probe. This is done before runtime PM
      for the device is enabled. The runtime resume/suspend callbacks can
      later enable/disable clocks respectively(the support would be added
      in subsequent patches). Clock handles should be available by the
      time runtime suspend/resume calls can happen.
      Signed-off-by: default avatarSameer Pujar <spujar@nvidia.com>
      Reviewed-by: default avatarRavindra Lokhande <rlokhande@nvidia.com>
      Reviewed-by: default avatarMohan Kumar D <mkumard@nvidia.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      65af2122
    • Sameer Pujar's avatar
      ALSA: hda/tegra: runtime power management support · 3f7e94e6
      Sameer Pujar authored
      This patch enables runtime power management(runtime PM) support for
      hda. pm_runtime_enable() and pm_runtime_disable() are added during
      device probe and remove respectively. The runtime PM callbacks will
      be forbidden if hda controller does not have support for runtime PM.
      pm_runtime_get_sync() and pm_runtime_put() are added for hda register
      access. The callbacks for above will be added in subsequent patches.
      Signed-off-by: default avatarSameer Pujar <spujar@nvidia.com>
      Reviewed-by: default avatarRavindra Lokhande <rlokhande@nvidia.com>
      Reviewed-by: default avatarMohan Kumar D <mkumard@nvidia.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      3f7e94e6
  3. 21 Jan, 2019 10 commits
  4. 18 Jan, 2019 1 commit
  5. 15 Jan, 2019 14 commits
  6. 14 Jan, 2019 2 commits