/* * platform_tca6416.c: tca6416 platform data initialization file * * (C) Copyright 2013 Intel Corporation * Author: Sathyanarayanan Kuppuswamy <sathyanarayanan.kuppuswamy@intel.com> * * 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 the Free Software Foundation; version 2 * of the License. */ #include <linux/platform_data/pca953x.h> #include <linux/i2c.h> #include <linux/gpio.h> #include <asm/intel-mid.h> #define TCA6416_NAME "tca6416" #define TCA6416_BASE "tca6416_base" #define TCA6416_INTR "tca6416_int"
static void *tca6416_platform_data(void *info) { static struct pca953x_platform_data tca6416; struct i2c_board_info *i2c_info = info; int gpio_base, intr; char base_pin_name[SFI_NAME_LEN + 1]; char intr_pin_name[SFI_NAME_LEN + 1]; strcpy(i2c_info->type, TCA6416_NAME); strcpy(base_pin_name, TCA6416_BASE); strcpy(intr_pin_name, TCA6416_INTR); gpio_base = get_gpio_by_name(base_pin_name); intr = get_gpio_by_name(intr_pin_name); if (gpio_base < 0) return NULL; tca6416.gpio_base = gpio_base; if (intr >= 0) { i2c_info->irq = intr + INTEL_MID_IRQ_OFFSET; tca6416.irq_base = gpio_base + INTEL_MID_IRQ_OFFSET; } else { i2c_info->irq = -1; tca6416.irq_base = -1; } return &tca6416; }Contributors
Person | Tokens | Prop | Commits | CommitProp |
David Cohen | 141 | 100.00% | 2 | 100.00% |
Total | 141 | 100.00% | 2 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
David Cohen | 200 | 99.50% | 2 | 66.67% |
Adam Buchbinder | 1 | 0.50% | 1 | 33.33% |
Total | 201 | 100.00% | 3 | 100.00% |