msm: mdss: share mdss io utility APIs with other drivers
MDSS io utility contains APIs to handle driver specific resources like GPIOs, power supplies, clocks and other resources. Sharing them with other drivers allow them to do resource management without re-writing the same code. Change-Id: Ib699407667239336cf82211e3f6e8eec97a104a8 Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org> [cip@codeaurora.org: Move mdss_io_util.h to include/linux] Signed-off-by: Clarence Ip <cip@codeaurora.org>
This commit is contained in:
parent
a218b1f5b0
commit
a92947d594
5 changed files with 21 additions and 6 deletions
|
@ -15,10 +15,10 @@
|
|||
#define MDSS_DSI_H
|
||||
|
||||
#include <linux/list.h>
|
||||
#include <linux/mdss_io_util.h>
|
||||
#include <mach/scm-io.h>
|
||||
|
||||
#include "mdss_panel.h"
|
||||
#include "mdss_io_util.h"
|
||||
#include "mdss_dsi_cmd.h"
|
||||
|
||||
#define MMSS_SERDES_BASE_PHY 0x04f01000 /* mmss (De)Serializer CFG */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2010-2013, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2010-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
|
||||
|
@ -12,7 +12,7 @@
|
|||
|
||||
#ifndef __HDMI_UTIL_H__
|
||||
#define __HDMI_UTIL_H__
|
||||
#include "mdss_io_util.h"
|
||||
#include <linux/mdss_io_util.h>
|
||||
#include "video/msm_hdmi_modes.h"
|
||||
|
||||
/* HDMI_TX Registers */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2012-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
|
||||
|
@ -15,7 +15,7 @@
|
|||
#include <linux/io.h>
|
||||
#include <linux/regulator/consumer.h>
|
||||
#include <linux/delay.h>
|
||||
#include "mdss_io_util.h"
|
||||
#include <linux/mdss_io_util.h>
|
||||
|
||||
#define MAX_I2C_CMDS 16
|
||||
void dss_reg_w(struct dss_io_data *io, u32 offset, u32 value, u32 debug)
|
||||
|
@ -41,6 +41,7 @@ void dss_reg_w(struct dss_io_data *io, u32 offset, u32 value, u32 debug)
|
|||
value, in_val);
|
||||
}
|
||||
} /* dss_reg_w */
|
||||
EXPORT_SYMBOL(dss_reg_w);
|
||||
|
||||
u32 dss_reg_r(struct dss_io_data *io, u32 offset, u32 debug)
|
||||
{
|
||||
|
@ -63,6 +64,7 @@ u32 dss_reg_r(struct dss_io_data *io, u32 offset, u32 debug)
|
|||
|
||||
return value;
|
||||
} /* dss_reg_r */
|
||||
EXPORT_SYMBOL(dss_reg_r);
|
||||
|
||||
void dss_reg_dump(void __iomem *base, u32 length, const char *prefix,
|
||||
u32 debug)
|
||||
|
@ -71,6 +73,7 @@ void dss_reg_dump(void __iomem *base, u32 length, const char *prefix,
|
|||
print_hex_dump(KERN_INFO, prefix, DUMP_PREFIX_OFFSET, 32, 4,
|
||||
(void *)base, length, false);
|
||||
} /* dss_reg_dump */
|
||||
EXPORT_SYMBOL(dss_reg_dump);
|
||||
|
||||
static struct resource *msm_dss_get_res_byname(struct platform_device *pdev,
|
||||
unsigned int type, const char *name)
|
||||
|
@ -83,6 +86,7 @@ static struct resource *msm_dss_get_res_byname(struct platform_device *pdev,
|
|||
|
||||
return res;
|
||||
} /* msm_dss_get_res_byname */
|
||||
EXPORT_SYMBOL(msm_dss_get_res_byname);
|
||||
|
||||
int msm_dss_ioremap_byname(struct platform_device *pdev,
|
||||
struct dss_io_data *io_data, const char *name)
|
||||
|
@ -112,6 +116,7 @@ int msm_dss_ioremap_byname(struct platform_device *pdev,
|
|||
|
||||
return 0;
|
||||
} /* msm_dss_ioremap_byname */
|
||||
EXPORT_SYMBOL(msm_dss_ioremap_byname);
|
||||
|
||||
void msm_dss_iounmap(struct dss_io_data *io_data)
|
||||
{
|
||||
|
@ -127,6 +132,7 @@ void msm_dss_iounmap(struct dss_io_data *io_data)
|
|||
}
|
||||
io_data->len = 0;
|
||||
} /* msm_dss_iounmap */
|
||||
EXPORT_SYMBOL(msm_dss_iounmap);
|
||||
|
||||
int msm_dss_config_vreg(struct device *dev, struct dss_vreg *in_vreg,
|
||||
int num_vreg, int config)
|
||||
|
@ -199,6 +205,7 @@ vreg_get_fail:
|
|||
}
|
||||
return rc;
|
||||
} /* msm_dss_config_vreg */
|
||||
EXPORT_SYMBOL(msm_dss_config_vreg);
|
||||
|
||||
int msm_dss_enable_vreg(struct dss_vreg *in_vreg, int num_vreg, int enable)
|
||||
{
|
||||
|
@ -262,6 +269,7 @@ vreg_set_opt_mode_fail:
|
|||
|
||||
return rc;
|
||||
} /* msm_dss_enable_vreg */
|
||||
EXPORT_SYMBOL(msm_dss_enable_vreg);
|
||||
|
||||
int msm_dss_enable_gpio(struct dss_gpio *in_gpio, int num_gpio, int enable)
|
||||
{
|
||||
|
@ -300,6 +308,7 @@ disable_gpio:
|
|||
|
||||
return rc;
|
||||
} /* msm_dss_enable_gpio */
|
||||
EXPORT_SYMBOL(msm_dss_enable_gpio);
|
||||
|
||||
void msm_dss_put_clk(struct dss_clk *clk_arry, int num_clk)
|
||||
{
|
||||
|
@ -311,6 +320,7 @@ void msm_dss_put_clk(struct dss_clk *clk_arry, int num_clk)
|
|||
clk_arry[i].clk = NULL;
|
||||
}
|
||||
} /* msm_dss_put_clk */
|
||||
EXPORT_SYMBOL(msm_dss_put_clk);
|
||||
|
||||
int msm_dss_get_clk(struct device *dev, struct dss_clk *clk_arry, int num_clk)
|
||||
{
|
||||
|
@ -334,6 +344,7 @@ error:
|
|||
|
||||
return rc;
|
||||
} /* msm_dss_get_clk */
|
||||
EXPORT_SYMBOL(msm_dss_get_clk);
|
||||
|
||||
int msm_dss_clk_set_rate(struct dss_clk *clk_arry, int num_clk)
|
||||
{
|
||||
|
@ -367,6 +378,7 @@ int msm_dss_clk_set_rate(struct dss_clk *clk_arry, int num_clk)
|
|||
|
||||
return rc;
|
||||
} /* msm_dss_clk_set_rate */
|
||||
EXPORT_SYMBOL(msm_dss_clk_set_rate);
|
||||
|
||||
int msm_dss_enable_clk(struct dss_clk *clk_arry, int num_clk, int enable)
|
||||
{
|
||||
|
@ -414,6 +426,7 @@ int msm_dss_enable_clk(struct dss_clk *clk_arry, int num_clk, int enable)
|
|||
|
||||
return rc;
|
||||
} /* msm_dss_enable_clk */
|
||||
EXPORT_SYMBOL(msm_dss_enable_clk);
|
||||
|
||||
|
||||
int mdss_i2c_byte_read(struct i2c_client *client, uint8_t slave_addr,
|
||||
|
@ -443,6 +456,7 @@ int mdss_i2c_byte_read(struct i2c_client *client, uint8_t slave_addr,
|
|||
pr_debug("%s: i2c buf is [%x]\n", __func__, *read_buf);
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(mdss_i2c_byte_read);
|
||||
|
||||
int mdss_i2c_byte_write(struct i2c_client *client, uint8_t slave_addr,
|
||||
uint8_t reg_offset, uint8_t *value)
|
||||
|
@ -470,3 +484,4 @@ int mdss_i2c_byte_write(struct i2c_client *client, uint8_t slave_addr,
|
|||
pr_debug("%s: I2C write status=%x\n", __func__, status);
|
||||
return status;
|
||||
}
|
||||
EXPORT_SYMBOL(mdss_i2c_byte_write);
|
||||
|
|
|
@ -22,13 +22,13 @@
|
|||
#include <linux/input.h>
|
||||
#include <linux/usb/msm_hsusb.h>
|
||||
#include <linux/mhl_8334.h>
|
||||
#include <linux/mdss_io_util.h>
|
||||
|
||||
#include "mdss_fb.h"
|
||||
#include "mdss_hdmi_tx.h"
|
||||
#include "mdss_hdmi_edid.h"
|
||||
#include "mdss.h"
|
||||
#include "mdss_panel.h"
|
||||
#include "mdss_io_util.h"
|
||||
#include "mhl_msc.h"
|
||||
#include "mdss_hdmi_mhl.h"
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue