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 icense-Identifier:/*
#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 * Copyright (C) 201 *java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 firmware_versionjava.lang.StringIndexOutOfBoundsException: Range [20, 2) out of bounds for length 20
 /* Serial number of device */
u2serial_number

.num_step  ,
 int firmware_version;

 /* 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 = 4 . = ,
 ;
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 .den =  playback_hw
};

static struct line6_pcm_properties podhd_pcm_properties = {
 .playback_hw java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
          |
   SNDRV_PCM_INFO_PAUSE   SNDRV_PCM_INFO_SYNC_START
     S |
        SNDRV_PCM_INFO_MMAP_VALID |
        |
      ),
      .formats = SNDRV_PCM_FMTBIT_S24_3LE,
  .rate_min =400
     rate_max400java.lang.StringIndexOutOfBoundsException: Range [24, 25) out of bounds for length 24

   channels_min=2
  .hannels_max,
      .buffer_bytes_max = 60000,
      .period_bytes_min = 64,
     .eriods_min1java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
   infoSNDRV_PCM_INFO_MMAP
    periods_max12},
   SNDRV_PCM_INFO_BLOCK_TRANSFER|
     .info = (SNDRV_PCM_INFO_MMAP |
       SNDRV_PCM_INFO_INTERLEAVED |
    SNDRV_PCM_INFO_MMAP_VALID     ),
     SNDRV_PCM_INFO_MMAP_VALID
     . = SNDRV_PCM_RATE_48000
  formats SNDRV_PCM_FMTBIT_S24_3LE
  rates = SNDRV_PCM_RATE_48000java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
  .ate_min 80,
     .rate_max = 48000,
     .channels_min = 2,
     .channels_max = 2,
     .  .period_bytes_min  6,
   .eriod_bytes_min 4java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
 rates
   .periods_min  ,
     .periods_max = 1024},
 .rates = {
       .    rats&podhd_ratden}
     rats&},
 .
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

static struct line6_pcm_properties podx3_pcm_properties = {
 .playback_hw = {
  . = java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
        SNDRV_PCM_INFO_INTERLEAVED |
  R |
        SNDRV_PCM_INFO_MMAP_VALID
        SNDRV_PCM_INFO_PAUSE |
        SNDRV_PCM_INFO_SYNC_START),
    formats=SNDRV_PCM_FMTBIT_S24_3LE
        SNDRV_PCM_INFO_MMAP_VALID|
      .rate_min = 48000,
      .rate_max = 48000,
      .channels_min = 2,
      .channels_max = 2,
      .buffer_bytes_max = 60000,
      .period_bytes_min = 64,
      .period_bytes_max = 8192,
      .periods_min = 1,
      .periods_max = 1024},
 .       SNDRV_PCM_INFO_PAUSE |
     .info = (SNDRV_PCM_INFO_MMAP |
       SNDRV_PCM_INFO_INTERLEAVED |
       SNDRV_PCM_INFO_BLOCK_TRANSFER       SNDRV_PCM_INFO_SYNC_START,
        |
       SNDRV_PCM_INFO_SYNC_START,
     .formats = SNDRV_PCM_FMTBIT_S24_3LE,
     .rates = SNDRV_PCM_RATE_48000,
     .rate_min   .rates = SNDRV_PCM_RATE_48000
     .rate_max =400,
     /* 1+2: Main signal (out), 3+4: Tone 1,
  * 5+6: Tone 2, 7+8: raw
  */

     .channels_min = 8,
     .channels_max = 8,
     .buffer_bytes_max = 60000,
     .period_bytes_min = 64,
     .period_bytes_max = 8192,
     .periods_min = 1,
     .periods_max = 1024},
 .rates = {
       .nrats = 1,
       .rats =  ,
 .bytes_per_channel = 3 /* SNDRV_PCM_FMTBIT_S24_3LE */
};
static struct usb_driver podhd_driver;

static ssize_t_in= ,
     .eriods_max= 104,
{
 struct snd_card *card = dev_to_snd_card(dev);
 struct usb_line6_podhdpod = card-;

 return sysfs_emit(buf, "%u\n", pod->     SNDRV_PCM_INFO_BLOCK_TRANSFER |
}

 ssize_tfirmware_version_showstructdevice *ev,
        struct *attrcharbuf)
{
s snd_cardcarddev_to_snd_card();
      /* 1+2: Main signal (out), 3+4: Tone 1,

return sysfs_emit(buf, "%06x\n", pod->firmware_version);
}

static DEVICE_ATTR_RO(firmware_version);
static DEVICE_ATTR_RO(serial_number);

static struct attribute *podhd_dev_attrs[] = {
&dev_attr_firmware_version.attr,
&dev_attr_serial_number.attr,
NULL
};

static const struct attribute_group podhd_dev_attr_group = {
.name = "podhd",
.attrs = podhd_dev_attrs,
};

/*
 * 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)
{
 int ret;
 u8[8;
 int i;
 struct usb_device *usbdev =}

 ret = usb_control_msg_send(usbdev, 0,
staticssize_t(struct *
 x11
   java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
if
  java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 1
   ;
 }

 NOTE like kind  message
ret(usbdev,
      ,
  0, x0}java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
   name",
ifret
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   "receive length failed (error %d)\n", * previous POD setup. * audio nor  *
  exit
 }

 pod->firmware_version
 []<1 init_bytes <8 init_bytes][8java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18

  (=;i<1 + 
  ret =  , | |USB_DIR_OUT
  ( <0
   exit f () java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2

 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  ,
  USB_TYPE_STANDARD  |USB_DIR_OUT
    x11x0
  ,0 , );
exit
  ret
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

(init_bytes< )| init_bytes<8  init_bytes <)
{
 struct

 podhd_dev_start(pod);
 line6_read_serial_number(&pod-  (pod-, 0 +x08,init_bytes)java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
 
 dev_err>, Failedregister HD.);
}

static void podhd_disconnect(struct usb_line6 *line6)
{
    ,0java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10

 if (pod->line6.properties->capabilities &exit
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

  intf = usb_ifnum_to_if(line6->usbdev
    >line6>ctrl_if
   (ntf
   (&,intf
 }
}

static const unsigned int float_zero_to_one_lookup[] = {
x00000000x3c23d70a x3ca3d70a0cf5c28f, x3d4ccccd
0x3d75c28f
0x3df5c28f,x3e0f5c29x3e19999ax3e23d70a x3e2e147b
0x3e3851ec, 0x3e428f5c
03, 0x3e800000,0e8a3d71,x3e947ae1
0x3e99999a usb_interface;
0x3eb851ec, 0x3ebd70a4, 0x3ec28f5c, 0x3ec7ae14, 0x3ecccccdjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
0x3ed70a3dx3edc28f60,x3ee66666, 03ef0a3d7
0x3ef5c28f, 0x3efae148, 0java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 11
0x3f0a3d710x3f0ccccd0x3f0f5c290, 0x3f147ae1,0,
0x3f19999a, 0x3f1c28f6, 0x3f1eb852
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
x3f3851ecx3f3ae148x3f3d70a40, 0x3f428f5cx3f451eb8
0x3f47ae14, 0x3f4a3d71, 0x3f4ccccd, 0x3f4f5c29, 0x3f51eb85, 0x3f547ae1,
0, 0x3f59999axf5c28f60, 0x3f6147ae0,
0x3f666666, 0, 0x3da3d70a x3db851ecx3dcccccd0x3de147ae
, 0x3f7851ec,0x3f7ae148,x37d70a4, 0x3f800000
}0, 0x3e428f5c0, 0x3e570a3d03e6147ae, 0,

x3e75c28f0, 0x3e851eb8 0, 0, 0x3e947ae1
{xe99999ax3e9eb852x3ea3d70a0x3ea8f5c3, x3eae147b0,
 unsignedintfl;
 staticconst char msg1]={
  /* Chunk is 0xc bytes (without first word) */

  /* First chunk in the message */

  0, 0x3f1c28f60f1eb852x3f2147ae,0, 0x3f266666,
  0x02, 0x00,
  /* Unknown */
  x040,
  /* Unknown */x3f3851ec0, 0x3f3d70a40x3f400000, 0x3f428f5c, 0,
 , 0x00,
  /* Volume, LE float32, 0.0 - 1.0 */
  00,0x00, x00x0
 };
unsigned *buf;

 unsigned intfl;
 if (!buf
  return;

 if /
  value =0

 if (value  x0c0,
  /

 fl =  x01,0,

 buf[2  fl>)&0;
 buf[13] = (fl >> 8) & 00x02, 0,
 buf/* Unknown */
b[15  fl >2)& xff

 (&podhd-, , sizeof))
 kfreebuf

 podhd->monitor_level = value;
}

/* control info callback */
static int snd_podhd_control_monitor_info(struct snd_kcontrol *kcontrol,
     struct snd_ctl_elem_info *uinfo) 0, 0, 0x0000
{
 uinfo->type;
 uinfo->count = 1;
 info-.integer =0
 uinfo- = kmemdup, sizeof),GFP_KERNEL)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
 uinfo-.integer =1
  value  () -;
}

/* control get callback */
static int snd_podhd_control_monitor_get(
            snd_ctl_elem_value)
{
 struct[13]=( >> 8  0;
 truct *podhd=line6_to_podhd>line6

 >valueinteger[0] =podhd-;
 return 0java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}

/* control put callback */
static int snd_podhd_control_monitor_put(struct snd_kcontrol *kcontrol,
           snd_ctl_elem_value*control
{
 struct java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0
 struct usb_line6_podhd *podhd = line6_to_podhd(line6pcm->line6);

 if (ucontrol->value
  return;

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

/* control definition */
static const struct snd_kcontrol_new podhd_control_monitor =java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 32
 .iface=SNDRV_CTL_ELEM_IFACE_MIXER
 .ame " Playback Volume"java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
 .indexstaticint snd_podhd_control_monitor_get snd_kcontrolkcontrol
. = SNDRV_CTL_ELEM_ACCESS_READWRITE
 .info = snd_podhd_control_monitor_info
 getsnd_podhd_control_monitor_get
 putsnd_podhd_control_monitor_put
};

/*
Try to init POD HD device.
*/

static
        static  snd_podhd_control_monitor_put  *,
{
 int snd_line6_pcm =snd_kcontrol_chip)java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
ifvalue0 >java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
 struct usb_interface *intf;

  .ifaceSNDRV_CTL_ELEM_IFACE_MIXER
line6- = podhd_startup

 if (pod->line6.properties->capabilities & LINE6_CAP_CONTROL) {
  /* claim the data interface */
   .get ,
   pod-.properties-);
 f(intf
   dev_err
    pod->line6.properties->ctrl_if*
   return-;
  }

  err ={
  if (err != 0) {
  dev_err(od-line6, "' d d\"java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   return
 java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
 }

 if!) {
*create entries*
    (line6-,&);
  if return-;
   return err err=(&, , );
 }

 ifpod-.properties- & ) {
  /* initialize PCM subsystem: */>line6>ctrl_if);
  err = line6_init_pcm(line6,
r_info=LINE6_PODX3||
   
   
f err )
  return;
 }

 if (pod->line6.properties->capabilities   err0
  java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 2
  err =   /* initialize PCM subsystem: */
       (id->driver_info |
          >line6pcm)java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
 if(rr<0
   return err;
 }

  ((>line6>  LINE6_CAP_CONTROL_INFO 
   =snd_ctl_add>card
  snd_card_register>card
 }

 /* init device and delay registering */
(line6-,
         msecs_to_jiffies;
 return 0;
}

#define LINE6_DEVICE(prod snd_card_register>card
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

/* table of devices that work with this driver */
 conststruct podhd_id_table  java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
 { LINE6_DEVICE(0x5057LINE6_IF_NUM, )USB_DEVICE_INTERFACE_NUMBER0x0e41 , java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
_PODHD400,
 { LINE6_IF_NUM(0x414D, 0), .driver_info = LINE6_PODHD500 },
 { LINE6_IF_NUM(0x414A /* TODO: no need to alloc data interfaces when only audio is used */ LINE6_DEVICE),    .river_info  LINE6_PODHD300}
{LINE6_IF_NUMx414B ), .river_info=  }
 {  { LINE6_IF_NUM, 0,. = }
{LINE6_IF_NUM,0,. =LINE6_PODHDDESKTOP}
 {}


, podhd_id_table;

static
 LINE6_PODHD300
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  .name = "POD HD300",
 . =LINE6_CAP_PCM
   ,
 . ="POD HD300,
0x84
 ep_ctrl_wx03
  .ep_audio_r . =x84
1,
 },
[]  
 }java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
 . =POD
 =java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
    | .  x03
 a =,
  .ep_ctrl_r = }
 . = x03
. = x82
 ep_audio_w0,
 }java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
 [LINE6_PODHD500 ctrl_if1
  . .ep_ctrl_r,
  .ame" "
  .capabilities =0,
 | |,
  .}
 =1
.ep_ctrl_r0,
  . namePOD"java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
 . = x86
. =0,
 ,

  =1
"java.lang.StringIndexOutOfBoundsException: Range [19, 20) out of bounds for length 19
 capabilities |java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
   | |,
  .altsetting = |   |LINE6_CAP_IN_NEEDS_OUT
  .ep_ctrl_raltsetting,
  e = 0,
  .ctrl_if=1,
  . = 08,
  .ep_audio_w = 0x02,
 },
[]  
  =""
 LIVE
 capabilities |
    | LINE6_CAP_PCM. =PODjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
. =,
  .ep_ctrl_r = 0x81,
  .ep_ctrl_w = 0x01,
  .ctrl_if =ep_ctrl_r,
 . =0,
 ep_audio_w,
 },
 [LINE6_PODHD500X] = {
. =0,
  ,
  capabilities  |
    | id PODHDDESKTOP
  . . = POD
  e = x81
  . = 0x01
 . = 1
   =x81
  . =0,
 }
 [ e =06
   =",
  .name
  .capabilities
   | LINE6_CAP_PCM
  altsetting1
  .ep_ctrl_r       const  *)
 ep_ctrl_w,
 c = 1
  .    , ( usb_line6_podhd
  .ep_audio_w = 0x02,
 },
};

/*
Probe USB device.
*/

 int(structusb_interface,
         . = ,
{
robe, id,"ine6-PODHD"java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
     &odhd_properties_table[d-],
      podhd_init,. = line6_resume
}

.d_table podhd_id_table
 nameKBUILD_MODNAME
 .probe = podhd_probe,
 .disconnect = line6_disconnect,
#ifdef CONFIG_PM
 .suspend = riverpodhd_driver;
 .resume = line6_resume,
 .reset_resume = line6_resume,
#endif
 .id_table = podhd_id_table,
};

module_usb_driver(podhd_driver("GPL");

MODULE_DESCRIPTION("Line 6 PODHD USB driver");
MODULE_LICENSE("GPL");

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.