• Linux greybus


    背景

    在研究高通平台驱动震动马达时,我需要为内核驱动实现以下功能:/sys/class/timed_output/vibrator/enable":sysfs文件系统注册接口、提供showstore方法。

    根据前人提供的文档(Android 5),我在Android 10 的代码中 跟踪挖出一种叫做 greybus 的总线,替代了 timed_out_dev 。

    觉得还挺有意思的,网上没有对应的中文文档,分享一下。

    介绍

    Greybus是Google Project Ara的一部分(该项目是9月份结束的模块化智能手机计划),作为一种框架,它允许“通用”摄像机、音频设备和其他类设备,以及一个桥接的“物理”层协议,可以与串行、spi、uart、pwm、gpio、i2c甚至USB主机控制器进行通信。

    附录: greybus 子系统的 提交请求

    https://lkml.org/lkml/2016/9/14/250

    [GIT PULL] Greybus driver subsystem for 4.9-rc1

    From: Greg KH

    Date: Wed Sep 14 2016 - 06:09:58 EST

    Hi all,
    
    As many of you know, I, and lots of other developers, have been working
    on a new application level protocol for the Unipro hardware transport
    called "Greybus".  It has shown up in numerous demos from Google for the
    Ara Phone platform, and an older version of the codebase is currently
    shipping in a phone from Motorola any-day-now.  There is a
    semi-up-to-date version of the protocol specification available at:
    	https://github.com/projectara/greybus-spec
    A newer version should be available soon, matching the code
    implementation here, as soon as I work through a few final details with
    some lawyers on the wording of the license.
    
    Many other software packages to help out with greybus devices are on
    that github project page (manfest generator, emulator, firmware
    examples, etc.), if people are interested.
    
    Given that it's never a good idea to keep subsystems out of the mainline
    kernel, I've put together this pull request that adds the greybus driver
    layer to drivers/greybus/.  Because this was 2 1/2 years of work, with
    many many developers contributing, I didn't want to flatten all of their
    effort into a few small patches, as that wouldn't be very fair.  So I've
    built a git tree with all of the changes going back to the first commit,
    and merged it into the kernel tree, just like btrfs was merged into the
    kernel.
    
    The protocol design, and implementation, was a group effort, and it would
    not have turned out well at all without the contributions of all of
    these talented developers.
    
    I'll send out a follow-up set of "simple" patches that just add the
    files to the kernel tree, to give people an idea of the code involved.
    Overall, it's a tiny stand-alone driver subsystem, only 37k lines, that
    implements a protocol which allows for "generic" cameras, audio devices,
    and other class type devices, as well as a bridged "physical" layer
    protocol to talk to serial, spi, uart, pwm, gpio, i2c, and even USB host
    controllers.  Included here is a USB bridge host controller driver that
    interacts with a USB device that converts USB data to Unipro data,
    allowing any system to talk to a Unipro platform (no special SoC
    interface required.)
    
    Unless people point out some major problems with this, I'd like to get
    it merged into 4.9-rc1.
    
    The shortlog and diffstat can be seen below.
    
    If anyone has any questions about this, please let us know.
    
    thanks,
    
    greg k-h
    ----------------------------------------------------------------------
    大家好,
    如你们所知,我和其他许多开发人员一直在为Unipro硬件传输开发一种新的应用层协议,称为“Greybus”。
    它已经出现在谷歌为Ara手机平台做的大量演示中,而且现在摩托罗拉的一款手机现在随时都会提供旧版本的codebase。
    协议规范的半更新版本可从以下网址获得:https://github.com/projectara/greybus-spec
    一个更新的版本应该很快就会推出,与这里的代码实现相匹配,只要我和一些律师就许可证的措辞完成一些最后的细节。
    
    如果人们感兴趣的话,可以在github项目页面(manfestgenerator、模拟器、固件示例等)上找到许多其他帮助greybus设备的软件包。
    考虑到将子系统排除在主线内核之外并不是一个好主意,我将这个pull请求组合到drivers/greybus/中,它将greybus驱动程序层添加到drivers/greybus/。
    因为这是2年半的工作,许多开发人员都在做贡献,所以我不想把他们所有的精力都放在几个小补丁上,因为这样做不太公平。
    因此,我构建了一个git树,其中所有的更改都可以追溯到第一次提交,并将其合并到内核树中,就像btrfs被合并到内核中一样。
    
    协议的设计和实现是一个团队的工作,如果没有这些有才华的开发人员的贡献,它就不会有好的结果。
    我将发送一组后续的“简单”补丁,它们只是将文件添加到内核树中,让人们了解其中涉及的代码。
    
    总的来说,它是一个很小的独立驱动子系统,只有37k行,它实现了一个协议,允许“通用”摄像机、音频设备和其他类设备,以及一个桥接的“物理”层协议,可以与串行、spi、uart、pwm、gpio、i2c甚至USB主机控制器进行通信。
    
    这里包括一个USB桥接主机控制器驱动程序,它与一个USB设备交互,该设备将USB数据转换成Unipro数据,允许任何系统与Unipro平台通信(不需要特殊的SoC接口)
    
    除非人们指出一些主要的问题,否则我想把它合并到4.9-rc1中。
    
    下面可以看到shortlog和diffstat。
    如果有人对此有任何疑问,请告诉我们。
    谢谢
    
    greg k-h
    
    
  • 相关阅读:
    Nth Highest Salary
    第二高的薪水
    组合两个表
    牛客(66)机器人的运动范围
    牛客(65)矩阵中的路径
    牛客(64)滑动窗口的最大值
    牛客(63)数据流中的中位数
    牛客(62)二叉搜索树的第k个结点
    牛客(61)序列化二叉树
    mybits(2)增删改查
  • 原文地址:https://www.cnblogs.com/schips/p/14001719.html
Copyright © 2020-2023  润新知