25 Oct, 2011

1 commit

  • For simple modules that contain a single platform_driver without any
    additional setup code then ends up being a block of duplicated
    boilerplate. This patch adds a new macro, module_platform_driver(),
    which replaces the module_init()/module_exit() registrations with
    template functions.

    Signed-off-by: Grant Likely
    Acked-by: Greg Kroah-Hartman
    Reviewed-by: Magnus Damm
    Reviewed-by: Mark Brown
    Reviewed-by: Stephen Boyd

    Grant Likely
     

16 Sep, 2011

1 commit

  • commit 22a85e4cd51 (spi/imx: add device tree probe support) broke spi-imx usage
    when the SPI chipselect is the one internal to the controller.

    On a mx31pdk board the following error is seen:

    Registering mxc_nand as whole device
    ------------[ cut here ]------------
    WARNING: at drivers/gpio/gpiolib.c:101 gpio_ensure_requested+0x4c/0xf4()
    autorequest GPIO-0
    Modules linked in:
    [] (unwind_backtrace+0x0/0xf4) from [] (warn_slowpath_common+0x4c/0x64)
    [] (warn_slowpath_common+0x4c/0x64) from [] (warn_slowpath_fmt+0x30/0x40)
    [] (warn_slowpath_fmt+0x30/0x40) from [] (gpio_ensure_requested+0x4c/0xf4)
    [] (gpio_ensure_requested+0x4c/0xf4) from [] (gpio_direction_output+0xa0/0x138)
    [] (gpio_direction_output+0xa0/0x138) from [] (spi_imx_setup+0x38/0x4c)
    [] (spi_imx_setup+0x38/0x4c) from [] (spi_setup+0x38/0x50)
    [] (spi_setup+0x38/0x50) from [] (spi_add_device+0x94/0x124)
    [] (spi_add_device+0x94/0x124) from [] (spi_new_device+0x74/0xac)
    [] (spi_new_device+0x74/0xac) from [] (spi_match_master_to_boardinfo+0x20/0x40)
    [] (spi_match_master_to_boardinfo+0x20/0x40) from [] (spi_register_master+0xb0/0x104)
    [] (spi_register_master+0xb0/0x104) from [] (spi_bitbang_start+0x104/0x17c)
    [] (spi_bitbang_start+0x104/0x17c) from [] (spi_imx_probe+0x2fc/0x404)
    [] (spi_imx_probe+0x2fc/0x404) from [] (platform_drv_probe+0x18/0x1c)
    [] (platform_drv_probe+0x18/0x1c) from [] (driver_probe_device+0x78/0x174)
    [] (driver_probe_device+0x78/0x174) from [] (__driver_attach+0x8c/0x90)
    [] (__driver_attach+0x8c/0x90) from [] (bus_for_each_dev+0x60/0x8c)
    [] (bus_for_each_dev+0x60/0x8c) from [] (bus_add_driver+0xa0/0x288)
    [] (bus_add_driver+0xa0/0x288) from [] (driver_register+0x78/0x18c)
    [] (driver_register+0x78/0x18c) from [] (do_one_initcall+0x34/0x178)
    [] (do_one_initcall+0x34/0x178) from [] (kernel_init+0x74/0x118)
    [] (kernel_init+0x74/0x118) from [] (kernel_thread_exit+0x0/0x8)
    ---[ end trace 759f924b30fd5a44 ]---

    Fix this issue by using the original chip select logic and make spi-imx to work again.

    Tested on a mx31pdk that uses the hardware SPI chipselect pins and also
    on a mx27pdk that uses GPIO as SPI chipselect.

    Signed-off-by: Fabio Estevam
    Signed-off-by: Grant Likely

    Fabio Estevam
     

15 Jul, 2011

7 commits

  • It adds device tree probe support for spi-imx driver.

    Signed-off-by: Shawn Guo
    Cc: Grant Likely
    Signed-off-by: Grant Likely

    Shawn Guo
     
  • It copies gpio number passed via platform data embedded pointer into
    driver private data, so that we do not need to refer to this embedded
    pointer passed by platform data after probe function exits.

    Signed-off-by: Shawn Guo
    Cc: Uwe Kleine-König
    Cc: Sascha Hauer
    Cc: Grant Likely
    Signed-off-by: Grant Likely

    Shawn Guo
     
  • Software defined version number is not stable enough to be used
    in device type naming scheme. The patch changes it to use implicit
    soc name for spi device type definition. In this way, we can easily
    align the naming scheme with device tree binding, which comes later.

    It removes fifosize from spi_imx_data and adds devtype there, so that
    fifosize can be set in an inline function according to devtype.
    Also, cpu_is_mx can be replaced by inline functions checking devtype.

    Signed-off-by: Shawn Guo
    Cc: Uwe Kleine-König
    Cc: Sascha Hauer
    Cc: Grant Likely
    Signed-off-by: Grant Likely

    Shawn Guo
     
  • The only difference between SPI_IMX_VER_0_7 and SPI_IMX_VER_0_4 is
    .config function. The patch uses cpu_is_mx35 (to be removed) as the
    temporary solution to consolidate functions spi_imx0_4_config and
    spi_imx0_7_config into mx31_config. As a result, type SPI_IMX_VER_0_7
    can be merged into SPI_IMX_VER_0_4.

    It also renames function spi_imx0_4_reset to mx31_reset to keep
    consistency with other function naming.

    A couple of redundant macros, MX3_CSPISTAT and MX3_CSPISTAT_RR,
    together with the useless type SPI_IMX_VER_0_5 also get cleaned up.

    Signed-off-by: Shawn Guo
    Cc: Uwe Kleine-König
    Cc: Sascha Hauer
    Cc: Grant Likely
    Signed-off-by: Grant Likely

    Shawn Guo
     
  • It's confusing to use spi_imx2_3 to name SPI_IMX_VER_2_3 function
    and macro, as it easily make people think of imx2 and imx3. It's
    better to use specific soc name just like what other SPI_IMX_VER
    do. For SPI_IMX_VER_2_3 case, it will be mx51. To distinguish it
    from CSPI on mx51, mx51_ecspi might be a good choice.

    Signed-off-by: Shawn Guo
    Cc: Uwe Kleine-König
    Cc: Sascha Hauer
    Cc: Grant Likely
    Signed-off-by: Grant Likely

    Shawn Guo
     
  • SPI_IMX_VER_0_0 covers i.mx21 and i.mx27. It makes more sense to
    use mx21 rather than mx27 to name SPI_IMX_VER_0_0 function and
    macro, since i.mx21 comes out ealier than i.mx27.

    Signed-off-by: Shawn Guo
    Cc: Uwe Kleine-König
    Cc: Sascha Hauer
    Cc: Grant Likely
    Signed-off-by: Grant Likely

    Shawn Guo
     
  • spi_imx_devtype_data has already been driver private data. There is
    really no need to make a copy in spi_imx_data. Instead, a reference
    pointer works perfectly fine.

    Signed-off-by: Shawn Guo
    Signed-off-by: Grant Likely

    Shawn Guo
     

06 Jun, 2011

1 commit

  • Sort the SPI makefile and enforce the naming convention spi_*.c for
    spi drivers.

    This change also rolls the contents of atmel_spi.h into the .c file
    since there is only one user of that particular include file.

    v2: - Use 'spi-' prefix instead of 'spi_' to match what seems to be
    be the predominant pattern for subsystem prefixes.
    - Clean up filenames in Kconfig and header comment blocks

    Signed-off-by: Grant Likely
    Acked-by: Wolfram Sang
    Acked-by: Linus Walleij

    Grant Likely