)]}'
{
  "commit": "d255bb0e78d1cac5b7c8c98cb77a095f5f16de0d",
  "tree": "66d71caa14c2517ca32089ead5817612599b8ba8",
  "parents": [
    "289011207d999b2e4085150d2aa30d547ad9b800"
  ],
  "author": {
    "name": "Haavard Skinnemoen",
    "email": "hskinnemoen@atmel.com",
    "time": "Fri May 16 11:10:31 2008 +0200"
  },
  "committer": {
    "name": "Wolfgang Denk",
    "email": "wd@denx.de",
    "time": "Tue Jun 03 20:28:50 2008 +0200"
  },
  "message": "SPI API improvements\n\nThis patch gets rid of the spi_chipsel table and adds a handful of new\nfunctions that makes the SPI layer cleaner and more flexible.\n\nInstead of the spi_chipsel table, each board that wants to use SPI\ngets to implement three hooks:\n  * spi_cs_activate(): Activates the chipselect for a given slave\n  * spi_cs_deactivate(): Deactivates the chipselect for a given slave\n  * spi_cs_is_valid(): Determines if the given bus/chipselect\n    combination can be activated.\n\nNot all drivers may need those extra functions however. If that\u0027s the\ncase, the board code may just leave them out (assuming they know what\nthe driver needs) or rely on the linker to strip them out (assuming\n--gc-sections is being used.)\n\nTo set up communication parameters for a given slave, the driver needs\nto call spi_setup_slave(). This returns a pointer to an opaque\nspi_slave struct which must be passed as a parameter to subsequent SPI\ncalls. This struct can be freed by calling spi_free_slave(), but most\ndriver probably don\u0027t want to do this.\n\nBefore starting one or more SPI transfers, the driver must call\nspi_claim_bus() to gain exclusive access to the SPI bus and initialize\nthe hardware. When all transfers are done, the driver must call\nspi_release_bus() to make the bus available to others, and possibly\nshut down the SPI controller hardware.\n\nspi_xfer() behaves mostly the same as before, but it now takes a\nspi_slave parameter instead of a spi_chipsel function pointer. It also\ngot a new parameter, flags, which is used to specify chip select\nbehaviour. This may be extended with other flags in the future.\n\nThis patch has been build-tested on all powerpc and arm boards\ninvolved. I have not tested NIOS since I don\u0027t have a toolchain for it\ninstalled, so I expect some breakage there even though I\u0027ve tried\nfixing up everything I could find by visual inspection.\n\nI have run-time tested this on AVR32 ATNGW100 using the atmel_spi and\nDataFlash drivers posted as a follow-up. I\u0027d like some help testing\nother boards that use the existing SPI API.\n\nBut most of all, I\u0027d like some comments on the new API. Is this stuff\nusable for everyone? If not, why?\n\nChanged in v4:\n  - Build fixes for various boards, drivers and commands\n  - Provide common struct spi_slave definition that can be extended by\n    drivers\n  - Pass a struct spi_slave * to spi_cs_activate and spi_cs_deactivate\n  - Make default bus and mode build-time configurable\n  - Override default SPI bus ID and mode on mx32ads and imx31_litekit.\n\nChanged in v3:\n  - Add opaque struct spi_slave for controller-specific data associated\n    with a slave.\n  - Add spi_claim_bus() and spi_release_bus()\n  - Add spi_free_slave()\n  - spi_setup() is now called spi_setup_slave() and returns a\n    struct spi_slave\n  - soft_spi now supports four SPI modes (CPOL|CPHA)\n  - Add bus parameter to spi_setup_slave()\n  - Convert the new i.MX32 SPI driver\n  - Convert the new MC13783 RTC driver\n\nChanged in v2:\n  - Convert the mpc8xxx_spi driver and the mpc8349emds board to the\n    new API.\n\nSigned-off-by: Haavard Skinnemoen \u003chskinnemoen@atmel.com\u003e\nTested-by: Guennadi Liakhovetski \u003clg@denx.de\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "eedde597b81cc1e7024b7f67314a7d39afa0ce66",
      "old_mode": 33188,
      "old_path": "board/amcc/taihu/taihu.c",
      "new_id": "891b4d924980fc6d8fbf3919198b5899b06b79ec",
      "new_mode": 33188,
      "new_path": "board/amcc/taihu/taihu.c"
    },
    {
      "type": "modify",
      "old_id": "6c825969d38c796b97a01e95615cbab638c6b6f6",
      "old_mode": 33188,
      "old_path": "board/freescale/mpc8349emds/mpc8349emds.c",
      "new_id": "e18e68e8cec3f17622a005530bb3ebdbe2bf405c",
      "new_mode": 33188,
      "new_path": "board/freescale/mpc8349emds/mpc8349emds.c"
    },
    {
      "type": "modify",
      "old_id": "25209e0546404c6a097691db9fbb52dbf31bcec9",
      "old_mode": 33188,
      "old_path": "board/sacsng/sacsng.c",
      "new_id": "e85a0fc4dbe9404af8f2d89a58a65be281d7394e",
      "new_mode": 33188,
      "new_path": "board/sacsng/sacsng.c"
    },
    {
      "type": "modify",
      "old_id": "2ec3a728d74ea5cb0a5ce9c43e60ecf57d48bd53",
      "old_mode": 33188,
      "old_path": "board/ssv/adnpesc1/adnpesc1.c",
      "new_id": "3ee8ba588dc20a8597c7642c2731ed024fa7e5ab",
      "new_mode": 33188,
      "new_path": "board/ssv/adnpesc1/adnpesc1.c"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "5f650442c018edb81aacc6c22ddbe0f49682087f",
      "new_mode": 33188,
      "new_path": "common/cmd_df.c"
    },
    {
      "type": "modify",
      "old_id": "76044221416c9fbd194828b6f4c6bd35fdd461fd",
      "old_mode": 33188,
      "old_path": "common/cmd_spi.c",
      "new_id": "40ee7e7dd3c7daa08270fbfc72d0d7967d92077c",
      "new_mode": 33188,
      "new_path": "common/cmd_spi.c"
    },
    {
      "type": "modify",
      "old_id": "e4250616c2858943110fcabefa56513a32eee634",
      "old_mode": 33188,
      "old_path": "common/soft_spi.c",
      "new_id": "c13165030db6e5edb71ef78491039977d3ef0ae0",
      "new_mode": 33188,
      "new_path": "common/soft_spi.c"
    },
    {
      "type": "modify",
      "old_id": "f37146b7939b75093376f8f86755015cd3a53d1a",
      "old_mode": 33188,
      "old_path": "cpu/nios/spi.c",
      "new_id": "6408180147a9fd39ca87d0136d1cbf6bbd14e3e7",
      "new_mode": 33188,
      "new_path": "cpu/nios/spi.c"
    },
    {
      "type": "modify",
      "old_id": "1c8ac7f2927997989bf4a1738e7616e9e5d70290",
      "old_mode": 33188,
      "old_path": "drivers/rtc/ds1306.c",
      "new_id": "29854fc7c4cf6f4e67b645b5333e11a45beeec62",
      "new_mode": 33188,
      "new_path": "drivers/rtc/ds1306.c"
    },
    {
      "type": "modify",
      "old_id": "35b1b8b254dd218ab6c7b93abe71ace1b12cc242",
      "old_mode": 33188,
      "old_path": "drivers/rtc/mc13783-rtc.c",
      "new_id": "b6e15014bb68e67f22c2e1b3340a7a23f5ed5ed6",
      "new_mode": 33188,
      "new_path": "drivers/rtc/mc13783-rtc.c"
    },
    {
      "type": "modify",
      "old_id": "2fe838c45d59f441b355ed10eb4ff5a357c89aff",
      "old_mode": 33188,
      "old_path": "drivers/spi/mpc8xxx_spi.c",
      "new_id": "136fb50052f1902c1cc285f0dfe46b880a3cbe8e",
      "new_mode": 33188,
      "new_path": "drivers/spi/mpc8xxx_spi.c"
    },
    {
      "type": "modify",
      "old_id": "c166ec5023953eec7635ce5c7c7e0dc55f082b33",
      "old_mode": 33188,
      "old_path": "drivers/spi/mxc_spi.c",
      "new_id": "5957ada3a4a626aba3584093d2018ae0e88a3946",
      "new_mode": 33188,
      "new_path": "drivers/spi/mxc_spi.c"
    },
    {
      "type": "modify",
      "old_id": "4281d73c90b47e370ba103aa44fee04cd559fc52",
      "old_mode": 33188,
      "old_path": "include/configs/imx31_litekit.h",
      "new_id": "ec4ed1eeb674191b01effb27aa21c9b98b444e64",
      "new_mode": 33188,
      "new_path": "include/configs/imx31_litekit.h"
    },
    {
      "type": "modify",
      "old_id": "2ea48a6da9ace3d03cbf40f78c3c705a386aecf7",
      "old_mode": 33188,
      "old_path": "include/configs/mx31ads.h",
      "new_id": "37ba872a43923249c8149aeb3236fd639187286d",
      "new_mode": 33188,
      "new_path": "include/configs/mx31ads.h"
    },
    {
      "type": "modify",
      "old_id": "3a55a68c4d1c25a0b8f2aed23e5b442440128c3c",
      "old_mode": 33188,
      "old_path": "include/spi.h",
      "new_id": "7744c2e36b057c02e9d22be42be6a6dd6a1f330d",
      "new_mode": 33188,
      "new_path": "include/spi.h"
    }
  ]
}
