Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on May 22nd, 2012  |  syntax: None  |  size: 2.55 KB  |  views: 86  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Author: FrankBuss <fb@frank-buss.de>  2012-05-22 20:00:25
  2. Committer: FrankBuss <fb@frank-buss.de>  2012-05-22 20:00:25
  3. Parent: a8191c0ea9026890a00364e98bf6cf53397513a3 (i2c-bcm2708: clean up; enable BSC1)
  4. Branch: rpi-3.2.17
  5. Follows: v3.2
  6. Precedes:
  7.  
  8.     testing the 3rd BSC module
  9.  
  10. ----------------------- arch/arm/mach-bcm2708/bcm2708.c -----------------------
  11. index 0207807..00bc428 100644
  12. @@ -232,6 +232,9 @@ static struct clk_lookup lookups[] = {
  13.          }, {   /* BSC1 */
  14.                  .dev_id = "bcm2708_i2c.1",
  15.                  .clk = &sdhost_clk,
  16. +        }, {   /* BSC2 */
  17. +                .dev_id = "bcm2708_i2c.2",
  18. +                .clk = &sdhost_clk,
  19.          }
  20.  };
  21.  
  22. @@ -548,6 +551,25 @@ static struct platform_device bcm2708_bsc1_device = {
  23.         .resource = bcm2708_bsc1_resources,
  24.  };
  25.  
  26. +static struct resource bcm2708_bsc2_resources[] = {
  27. +       {
  28. +               .start = BSC2_BASE,
  29. +               .end = BSC2_BASE + SZ_256 - 1,
  30. +               .flags = IORESOURCE_MEM,
  31. +       }, {
  32. +               .start = INTERRUPT_I2C,
  33. +               .end = INTERRUPT_I2C,
  34. +               .flags = IORESOURCE_IRQ,
  35. +       }
  36. +};
  37. +
  38. +static struct platform_device bcm2708_bsc2_device = {
  39. +       .name = "bcm2708_i2c",
  40. +       .id = 2,
  41. +       .num_resources = ARRAY_SIZE(bcm2708_bsc2_resources),
  42. +       .resource = bcm2708_bsc2_resources,
  43. +};
  44. +
  45.  int __init bcm_register_device(struct platform_device *pdev)
  46.  {
  47.         int ret;
  48. @@ -590,6 +612,7 @@ void __init bcm2708_init(void)
  49.         bcm_register_device(&bcm2708_spi_device);
  50.         bcm_register_device(&bcm2708_bsc0_device);
  51.         bcm_register_device(&bcm2708_bsc1_device);
  52. +       bcm_register_device(&bcm2708_bsc2_device);
  53.  
  54.  #ifdef CONFIG_BCM2708_VCMEM
  55.         {
  56.  
  57. ---------------- arch/arm/mach-bcm2708/include/mach/platform.h ----------------
  58. index d038597..582798a 100644
  59. @@ -69,6 +69,7 @@
  60.  #define EMMC_BASE                (BCM2708_PERI_BASE + 0x300000) /* eMMC interface */
  61.  #define SMI_BASE                (BCM2708_PERI_BASE + 0x600000) /* SMI */
  62.  #define BSC1_BASE               (BCM2708_PERI_BASE + 0x804000) /* BSC1 I2C/TWI */
  63. +#define BSC2_BASE               (BCM2708_PERI_BASE + 0x805000) /* BSC2 I2C/TWI */
  64.  #define USB_BASE                 (BCM2708_PERI_BASE + 0x980000) /* DTC_OTG USB controller */
  65.  #define MCORE_BASE               (BCM2708_PERI_BASE + 0x0000)   /* Fake frame buffer device (actually the multicore sync block*/
  66.  
  67.  
  68. ----------------------- drivers/i2c/busses/i2c-bcm2708.c -----------------------
  69. index 067c635..8d2fbf2 100644
  70. @@ -309,6 +309,9 @@ static int __devinit bcm2708_i2c_probe(struct platform_device *pdev)
  71.         case 1:
  72.                 adap->class = I2C_CLASS_DDC;
  73.                 break;
  74. +       case 2:
  75. +               adap->class = I2C_CLASS_DDC;
  76. +               break;
  77.         default:
  78.                 dev_err(&pdev->dev, "can only bind to BSC 0 or 1\n");
  79.                 err = -ENXIO;