Driver for 3.5mm Jack












0















I was wondering whether it is possible to write Linux Drivers for the 3.5mm jack to use it for non-audio purposes. How does the linux kernel identify that a device is inserted into the 3.5mm slot? What are the interfaces in the linux kernel I could use for this purpose?










share|improve this question























  • Notice that many phones and tablets (running android/linux) detect whether some serial adaptor is connected to the 3.5mm jack upon starting up and redirect the serial console there -- but I don't think that the linux kernel has anything to say into it, or that it could just turn that on and off (I may be wrong, though). Anyways, that's highly device specific, you'll have to obtain some (possibly confidential) hardware manual.

    – mosvy
    Feb 12 at 8:35











  • and beware that that's 3.3v not 5v !

    – mosvy
    Feb 12 at 8:39











  • Gautam are you talking about a specific piece of hardware here? There's no requirement for a computer to have a 3.5mm jack. Perhaps you're referring to a Pi or some other common SOC? But if this is the case you need to say so.

    – roaima
    Feb 12 at 9:43













  • No specific hardware in mind. Just wanted to ask in a general sense.

    – Gautam Ramakrishnan
    Feb 13 at 1:34
















0















I was wondering whether it is possible to write Linux Drivers for the 3.5mm jack to use it for non-audio purposes. How does the linux kernel identify that a device is inserted into the 3.5mm slot? What are the interfaces in the linux kernel I could use for this purpose?










share|improve this question























  • Notice that many phones and tablets (running android/linux) detect whether some serial adaptor is connected to the 3.5mm jack upon starting up and redirect the serial console there -- but I don't think that the linux kernel has anything to say into it, or that it could just turn that on and off (I may be wrong, though). Anyways, that's highly device specific, you'll have to obtain some (possibly confidential) hardware manual.

    – mosvy
    Feb 12 at 8:35











  • and beware that that's 3.3v not 5v !

    – mosvy
    Feb 12 at 8:39











  • Gautam are you talking about a specific piece of hardware here? There's no requirement for a computer to have a 3.5mm jack. Perhaps you're referring to a Pi or some other common SOC? But if this is the case you need to say so.

    – roaima
    Feb 12 at 9:43













  • No specific hardware in mind. Just wanted to ask in a general sense.

    – Gautam Ramakrishnan
    Feb 13 at 1:34














0












0








0








I was wondering whether it is possible to write Linux Drivers for the 3.5mm jack to use it for non-audio purposes. How does the linux kernel identify that a device is inserted into the 3.5mm slot? What are the interfaces in the linux kernel I could use for this purpose?










share|improve this question














I was wondering whether it is possible to write Linux Drivers for the 3.5mm jack to use it for non-audio purposes. How does the linux kernel identify that a device is inserted into the 3.5mm slot? What are the interfaces in the linux kernel I could use for this purpose?







linux-kernel drivers






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Feb 12 at 3:56









Gautam RamakrishnanGautam Ramakrishnan

132




132













  • Notice that many phones and tablets (running android/linux) detect whether some serial adaptor is connected to the 3.5mm jack upon starting up and redirect the serial console there -- but I don't think that the linux kernel has anything to say into it, or that it could just turn that on and off (I may be wrong, though). Anyways, that's highly device specific, you'll have to obtain some (possibly confidential) hardware manual.

    – mosvy
    Feb 12 at 8:35











  • and beware that that's 3.3v not 5v !

    – mosvy
    Feb 12 at 8:39











  • Gautam are you talking about a specific piece of hardware here? There's no requirement for a computer to have a 3.5mm jack. Perhaps you're referring to a Pi or some other common SOC? But if this is the case you need to say so.

    – roaima
    Feb 12 at 9:43













  • No specific hardware in mind. Just wanted to ask in a general sense.

    – Gautam Ramakrishnan
    Feb 13 at 1:34



















  • Notice that many phones and tablets (running android/linux) detect whether some serial adaptor is connected to the 3.5mm jack upon starting up and redirect the serial console there -- but I don't think that the linux kernel has anything to say into it, or that it could just turn that on and off (I may be wrong, though). Anyways, that's highly device specific, you'll have to obtain some (possibly confidential) hardware manual.

    – mosvy
    Feb 12 at 8:35











  • and beware that that's 3.3v not 5v !

    – mosvy
    Feb 12 at 8:39











  • Gautam are you talking about a specific piece of hardware here? There's no requirement for a computer to have a 3.5mm jack. Perhaps you're referring to a Pi or some other common SOC? But if this is the case you need to say so.

    – roaima
    Feb 12 at 9:43













  • No specific hardware in mind. Just wanted to ask in a general sense.

    – Gautam Ramakrishnan
    Feb 13 at 1:34

















Notice that many phones and tablets (running android/linux) detect whether some serial adaptor is connected to the 3.5mm jack upon starting up and redirect the serial console there -- but I don't think that the linux kernel has anything to say into it, or that it could just turn that on and off (I may be wrong, though). Anyways, that's highly device specific, you'll have to obtain some (possibly confidential) hardware manual.

– mosvy
Feb 12 at 8:35





Notice that many phones and tablets (running android/linux) detect whether some serial adaptor is connected to the 3.5mm jack upon starting up and redirect the serial console there -- but I don't think that the linux kernel has anything to say into it, or that it could just turn that on and off (I may be wrong, though). Anyways, that's highly device specific, you'll have to obtain some (possibly confidential) hardware manual.

– mosvy
Feb 12 at 8:35













and beware that that's 3.3v not 5v !

– mosvy
Feb 12 at 8:39





and beware that that's 3.3v not 5v !

– mosvy
Feb 12 at 8:39













Gautam are you talking about a specific piece of hardware here? There's no requirement for a computer to have a 3.5mm jack. Perhaps you're referring to a Pi or some other common SOC? But if this is the case you need to say so.

– roaima
Feb 12 at 9:43







Gautam are you talking about a specific piece of hardware here? There's no requirement for a computer to have a 3.5mm jack. Perhaps you're referring to a Pi or some other common SOC? But if this is the case you need to say so.

– roaima
Feb 12 at 9:43















No specific hardware in mind. Just wanted to ask in a general sense.

– Gautam Ramakrishnan
Feb 13 at 1:34





No specific hardware in mind. Just wanted to ask in a general sense.

– Gautam Ramakrishnan
Feb 13 at 1:34










2 Answers
2






active

oldest

votes


















-1














That jack is a part of your (possibly integrated) sound card, so you would have to write a driver for your sound card that treats it as something other than a sound card.






share|improve this answer































    0














    Not all 3.5mm jacks are capable of detecting that something is plugged in. It requires an extra hardware contact in the jack that is designed to become grounded if a plug is inserted, a pull-up resistor and a connection to a suitable GPIO input pin that can then be used for detection.



    ALSA includes a programming interface for such detection, as most 3.5mm jacks tend to be connected to sound cards. If you are using such a jack for some other purpose (e.g. as an alternative serial port connector) and it has a plug detection contact, you might wire it into any suitable GPIO (General-Purpose Input/Output) input pin in your hardware. Then, if the chip the plug detection pin is wired to does not already have a GPIO driver, you might first write a generic GPIO driver for it, and then your design-specific plug detection driver on top of it.






    share|improve this answer























      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "106"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f500091%2fdriver-for-3-5mm-jack%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      -1














      That jack is a part of your (possibly integrated) sound card, so you would have to write a driver for your sound card that treats it as something other than a sound card.






      share|improve this answer




























        -1














        That jack is a part of your (possibly integrated) sound card, so you would have to write a driver for your sound card that treats it as something other than a sound card.






        share|improve this answer


























          -1












          -1








          -1







          That jack is a part of your (possibly integrated) sound card, so you would have to write a driver for your sound card that treats it as something other than a sound card.






          share|improve this answer













          That jack is a part of your (possibly integrated) sound card, so you would have to write a driver for your sound card that treats it as something other than a sound card.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Feb 12 at 4:03









          FoxFox

          5,52711233




          5,52711233

























              0














              Not all 3.5mm jacks are capable of detecting that something is plugged in. It requires an extra hardware contact in the jack that is designed to become grounded if a plug is inserted, a pull-up resistor and a connection to a suitable GPIO input pin that can then be used for detection.



              ALSA includes a programming interface for such detection, as most 3.5mm jacks tend to be connected to sound cards. If you are using such a jack for some other purpose (e.g. as an alternative serial port connector) and it has a plug detection contact, you might wire it into any suitable GPIO (General-Purpose Input/Output) input pin in your hardware. Then, if the chip the plug detection pin is wired to does not already have a GPIO driver, you might first write a generic GPIO driver for it, and then your design-specific plug detection driver on top of it.






              share|improve this answer




























                0














                Not all 3.5mm jacks are capable of detecting that something is plugged in. It requires an extra hardware contact in the jack that is designed to become grounded if a plug is inserted, a pull-up resistor and a connection to a suitable GPIO input pin that can then be used for detection.



                ALSA includes a programming interface for such detection, as most 3.5mm jacks tend to be connected to sound cards. If you are using such a jack for some other purpose (e.g. as an alternative serial port connector) and it has a plug detection contact, you might wire it into any suitable GPIO (General-Purpose Input/Output) input pin in your hardware. Then, if the chip the plug detection pin is wired to does not already have a GPIO driver, you might first write a generic GPIO driver for it, and then your design-specific plug detection driver on top of it.






                share|improve this answer


























                  0












                  0








                  0







                  Not all 3.5mm jacks are capable of detecting that something is plugged in. It requires an extra hardware contact in the jack that is designed to become grounded if a plug is inserted, a pull-up resistor and a connection to a suitable GPIO input pin that can then be used for detection.



                  ALSA includes a programming interface for such detection, as most 3.5mm jacks tend to be connected to sound cards. If you are using such a jack for some other purpose (e.g. as an alternative serial port connector) and it has a plug detection contact, you might wire it into any suitable GPIO (General-Purpose Input/Output) input pin in your hardware. Then, if the chip the plug detection pin is wired to does not already have a GPIO driver, you might first write a generic GPIO driver for it, and then your design-specific plug detection driver on top of it.






                  share|improve this answer













                  Not all 3.5mm jacks are capable of detecting that something is plugged in. It requires an extra hardware contact in the jack that is designed to become grounded if a plug is inserted, a pull-up resistor and a connection to a suitable GPIO input pin that can then be used for detection.



                  ALSA includes a programming interface for such detection, as most 3.5mm jacks tend to be connected to sound cards. If you are using such a jack for some other purpose (e.g. as an alternative serial port connector) and it has a plug detection contact, you might wire it into any suitable GPIO (General-Purpose Input/Output) input pin in your hardware. Then, if the chip the plug detection pin is wired to does not already have a GPIO driver, you might first write a generic GPIO driver for it, and then your design-specific plug detection driver on top of it.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Feb 12 at 8:54









                  telcoMtelcoM

                  18.4k12347




                  18.4k12347






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Unix & Linux Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f500091%2fdriver-for-3-5mm-jack%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      How to reconfigure Docker Trusted Registry 2.x.x to use CEPH FS mount instead of NFS and other traditional...

                      is 'sed' thread safe

                      How to make a Squid Proxy server?