Skip to content
Snippets Groups Projects
Commit 6b4d94c8 authored by Ke Liu's avatar Ke Liu
Browse files

qup_i2c: export qup_i2c_init_driver


Drivers like onsemi-ncp6335d and fan53555 are clients of i2c-qup driver.
In some targets, these clients have to initialize and probe early before
the i2c-qup driver is ready. Hence export qup_i2c_init_driver to make sure
i2c-qup driver is ready when its clients need to probe.

Change-Id: I0f866d1c4239f9c72f6753674c2283e97f3a3691
Signed-off-by: default avatarKe Liu <keliu@codeaurora.org>
parent 3cafa202
No related branches found
No related tags found
No related merge requests found
......@@ -22,6 +22,7 @@
#include <linux/err.h>
#include <linux/init.h>
#include <linux/i2c.h>
#include <linux/i2c/i2c-qup.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/delay.h>
......@@ -1853,11 +1854,18 @@ static struct platform_driver qup_i2c_driver = {
};
/* QUP may be needed to bring up other drivers */
static int __init
qup_i2c_init_driver(void)
int __init qup_i2c_init_driver(void)
{
static bool initialized;
if (initialized)
return 0;
else
initialized = true;
return platform_driver_register(&qup_i2c_driver);
}
EXPORT_SYMBOL(qup_i2c_init_driver);
arch_initcall(qup_i2c_init_driver);
static void __exit qup_i2c_exit_driver(void)
......
/*
* Copyright (c) 2014, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __I2C_QUP_H__
#define __I2C_QUP_H__
#ifdef CONFIG_I2C_QUP
int __init qup_i2c_init_driver(void);
#else
static inline int __init qup_i2c_init_driver(void) { return 0; }
#endif
#endif /* __I2C_QUP_H__ */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment