mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-18 01:34:14 +08:00
Merge branch 'msm-fixes-3.17-rc4' of git://people.freedesktop.org/~robclark/linux into drm-fixes
A couple more little fixes: 1) fix from llvm/clang folks 2) fix build if common clock framework is not used 3) if vram carveout is used, have default size for vram carveout * 'msm-fixes-3.17-rc4' of git://people.freedesktop.org/~robclark/linux: drm/msm: don't crash if no msm.vram param drm/msm/hdmi: fix build break on non-CCF platforms drm/msm: Change nested function to static function
This commit is contained in:
commit
d9f4acd0b4
@ -258,28 +258,30 @@ static void set_hdmi_pdev(struct drm_device *dev,
|
||||
priv->hdmi_pdev = pdev;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_OF
|
||||
static int get_gpio(struct device *dev, struct device_node *of_node, const char *name)
|
||||
{
|
||||
int gpio = of_get_named_gpio(of_node, name, 0);
|
||||
if (gpio < 0) {
|
||||
char name2[32];
|
||||
snprintf(name2, sizeof(name2), "%s-gpio", name);
|
||||
gpio = of_get_named_gpio(of_node, name2, 0);
|
||||
if (gpio < 0) {
|
||||
dev_err(dev, "failed to get gpio: %s (%d)\n",
|
||||
name, gpio);
|
||||
gpio = -1;
|
||||
}
|
||||
}
|
||||
return gpio;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int hdmi_bind(struct device *dev, struct device *master, void *data)
|
||||
{
|
||||
static struct hdmi_platform_config config = {};
|
||||
#ifdef CONFIG_OF
|
||||
struct device_node *of_node = dev->of_node;
|
||||
|
||||
int get_gpio(const char *name)
|
||||
{
|
||||
int gpio = of_get_named_gpio(of_node, name, 0);
|
||||
if (gpio < 0) {
|
||||
char name2[32];
|
||||
snprintf(name2, sizeof(name2), "%s-gpio", name);
|
||||
gpio = of_get_named_gpio(of_node, name2, 0);
|
||||
if (gpio < 0) {
|
||||
dev_err(dev, "failed to get gpio: %s (%d)\n",
|
||||
name, gpio);
|
||||
gpio = -1;
|
||||
}
|
||||
}
|
||||
return gpio;
|
||||
}
|
||||
|
||||
if (of_device_is_compatible(of_node, "qcom,hdmi-tx-8074")) {
|
||||
static const char *hpd_reg_names[] = {"hpd-gdsc", "hpd-5v"};
|
||||
static const char *pwr_reg_names[] = {"core-vdda", "core-vcc"};
|
||||
@ -312,12 +314,12 @@ static int hdmi_bind(struct device *dev, struct device *master, void *data)
|
||||
}
|
||||
|
||||
config.mmio_name = "core_physical";
|
||||
config.ddc_clk_gpio = get_gpio("qcom,hdmi-tx-ddc-clk");
|
||||
config.ddc_data_gpio = get_gpio("qcom,hdmi-tx-ddc-data");
|
||||
config.hpd_gpio = get_gpio("qcom,hdmi-tx-hpd");
|
||||
config.mux_en_gpio = get_gpio("qcom,hdmi-tx-mux-en");
|
||||
config.mux_sel_gpio = get_gpio("qcom,hdmi-tx-mux-sel");
|
||||
config.mux_lpm_gpio = get_gpio("qcom,hdmi-tx-mux-lpm");
|
||||
config.ddc_clk_gpio = get_gpio(dev, of_node, "qcom,hdmi-tx-ddc-clk");
|
||||
config.ddc_data_gpio = get_gpio(dev, of_node, "qcom,hdmi-tx-ddc-data");
|
||||
config.hpd_gpio = get_gpio(dev, of_node, "qcom,hdmi-tx-hpd");
|
||||
config.mux_en_gpio = get_gpio(dev, of_node, "qcom,hdmi-tx-mux-en");
|
||||
config.mux_sel_gpio = get_gpio(dev, of_node, "qcom,hdmi-tx-mux-sel");
|
||||
config.mux_lpm_gpio = get_gpio(dev, of_node, "qcom,hdmi-tx-mux-lpm");
|
||||
|
||||
#else
|
||||
static const char *hpd_clk_names[] = {
|
||||
|
@ -15,19 +15,25 @@
|
||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_COMMON_CLK
|
||||
#include <linux/clk.h>
|
||||
#include <linux/clk-provider.h>
|
||||
#endif
|
||||
|
||||
#include "hdmi.h"
|
||||
|
||||
struct hdmi_phy_8960 {
|
||||
struct hdmi_phy base;
|
||||
struct hdmi *hdmi;
|
||||
#ifdef CONFIG_COMMON_CLK
|
||||
struct clk_hw pll_hw;
|
||||
struct clk *pll;
|
||||
unsigned long pixclk;
|
||||
#endif
|
||||
};
|
||||
#define to_hdmi_phy_8960(x) container_of(x, struct hdmi_phy_8960, base)
|
||||
|
||||
#ifdef CONFIG_COMMON_CLK
|
||||
#define clk_to_phy(x) container_of(x, struct hdmi_phy_8960, pll_hw)
|
||||
|
||||
/*
|
||||
@ -374,7 +380,7 @@ static struct clk_init_data pll_init = {
|
||||
.parent_names = hdmi_pll_parents,
|
||||
.num_parents = ARRAY_SIZE(hdmi_pll_parents),
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* HDMI Phy:
|
||||
@ -480,12 +486,15 @@ struct hdmi_phy *hdmi_phy_8960_init(struct hdmi *hdmi)
|
||||
{
|
||||
struct hdmi_phy_8960 *phy_8960;
|
||||
struct hdmi_phy *phy = NULL;
|
||||
int ret, i;
|
||||
int ret;
|
||||
#ifdef CONFIG_COMMON_CLK
|
||||
int i;
|
||||
|
||||
/* sanity check: */
|
||||
for (i = 0; i < (ARRAY_SIZE(freqtbl) - 1); i++)
|
||||
if (WARN_ON(freqtbl[i].rate < freqtbl[i+1].rate))
|
||||
return ERR_PTR(-EINVAL);
|
||||
#endif
|
||||
|
||||
phy_8960 = kzalloc(sizeof(*phy_8960), GFP_KERNEL);
|
||||
if (!phy_8960) {
|
||||
@ -499,6 +508,7 @@ struct hdmi_phy *hdmi_phy_8960_init(struct hdmi *hdmi)
|
||||
|
||||
phy_8960->hdmi = hdmi;
|
||||
|
||||
#ifdef CONFIG_COMMON_CLK
|
||||
phy_8960->pll_hw.init = &pll_init;
|
||||
phy_8960->pll = devm_clk_register(hdmi->dev->dev, &phy_8960->pll_hw);
|
||||
if (IS_ERR(phy_8960->pll)) {
|
||||
@ -506,6 +516,7 @@ struct hdmi_phy *hdmi_phy_8960_init(struct hdmi *hdmi)
|
||||
phy_8960->pll = NULL;
|
||||
goto fail;
|
||||
}
|
||||
#endif
|
||||
|
||||
return phy;
|
||||
|
||||
|
@ -52,7 +52,7 @@ module_param(reglog, bool, 0600);
|
||||
#define reglog 0
|
||||
#endif
|
||||
|
||||
static char *vram;
|
||||
static char *vram = "16m";
|
||||
MODULE_PARM_DESC(vram, "Configure VRAM size (for devices without IOMMU/GPUMMU");
|
||||
module_param(vram, charp, 0);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user