Constructor

When everything is ready, finally we can create a new control. To create a control, there are two functions to be called, snd_ctl_new1() and snd_ctl_add().

In the simplest way, you can do like this:


  err = snd_ctl_add(card, snd_ctl_new1(&my_control, chip));
  if (err < 0)
          return err;

          

snd_ctl_new1() allocates a new snd_kcontrol instance (that's why the definition of my_control can be with the __devinitdata prefix), and snd_ctl_add assigns the given control component to the card.