Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 30f89647 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: gpiomux: Add msm_tlmm_misc_reg_read API"

parents a7004c39 d0819167
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
/* Copyright (c) 2010,2013, The Linux Foundation. All rights reserved.
/* Copyright (c) 2010,2013-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
@@ -123,6 +123,11 @@ int msm_gpiomux_put(unsigned gpio)
}
EXPORT_SYMBOL(msm_gpiomux_put);

int msm_tlmm_misc_reg_read(enum msm_tlmm_misc_reg misc_reg)
{
	return readl_relaxed(MSM_TLMM_BASE + misc_reg);
}

void msm_tlmm_misc_reg_write(enum msm_tlmm_misc_reg misc_reg, int val)
{
	writel_relaxed(val, MSM_TLMM_BASE + misc_reg);
+20 −3
Original line number Diff line number Diff line
/* Copyright (c) 2010-2011,2013, The Linux Foundation. All rights reserved.
/* Copyright (c) 2010-2011,2013-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
@@ -118,8 +118,6 @@ enum msm_tlmm_misc_reg {
	TLMM_CDC_HDRV_PULL_CTL = 0x2058,
};

void msm_tlmm_misc_reg_write(enum msm_tlmm_misc_reg misc_reg, int val);

#ifdef CONFIG_MSM_GPIOMUX

/* Before using gpiomux, initialize the subsystem by telling it how many
@@ -170,6 +168,14 @@ int msm_gpiomux_write(unsigned gpio, enum msm_gpiomux_setting which,
 * should use msm_gpiomux_write.
 */
void __msm_gpiomux_write(unsigned gpio, struct gpiomux_setting val);

/* Functions that provide an API for drivers to read from and write to
 * miscellaneous TLMM registers.
 */
int msm_tlmm_misc_reg_read(enum msm_tlmm_misc_reg misc_reg);

void msm_tlmm_misc_reg_write(enum msm_tlmm_misc_reg misc_reg, int val);

#else
static inline int msm_gpiomux_init(size_t ngpio)
{
@@ -195,5 +201,16 @@ static inline int msm_gpiomux_write(unsigned gpio,
{
	return -ENOSYS;
}

static inline int msm_tlmm_misc_reg_read(enum msm_tlmm_misc_reg misc_reg)
{
	return -ENOSYS;
}

static inline void msm_tlmm_misc_reg_write(enum msm_tlmm_misc_reg misc_reg,
						int val)
{
}

#endif
#endif