arm: tegra: cardhu: additions to cardhu board file
Darbha Sriharsha [Thu, 24 Jan 2013 07:34:32 +0000 (12:34 +0530)]
This change is intended to add modifications to
cardhu board file (which is also used for beaver)
to get rid of NACK errors occuring due to the absence
of certain hardware components on beaver

Bug 1217572

Change-Id: I36dfcda1b133c983ce25d56729505bce8b99fdf1
Signed-off-by: Darbha Sriharsha <dsriharsha@nvidia.com>
Reviewed-on: http://git-master/r/193667
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Matthew Pedro <mapedro@nvidia.com>

arch/arm/mach-tegra/board-cardhu-sensors.c
arch/arm/mach-tegra/board-cardhu.c

index 83ec4fc..59e1fa3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * arch/arm/mach-tegra/board-cardhu-sensors.c
  *
- * Copyright (c) 2010-2012, NVIDIA CORPORATION, All rights reserved.
+ * Copyright (c) 2010-2013, NVIDIA CORPORATION, All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -995,7 +995,8 @@ static const struct i2c_board_info cardhu_i2c2_board_info_tca6416[] = {
 static int __init pmu_tca6416_init(void)
 {
        if ((board_info.board_id == BOARD_E1198) ||
-               (board_info.board_id == BOARD_E1291))
+               (board_info.board_id == BOARD_E1291) ||
+                       (board_info.board_id == BOARD_PM315))
                        return 0;
 
        pr_info("Registering pmu pca6416\n");
@@ -1009,7 +1010,8 @@ static int __init cam_tca6416_init(void)
        /* Boards E1198 and E1291 are of Cardhu personality
         * and donot have TCA6416 exp for camera */
        if ((board_info.board_id == BOARD_E1198) ||
-               (board_info.board_id == BOARD_E1291))
+                       (board_info.board_id == BOARD_E1291) ||
+                       (board_info.board_id == BOARD_PM315))
                return 0;
 
        pr_info("Registering cam pca6416\n");
@@ -1148,8 +1150,10 @@ int __init cardhu_sensors_init(void)
        cardhu_camera_init();
        cam_tca6416_init();
 
-       i2c_register_board_info(2, cardhu_i2c3_board_info,
-               ARRAY_SIZE(cardhu_i2c3_board_info));
+       if (board_info.board_id != BOARD_PM315) {
+               i2c_register_board_info(2, cardhu_i2c3_board_info,
+                       ARRAY_SIZE(cardhu_i2c3_board_info));
+       }
 
        i2c_register_board_info(2, cardhu_i2c_board_info_tps61050,
                ARRAY_SIZE(cardhu_i2c_board_info_tps61050));
index 4b03ddc..b6799dc 100644 (file)
@@ -1,8 +1,8 @@
 /*
  * arch/arm/mach-tegra/board-cardhu.c
  *
- * Copyright (c) 2011-2012, NVIDIA Corporation.  All rights reserved.
- * Copyright (c) 2011-2012, NVIDIA Corporation.
+ * Copyright (c) 2011-2013, NVIDIA Corporation.  All rights reserved.
+ * Copyright (c) 2011-2013, NVIDIA Corporation.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -1057,6 +1057,11 @@ static int __init cardhu_touch_init(void)
        struct board_info BoardInfo, DisplayBoardInfo;
 
        tegra_get_board_info(&BoardInfo);
+
+       /* Beaver board does not have any touch hardware*/
+       if (BoardInfo.board_id == BOARD_PM315)
+               return 0;
+
        tegra_get_display_board_info(&DisplayBoardInfo);
        if (DisplayBoardInfo.board_id == BOARD_DISPLAY_PM313) {
                tegra_clk_init_from_table(spi_clk_init_table);