Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7979333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:45:02+00:00 2026-06-04T09:45:02+00:00

I want to access an SPI device (an optical mouse device from Avago Tech)

  • 0

I want to access an SPI device (an optical mouse device from Avago Tech) on an embedded Linux system using the SPIDEV driver. The device is connected to SPI0.

I enabled SPI and “User mode SPI device driver support” in menuconfig > “Device Drivers” > “SPI”.

I added the code to the board.c file

static struct spi_board_info spidev_board_info[] {
    {
        .modalias = "spidev",
        .max_speed_hz = 1000000,
        .bus_num = 1,
        .chips_select = 0,
        .mode = SPI_MODE_3,
    },
    {
        .modalias = "spidev",
        .max_speed_hz = 1000000,
        .bus_num = 1,
        .chips_select = 1,
        .mode = SPI_MODE_3,
    },
};
spi_register_board_info(spidev_board_info, ARRAY_SIZE(spidev_board_info));

I tried both 500000 and 1000000 as max_speed_hz (1Mhz being the highest allowed by the sensor). SPI_MODE_3 is correct, checked on the datasheet. bus_num = 1 should correct as it refers to SPI0 (I also tried = 0 out of curiosity).

I checked the electrical connections and are all working.

The kernel compiles and the image starts correctly, but I cannot find any device in /sys/class/spidev/ (neither in /sys/bus/spi/…). No reference to SPI appears during system boot either.

Any idea on where the problem can be?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T09:45:03+00:00Added an answer on June 4, 2026 at 9:45 am

    I think that with the Atmel boards, you are supposed to register the devices with the at91_add_device_spi function. It would then be:

    at91_add_device_spi(spidev_board_info, ARRAY_SIZE(spidev_board_info));
    

    At least you have to make sure that this function gets called by your board support file board-sam9x5ek.c so that the SPI master controller gets initialized. If this is done, your above proposed initialization is correct.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want access a STL based container read-only from parallel running threads. Without using
I want to access an online music library from my android application to play
Using the publish_post hook, I want access to the email address of the user
I want to access/add/read etc google calender from my Android program. I have tried
I want to access MySQL through ruby on a shared linux server. I figure
I want access to a picture using image.setImageResource(R.drawable.photo1); How can I change photo1 to
When you want access a std::vector as a C array you can choose from
I am using App Delegate object in different classes. I want access it in
I want access to my Google+-Timeline for an iOS-App. Following the Google-Documentation I imported
I want to access an online MySQL database in order to retrieve and manipulate

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.