Linux Device Driver Analysis-SPI (III)

Source: Internet
Author: User

       spi_device    *                     u8            * };

  N_SPI_MINORS            32    /* ... up to 256 */   DECLARE_BITMAP(minors, N_SPI_MINORS);

 DECLARE_BITMAP(name,bits) \ name[BITS_TO_LONGS(bits)]

   spidev_open( inode *inode,  file *      spidev_data    *                 status = -      mutex_lock(&           list_for_each_entry(spidev, &          (spidev->devt == inode->             status =                    (status ==           (!spidev->             spidev->buffer =              (!spidev->                 dev_dbg(&spidev->spi->dev,                  status = -          (status ==              spidev->users++             filp->private_data =     }          pr_debug(      mutex_unlock(&      }

  spidev_write( file *filp,   __user *         size_t count, loff_t *      spidev_data    *     ssize_t            status =      unsigned             (count >          -      spidev = filp->      mutex_lock(&spidev->     missing = copy_from_user(spidev->      (missing ==          status =     }          status = -     mutex_unlock(&spidev->       }

  spidev_sync_write( spidev_data *      spi_transfer    t =             .tx_buf        = spidev->             .len        =           spi_message_init(&     spi_message_add_tail(&t, &      spidev_sync(spidev, & }

                *             *       unsigned    cs_change:       };

             spi_device    *      unsigned        is_dma_mapped:                             (*complete)( *                 *                                 * };

  inline  spi_message_init( spi_message *     memset(m, ,  *     INIT_LIST_HEAD(&m-> }

  inline  spi_message_add_tail( spi_transfer *t,  spi_message *     list_add_tail(&t->transfer_list, &m-> }

  spidev_sync( spidev_data *spidev,  spi_message *           message->complete =     message->context = &      spin_lock_irq(&spidev->      (spidev->spi ==         status = -              status = spi_async(spidev->     spin_unlock_irq(&spidev->       (status ==          wait_for_completion(&         status = message->          (status ==              status = message->      }

   spidev_complete( * }

  spi_async( spi_device *spi,  spi_message *      spi_master *master = spi->          unsigned       spin_lock_irqsave(&master->       (master->         ret = -              ret =      spin_unlock_irqrestore(&master->       }

   __spi_async( spi_device *spi,  spi_message *      spi_master *master = spi->            ((master->flags &             || (spi->mode &          spi_transfer *         unsigned flags = master->          list_for_each_entry(xfer, &message->              (xfer->rx_buf && xfer->                  -              ((flags & SPI_MASTER_NO_TX) && xfer->                  -              ((flags & SPI_MASTER_NO_RX) && xfer->                  -      message->spi =     message->status = -      master-> }

   s3c64xx_spi_transfer( spi_device *                          spi_message *      s3c64xx_spi_driver_data *     unsigned       sdd = spi_master_get_devdata(spi->      spin_lock_irqsave(&sdd->       (sdd->state &         spin_unlock_irqrestore(&sdd->          -      msg->status = -     msg->actual_length =       list_add_tail(&msg->queue, &sdd->      queue_work(sdd->workqueue, &sdd->      spin_unlock_irqrestore(&sdd->        }

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.