linux/arch/x86/platform/intel-mid/device_libs/platform_mpu3050.c
<<
>>
Prefs
   1// SPDX-License-Identifier: GPL-2.0-only
   2/*
   3 * platform_mpu3050.c: mpu3050 platform data initialization file
   4 *
   5 * (C) Copyright 2013 Intel Corporation
   6 * Author: Sathyanarayanan Kuppuswamy <sathyanarayanan.kuppuswamy@intel.com>
   7 */
   8
   9#include <linux/gpio.h>
  10#include <linux/i2c.h>
  11#include <asm/intel-mid.h>
  12
  13static void *mpu3050_platform_data(void *info)
  14{
  15        struct i2c_board_info *i2c_info = info;
  16        int intr = get_gpio_by_name("mpu3050_int");
  17
  18        if (intr < 0)
  19                return NULL;
  20
  21        i2c_info->irq = intr + INTEL_MID_IRQ_OFFSET;
  22        return NULL;
  23}
  24
  25static const struct devs_id mpu3050_dev_id __initconst = {
  26        .name = "mpu3050",
  27        .type = SFI_DEV_TYPE_I2C,
  28        .delay = 1,
  29        .get_platform_data = &mpu3050_platform_data,
  30};
  31
  32sfi_device(mpu3050_dev_id);
  33