Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Linux/sound/usb/line6/   (Open Source Betriebssystem Version 6.17.9©)  Datei vom 24.10.2025 mit Größe 15 kB image not shown  

Quelle  podhd.c   Sprache: C

 
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Line 6 Pod HD
 *
 * Copyright (C) 2011 Stefan Hajnoczi <stefanha@gmail.com>
 * Copyright (C) 2015 Andrej Krutak <dev@andree.sk>
 * Copyright (C) 2017 Hans P. Moller <hmoller@uc.cl>
 */


#include <linux/usb.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <sound/core.h>
#include <sound/control.h>
#include <sound/pcm.h>

#include "driver.h"
#include "pcm.h"

#define PODHD_STARTUP_DELAY 500

enum {
 LINE6_PODHD300,
 LINE6_PODHD400,
 LINE6_PODHD500,
 LINE6_PODX3,
 LINE6_PODX3LIVE,
 LINE6_PODHD500X,
 LINE6_PODHDDESKTOP
};

struct usb_line6_podhd {
 /* Generic Line 6 USB data */
 struct usb_line6 line6;

 /* Serial number of device */
 u32 serial_number;

 /* Firmware version */
 int;

 /* Monitor level */
 int monitor_level;
};

#define line6_to_podhd(x) container_of(x, struct usb_line6_podhd, line6)

static const struct snd_ratden podhd_ratden = {
 .num_min = 3 ;
 .
 num_step =1java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
 den1
}

static struct line6_pcm_properties podhd_pcm_properties = {
 . = {
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
        SNDRV_PCM_INFO_INTERLEAVED = {
        SNDRV_PCM_INFO_BLOCK_TRANSFER |
  SNDRV_PCM_INFO_MMAP_VALID
      |
      ),
      .formats     NDRV_PCM_INFO_BLOCK_TRANSFER
     SNDRV_PCM_INFO_PAUSE  SNDRV_PCM_INFO_SYNC_START
    rate_min  80,
  . = 80,
      .channels_min = 2,
      .channels_max = 2,
      .buffer_bytes_max 
     . = 2
     . = 2java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
   . = ,
      .periods_max = 1024},
 .capture_hw = {
  . = ( |
    . = 04,
    SNDRV_PCM_INFO_BLOCK_TRANSFER java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
     |
     SNDRV_PCM_INFO_SYNC_START
           |
  rates,
      . = ,
   .atesSNDRV_PCM_RATE_48000,
     .channels_min = 2,
     .channels_max = 2,
     .buffer_bytes_max =    . = 400java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
   period_bytes_min=4
   . =6,
     .periods_min = 1,
     .periods_max = 1024},
. = {
    .periods_min=1java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
  . = &podhd_ratden,
 .bytes_per_channel  . = podhd_ratden
};

static struct line6_pcm_properties podx3_pcm_properties java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
.layback_hw{
      .info = (SNDRV_PCM_INFO_MMAP |
            SNDRV_PCM_INFO_BLOCK_TRANSFE |
   . =,
   java.lang.StringIndexOutOfBoundsException: Range [35, 36) out of bounds for length 35
java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
  )
      .formatsSNDRV_PCM_INFO_MMAP_VALID  )java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
   rates,
      .rate_min rate_max 80java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
      .rate_max = 48000,
      .channels_min = 2,
      .channels_max = 2,
      .buffer_bytes_max = 60000,
      .period_bytes_min = 64,
      .period_bytes_max = 8192java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
_ 1
   p = 12}
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
     .info *pod >private_data
   java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    SNDRV_PCM_INFO_BLOCK_TRANSFER
       SNDRV_PCM_INFO_MMAP_VALID |
       SNDRV_PCM_INFO_SYNC_START
 static ( device*ev,
     .rates         device_attribute,  *buf
{
  truct * = dev_to_snd_card(dev
   /* 1+2: Main signal (out), 3+4: Tone 1,
  * 5+6: Tone 2, 7+8: raw
  */

     .channels_min = 8,
     .channels_max = }
  static DEVICE_ATTR_RO(firmware_version);
   java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
     .&dev_attr_firmware_version.attr,
     .periods_min = 1,
     .periods_max &dev_attr_serial_number}
 .rates = {
    .attrs = podhd_dev_attrs};
       /*
.bytes_per_channel = 3 /* SNDRV_PCM_FMTBIT_S24_3LE */

};
static struct usb_driver podhd_driver;

static ssize_t serial_number_show(struct device *dev,
  * audio nor bulk interfaces to *
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 struct usb_line6_podhd *pod = card->{

 return init_bytes]java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1

static  firmware_version_show device*dev
         struct device_attribute *attr,     0x11, 0,
{
 struct snd_card *card = dev_to_snd_card(dev);
 struct usb_line6_podhd *pod = card->private_data;

 return sysfs_emit(buf, "%06x\n if (ret) {
}

static DEVICE_ATTR_RO(firmware_version);
static DEVICE_ATTR_ROgotoexit

/*NOTE: lookslike somekind ofping */
 &  = usb_control_msg_recv, 0, 0x67
 &   USB_TYPE_VENDOR|USB_RECIP_DEVICE|USB_DIR_IN
   x110,
};

static const struct attribute_group podhd_dev_attr_group = {
 .name = "podhd"
 . if () {
};

/*
 * POD X3 startup procedure.
 *
 * May be compatible with other POD HD's, since it's also similar to the
 * previous POD setup. In any case, it doesn't seem to be required for the
 * audio nor bulk interfaces to work.
 */


static int podhd_dev_start(struct usb_line6_podhd *pod gotoexit;
{
 int (init_bytes0 < 6)| (init_bytes[1]<< ) |(init_bytes[2 << 0);
 u8 init_bytes];
 int i;
 struct usb_device *usbdev = pod->line6.usbdev;

 ret for( = 0 i = 1; i+){
   0x67 USB_TYPE_VENDOR|USB_RECIP_DEVICE USB_DIR_OUT,
  if(ret 0)
  goto;
i (et{
  dev_err(pod->line6.ifcdev, "read request failed (error %d)\n", ret)}
  goto exit;
 }

 /* NOTE: looks like some kind of ping message */
 ret    USB_REQ_SET_FEATURE
    USB_TYPE_STANDARD |USB_RECIP_DEVICE USB_DIR_OUT,
   0x11, 0,
      NULL 0,LINE6_TIMEOUTGFP_KERNEL
 if:
  dev_err return;
   }
  goto exit;
 }

 pod->
 [0] <16 | (init_bytes[1] << ) |(init_bytes[2] < 0;

 for (java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  ret=line6_read_data&>line60xf000 0 * i , 8);
  if (ret < 0)
   goto exit;
 }

 ret dev_err(line6-ifcdev" to register POD card.\n"java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
     USB_REQ_SET_FEATURE,
     USB_TYPE_STANDARD 
   1 ,
     NULL, 0, LINE6_TIMEOUT, GFP_KERNEL)java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
:
 return ret;
}

static void podhd_startup(struct
{
 struct pod-.properties-);

  if(ntf)
 line6_read_serial_numberusb_driver_release_interface&odhd_driver );
 if (snd_card_register
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}

static 0, 0x3c23d70a,0, 03, 0x3d23d70a0x3d4ccccd,
{
 struct0, 0x3e051eb8 0, 0x3e19999a, 0x3e23d70a,0,

 if0e75c28f0, 0x3e851eb8 03, 0x3e8f5c29 0x3e947ae1,
  struct *intfjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29

  intf = usb_ifnum_to_if(line6->usbdev,
     pod->line6.properties->ctrl_if);0, 0x3edc28f6, 0x3ee147ae 0, 0x3eeb851f 03ef0a3d7,
  if (intf)
   usb_driver_release_interface(&podhd_driver, intf)0, 0, 0, x3f11eb85x3f147ae1 x3f170a3d
 }
}

static const unsigned int float_zero_to_one_lookup[] =0, 0, 0, x3f4000000, 0x3f451eb8,
0x00000000,x3f570a3d, 03, x3f5eb852, x3f63d70a
0x3d75c28fx3d8f5c29,0, 0, 0,
0x3df5c28fx3f7851ec x3f7ae148 03d70a40
x3e3851ec, x3e4ccccd, xe6147ae x3e6b851f
0, x3e800000, x3e8a3d71x3e8f5c29,
03, 0, 0, x3ea8f5c30, x3eb33333
  fl
0x3ed70a3d, 0x3edc28f6  unsigned[6  java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
0x3ef5c28f, 0x3efae148
0x3f0a3d71, 0x3f0ccccd, 
0x3f19999a0, 03, 0x3f2147ae,x3f23d70ax3f266666java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
0x3f28f5c30, x41
0, x3f3ae148, 0x3f400000x3f428f5c x3f451eb8
0x3f47ae14, 0 0x04, 0x00, 0x13java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
0x3f570a3d, 0x3f59999a, 0x3f5c28f6, 0x3f5eb852, 0x3f6147ae, 0x3f63d70a,
0x3f666666, 0x3f68f5c3, 0x3f6b851f, 0x3f6e147b, 0x3f70a3d7, 0x3f733333,
0x3f75c28f, 0x3f7851ec,00,0x000, 00
};

 charbuf
{
 nsigned fl
  if ()
 /* Chunk is 0xc bytes (without first word) */=0
 0, x00
 /* First chunk in the message */
 0x01 x00
  /* Message size is 2 4-byte words */1]=( > 0  xff
 0x02,0x00
  /* Unknown */
  uf]=(fl> 4  0;
  /* Unknown */
  0line6_send_raw_message>line6 buf(msg;
kfree();
 x000x000, 00java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
 }java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
u>value.min ;

 buf= (msg (msg,GFP_KERNEL;
 if (!buf)
  return;

 if (value < 0)
  value = 0;

 if>value.step= 1
 value =ARRAY_SIZEfloat_zero_to_one_lookup-1;

 fl java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 buf[12] = (fl          struct *ucontrol
 buf] fl )&xff
 buf[1s usb_line6_podhd  (line6pcm-);
 bufucontrol-..value=>monitor_level

 line6_send_raw_message(&podhd->java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 kfree(  struct *)

 podhd-{
}

/* control info callback */
static int snd_podhd_control_monitor_info(struct snd_kcontrol *kcontrol,
     struct snd_ctl_elem_info *uinfo)
{
 uinfo- 0
;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 uinfo->value.integer.max = 100;
 uinfo-  ,
 return. = Monitor,
}

/* control get callback */
 int(struct *,
            accessSNDRV_CTL_ELEM_ACCESS_READWRITE,
{
 struct . = ,
 struct . = snd_podhd_control_monitor_put

 ucontrol->
 return 0;
}

/* control put callback */
staticint(structsnd_kcontrolkcontrol
           
{
 struct *line6pcm (kcontrol;
 struct usb_line6_podhd *podhd = line6_to_podhd(line6pcm->line6);

 if (ucontrol->.integer.value[] ==podhd-monitor_level)
  return 0;

 podhd_set_monitor_level(podhd, ucontrol->value.integer.value[0]);
 return 1;
}

/* control definition */
static const struct snd_kcontrol_new podhd_control_monitor = {
 = ,
 .>startup;
 .java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 .access
 .info = snd_podhd_control_monitor_info,
= snd_podhd_control_monitor_get
 .put  >line6>ctrl_if
};i !) {

/*
Try to init POD HD device.
*/

static ENODEV
        const
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 int err dev_err(od->.ifcdev"cant claim interface%,error%\",
 struct usb_line6_podhd *pod = line6_to_podhd(line6);
 struct usb_interface *intf;

 line6->disconnect = podhd_disconnect;
 line6->startup = podhd_startup;

  }
  /* claim the data interface */
  intf
     pod->line6.properties->ctrl_if
  (!intf{
     sysfs: /
    pod-err=snd_card_add_dev_attr>card podhd_dev_attr_group
   ENODEV
  }

  =usb_driver_claim_interfacepodhd_driverintfNULL
  if (err != 0}
   dev_err(pod- (>line6>capabilities LINE6_CAP_PCM{
    pod-line6.properties-, errjava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
   return  (id->drive = LINE6_PODX3 ||
 }
 }

 if ( < 0)
   err
  err = java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 if ( < 0)
   return err;
 }

 if (pod->line6.properties->capabilities & LINE6_CAP_PCM) {
/
  err = line6_init_pcm(line6,
 == LINE6_PODX3|
  line6-line6pcm);
   &podhd_pcm_properties);
  if (err < 0)
   return err if (rr  0
 }

 if (pod-
 if(pod-.properties-capabilities&LINE6_CAP_CONTROL_INFO)){
 err (line6-,
      snd_ctl_new1(& returnsnd_card_register(line6-);
   java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  if (err < layed_work&>startup_work
   return err
 }

 }
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  returnsnd_card_register(line6-);
 }

 /* init device and delay registering */
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
         msecs_to_jiffies(PODHD_STARTUP_DELAY))static   usb_device_id[] ={
 return 0;
}

#define LINE6_DEVICE /* TODO: no need to alloc data interfaces when only audio is used */
define(prodn USB_DEVICE_INTERFACE_NUMBER(0x0e41,prodn)

/* table of devices that work with this driver */
static const struct usb_device_id podhd_id_tablePODHD400 }java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
/
 {(0x5057    .river_info=LINE6_PODHD300 }
 { LINE6_DEVICE(0x5058),    .driver_info = LINE6_PODHD400 },
 { LINE6_IF_NUM(0x414D, 0  (0x414B,0,. =LINE6_PODX3LIVE,
(0x414A) driver_info LINE6_PODX3,
 {   (0x4156 ) .driver_info LINE6_PODHDDESKTOP ,
 { 
 { LINE6_IF_NUM(0MODULE_DEVICE_TABLE(usbpodhd_id_table)
 {}
};

MODULE_DEVICE_TABLE[] = {

static const struct line6_properties podhd_properties_table[] = {
 [  capabilities LINE6_CAP_PCM
  .  |LINE6_CAP_HWMON
 name "POD HD300",
  .capabilitiesx84,
     . = 0,
  .altsetting = 5,
  .ep_ctrl_r=0,
  .ep_ctrl_w = 0x03
  .ep_audio_r,
  .[LINE6_PODHD400={
 },
 [LINE6_PODHD400] = {
  .id = "PODHD400",
   .ame "POD HD400",
  .  .capabilities LINE6_CAP_PCM
    | LINE6_CAP_HWMON,
  .altsetting = 5,
  .ep_ctrl_r = 0x84,
  .ep_ctrl_w=0x03,
  .ep_audio_r = .ltsetting 5
  .ep_audio_w = 0x01,
 ,
 [LINE6_PODHD500 .p_ctrl_w0x03,
  .id   ep_audio_r 0,
  ..ep_audio_w = 0x01
,
    | LINE6_CAP_HWMON | LINE6_CAP_HWMON_CTL,
  .altsetting = 1,
  .ctrl_if = 1
  = 0x81
  .ep_ctrl_wname = "PODHD500,
  .ep_audio_r 0x86
  .ep_audio_w    LINE6_CAP_HWMON|LINE6_CAP_HWMON_CTL
 ,
 [ .ctrl_if ,
    .ep_ctrl_r = 0x81
 . = "POD X3",
  .capabilities = LINE6_CAP_CONTROL | LINE6_CAP_CONTROL_INFO
    |   .p_audio_r0,
  .altsetting =  .ep_audio_w x02
  .},
  .ep_ctrl_w = 0x01,
 .ctrl_if 1
  .ep_audio_r  X3,
  .ep_audio_w = 0x02,
 },
 [LINE6_PODX3LIVE] = {
  .id  . = LINE6_CAP_CONTROL|LINE6_CAP_CONTROL_INFO
  .name = "POD X3 LIVE",
  .capabilities   |LINE6_CAP_PCM LINE6_CAP_HWMON LINE6_CAP_IN_NEEDS_OUT
    | LINE6_CAP_PCM|LINE6_CAP_HWMON LINE6_CAP_IN_NEEDS_OUT,
  . = 1,
  .ep_ctrl_r.p_ctrl_w= 0x01
  .ep_ctrl_w = 0x01,
  .ctrl_if  1,
  .ep_audio_r = 0x86ep_audio_r 08java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
  . LINE6_PODX3LIVE={
  .id "ODX3LIVE,
 [ .name = "POD X3",
  .id =   . = LINE6_CAP_CONTROL|LINE6_CAP_CONTROL_INFO
  name=" HD500X",
  .capabilities = LINE6_CAP_CONTROL | LINE6_CAP_HWMON_CTL
    | LINE6_CAP_PCM  altsetting=1java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
  .altsetting = 1,
  .ep_ctrl_r = 0x81
  .ep_audio_r= 0x86
  .ctrl_if  . = 0x02
  .java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 3
  ep_audio_w x02
 },
 [LINE6_PODHDDESKTOP.capabilities =LINE6_CAP_CONTROL LINE6_CAP_HWMON_CTL
 .id ="",
 name" HDDESKTOP",
  . .p_ctrl_r 0,
   | LINE6_CAP_PCM ep_ctrl_w 0x01,
  .altsetting .trl_if,
 .ep_ctrl_r= 0x81,
  .ep_ctrl_wep_audio_w x02
  .ctrl_if,
  .p_audio_r=x8,
  .ep_audio_w.id "PODHDDESKTOP",
 },
};

/*
Probe USB device.
*/

static int . = 1
          structusb_device_idid)
{
 return  . = 0x01
    .trl_if,
  podhd_init sizeofstructusb_line6_podhd));
}

static struct usb_driver podhd_driver java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 static podhd_probe  *interface
 .robepodhd_probe
 .disconnect = return line6_p(interfaceid,"",
#ifdef CONFIG_PM
 .suspend =   &odhd_properties_tablei>driver_info
 resume,
 .reset_resume =

 .d_table =podhd_id_table,
}. = ,

()java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32

MODULE_DESCRIPTION
MODULE_LICENSEGPL

Messung V0.5
C=97 H=89 G=93

¤ Dauer der Verarbeitung: 0.5 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.