Converting Linux driver for SPI device to run on USB-to-SPI bridge












1















I have a Holt HI-3110 chip that implements a CAN bus interface that is run over an SPI host interface. A driver for the chip is in the Linux mainline (in /drivers/net/can/spi). I'm targeting a host platform with no SPI host interface, so I've installed a Microchip MCP2210 USB-to-SPI bridge that is also supported in the Linux mainline (in /drivers/hid). Banging on the /dev/hidraw0 device from user code seems to work fine.



I assume I need to convert the SPI driver to a platform driver that looks for the correct hid driver and uses it to get to the CAN chip. Can someone point me to a driver that does something similar (using another driver to get to a device)?










share|improve this question























  • You mean you want to connect USB to SPI to CAN, when there are USB to CAN adapters?

    – sawdust
    Jan 10 at 8:16











  • E.g.: Bluetooth has several transport drivers, as does HID itself (e.g. HID over I2C as opposed over USB). I am not sure if there's a "standard" way in the kernel to do this.

    – dirkt
    Jan 12 at 13:04
















1















I have a Holt HI-3110 chip that implements a CAN bus interface that is run over an SPI host interface. A driver for the chip is in the Linux mainline (in /drivers/net/can/spi). I'm targeting a host platform with no SPI host interface, so I've installed a Microchip MCP2210 USB-to-SPI bridge that is also supported in the Linux mainline (in /drivers/hid). Banging on the /dev/hidraw0 device from user code seems to work fine.



I assume I need to convert the SPI driver to a platform driver that looks for the correct hid driver and uses it to get to the CAN chip. Can someone point me to a driver that does something similar (using another driver to get to a device)?










share|improve this question























  • You mean you want to connect USB to SPI to CAN, when there are USB to CAN adapters?

    – sawdust
    Jan 10 at 8:16











  • E.g.: Bluetooth has several transport drivers, as does HID itself (e.g. HID over I2C as opposed over USB). I am not sure if there's a "standard" way in the kernel to do this.

    – dirkt
    Jan 12 at 13:04














1












1








1








I have a Holt HI-3110 chip that implements a CAN bus interface that is run over an SPI host interface. A driver for the chip is in the Linux mainline (in /drivers/net/can/spi). I'm targeting a host platform with no SPI host interface, so I've installed a Microchip MCP2210 USB-to-SPI bridge that is also supported in the Linux mainline (in /drivers/hid). Banging on the /dev/hidraw0 device from user code seems to work fine.



I assume I need to convert the SPI driver to a platform driver that looks for the correct hid driver and uses it to get to the CAN chip. Can someone point me to a driver that does something similar (using another driver to get to a device)?










share|improve this question














I have a Holt HI-3110 chip that implements a CAN bus interface that is run over an SPI host interface. A driver for the chip is in the Linux mainline (in /drivers/net/can/spi). I'm targeting a host platform with no SPI host interface, so I've installed a Microchip MCP2210 USB-to-SPI bridge that is also supported in the Linux mainline (in /drivers/hid). Banging on the /dev/hidraw0 device from user code seems to work fine.



I assume I need to convert the SPI driver to a platform driver that looks for the correct hid driver and uses it to get to the CAN chip. Can someone point me to a driver that does something similar (using another driver to get to a device)?







linux linux-kernel linux-device-driver






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 9 at 22:45









Dc DesignsDc Designs

61




61













  • You mean you want to connect USB to SPI to CAN, when there are USB to CAN adapters?

    – sawdust
    Jan 10 at 8:16











  • E.g.: Bluetooth has several transport drivers, as does HID itself (e.g. HID over I2C as opposed over USB). I am not sure if there's a "standard" way in the kernel to do this.

    – dirkt
    Jan 12 at 13:04



















  • You mean you want to connect USB to SPI to CAN, when there are USB to CAN adapters?

    – sawdust
    Jan 10 at 8:16











  • E.g.: Bluetooth has several transport drivers, as does HID itself (e.g. HID over I2C as opposed over USB). I am not sure if there's a "standard" way in the kernel to do this.

    – dirkt
    Jan 12 at 13:04

















You mean you want to connect USB to SPI to CAN, when there are USB to CAN adapters?

– sawdust
Jan 10 at 8:16





You mean you want to connect USB to SPI to CAN, when there are USB to CAN adapters?

– sawdust
Jan 10 at 8:16













E.g.: Bluetooth has several transport drivers, as does HID itself (e.g. HID over I2C as opposed over USB). I am not sure if there's a "standard" way in the kernel to do this.

– dirkt
Jan 12 at 13:04





E.g.: Bluetooth has several transport drivers, as does HID itself (e.g. HID over I2C as opposed over USB). I am not sure if there's a "standard" way in the kernel to do this.

– dirkt
Jan 12 at 13:04










0






active

oldest

votes











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
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: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
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%2fsuperuser.com%2fquestions%2f1392485%2fconverting-linux-driver-for-spi-device-to-run-on-usb-to-spi-bridge%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Super User!


  • 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%2fsuperuser.com%2fquestions%2f1392485%2fconverting-linux-driver-for-spi-device-to-run-on-usb-to-spi-bridge%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?