Changeset 1599

Show
Ignore:
Timestamp:
07/18/09 23:22:51 (15 years ago)
Author:
jwoithe
Message:

RME: implement highlevel function for setting phantom power status.
RME: add phantom power control to the generic device control mixer element.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/src/rme/fireface_hw.cpp

    r1596 r1599  
    198198 
    199199signed int  
    200 Device::set_hardware_params(FF_software_settings_t *sw_settings) 
     200Device::set_hardware_params(FF_software_settings_t *use_settings) 
    201201{ 
    202202    // Initialises the hardware to the state defined by the supplied 
     
    205205    // "Host" LED on the FF400 when done for the first time after the 
    206206    // interface has been powered up. 
    207  
     207    // 
     208    // If use_settings is NULL, the device's current settings structure will 
     209    // be used to source the configuration information. 
     210 
     211    FF_software_settings_t *sw_settings; 
    208212    quadlet_t data[3] = {0, 0, 0}; 
    209213    unsigned int conf_reg; 
     214 
     215    if (use_settings == NULL) 
     216      sw_settings = &settings; 
     217    else 
     218      sw_settings = use_settings; 
    210219 
    211220    if (sw_settings->mic_phantom[0]) 
  • trunk/libffado/src/rme/fireface_settings_ctrls.cpp

    r1598 r1599  
    7070RmeSettingsCtrl::setValue(int v) { 
    7171 
     72signed int i; 
     73signed int err = 0; 
     74 
    7275    switch (m_type) { 
    7376        case RME_CTRL_PHANTOM_SW: 
     77            // Lowest 16 bits are phantom status bits (max 16 channels).  
     78            // High 16 bits are "write enable" bits for the correspoding 
     79            // channel represented in the low 16 bits.  This way changes can 
     80            // be made to one channel without needing to first read the 
     81            // existing value. 
     82            // 
     83            // At present there are at most 4 phantom-capable channels. 
     84            // Flag attempts to write to the bits corresponding to channels 
     85            // beyond this. 
     86            if (v & 0xfff00000) { 
     87                debugOutput(DEBUG_LEVEL_WARNING, "Ignored out-of-range phantom set request: mask=0x%04x, value=0x%04x\n", 
     88                  (v >> 16) & 0xfff0, v && 0xfff0); 
     89            } 
     90 
     91            for (i=0; i<4; i++) { 
     92                if (v & (0x00010000 << i)) { 
     93                    unsigned int on = (v & (0x00000001 << i)) != 0; 
     94                    err = m_parent.setPhantom(i, on); 
     95                    if (!err && on) { 
     96                        m_value |= (0x01 << i); 
     97                    } else { 
     98                        m_value &= ~(0x01 << i); 
     99                    } 
     100                } 
     101            } 
    74102            break; 
    75103    } 
    76     return true; 
     104 
     105    return err==0?true:false; 
    77106} 
    78107 
     
    82111    switch (m_type) { 
    83112        case RME_CTRL_PHANTOM_SW: 
     113            return m_value; 
    84114            break; 
    85115    } 
  • trunk/libffado/src/rme/rme_avdevice.h

    r1596 r1599  
    8989    signed int writeBlock(fb_nodeaddr_t reg, quadlet_t *data, unsigned int n_quads); 
    9090 
     91    /* Device control functions */ 
     92    signed int setPhantom(unsigned int channel, unsigned int status); 
     93 
    9194protected: 
    9295    enum ERmeModel m_rme_model; 
     
    124127    signed int write_device_flash_settings(FF_software_settings_t *settings); 
    125128 
    126     /* Hardware functions */ 
     129    /* Low-level hardware functions */ 
    127130    unsigned int multiplier_of_freq(unsigned int freq); 
    128131    signed int init_hardware(void); 
     
    130133    signed int get_hardware_streaming_status(unsigned int *stat, unsigned int n); 
    131134    signed int get_hardware_state(FF_state_t *state); 
    132     signed int set_hardware_params(FF_software_settings_t *sw_settings); 
     135    signed int set_hardware_params(FF_software_settings_t *use_settings = NULL); 
    133136 
    134137    signed int read_tco(quadlet_t *tco_data, signed int size); 
  • trunk/libffado/src/SConscript

    r1597 r1599  
    171171rme_source = env.Split( '\ 
    172172        rme/rme_avdevice.cpp \ 
     173        rme/rme_avdevice_settings.cpp \ 
    173174        rme/fireface_flash.cpp \ 
    174175        rme/fireface_hw.cpp \