Commit e172e650 authored by Hans de Goede's avatar Hans de Goede Committed by Rafael J. Wysocki

ACPI: PMIC: constify all struct intel_pmic_opregion_data declarations

The struct intel_pmic_opregion_data declarations never change,
constify them all.
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 0fcfb00b
...@@ -25,7 +25,7 @@ struct intel_pmic_opregion { ...@@ -25,7 +25,7 @@ struct intel_pmic_opregion {
struct mutex lock; struct mutex lock;
struct acpi_lpat_conversion_table *lpat_table; struct acpi_lpat_conversion_table *lpat_table;
struct regmap *regmap; struct regmap *regmap;
struct intel_pmic_opregion_data *data; const struct intel_pmic_opregion_data *data;
struct intel_pmic_regs_handler_ctx ctx; struct intel_pmic_regs_handler_ctx ctx;
}; };
...@@ -53,7 +53,7 @@ static acpi_status intel_pmic_power_handler(u32 function, ...@@ -53,7 +53,7 @@ static acpi_status intel_pmic_power_handler(u32 function,
{ {
struct intel_pmic_opregion *opregion = region_context; struct intel_pmic_opregion *opregion = region_context;
struct regmap *regmap = opregion->regmap; struct regmap *regmap = opregion->regmap;
struct intel_pmic_opregion_data *d = opregion->data; const struct intel_pmic_opregion_data *d = opregion->data;
int reg, bit, result; int reg, bit, result;
if (bits != 32 || !value64) if (bits != 32 || !value64)
...@@ -135,7 +135,7 @@ static int pmic_thermal_aux(struct intel_pmic_opregion *opregion, int reg, ...@@ -135,7 +135,7 @@ static int pmic_thermal_aux(struct intel_pmic_opregion *opregion, int reg,
static int pmic_thermal_pen(struct intel_pmic_opregion *opregion, int reg, static int pmic_thermal_pen(struct intel_pmic_opregion *opregion, int reg,
int bit, u32 function, u64 *value) int bit, u32 function, u64 *value)
{ {
struct intel_pmic_opregion_data *d = opregion->data; const struct intel_pmic_opregion_data *d = opregion->data;
struct regmap *regmap = opregion->regmap; struct regmap *regmap = opregion->regmap;
if (!d->get_policy || !d->update_policy) if (!d->get_policy || !d->update_policy)
...@@ -171,7 +171,7 @@ static acpi_status intel_pmic_thermal_handler(u32 function, ...@@ -171,7 +171,7 @@ static acpi_status intel_pmic_thermal_handler(u32 function,
void *handler_context, void *region_context) void *handler_context, void *region_context)
{ {
struct intel_pmic_opregion *opregion = region_context; struct intel_pmic_opregion *opregion = region_context;
struct intel_pmic_opregion_data *d = opregion->data; const struct intel_pmic_opregion_data *d = opregion->data;
int reg, bit, result; int reg, bit, result;
if (bits != 32 || !value64) if (bits != 32 || !value64)
...@@ -255,7 +255,7 @@ static acpi_status intel_pmic_regs_handler(u32 function, ...@@ -255,7 +255,7 @@ static acpi_status intel_pmic_regs_handler(u32 function,
int intel_pmic_install_opregion_handler(struct device *dev, acpi_handle handle, int intel_pmic_install_opregion_handler(struct device *dev, acpi_handle handle,
struct regmap *regmap, struct regmap *regmap,
struct intel_pmic_opregion_data *d) const struct intel_pmic_opregion_data *d)
{ {
acpi_status status = AE_OK; acpi_status status = AE_OK;
struct intel_pmic_opregion *opregion; struct intel_pmic_opregion *opregion;
...@@ -344,7 +344,7 @@ EXPORT_SYMBOL_GPL(intel_pmic_install_opregion_handler); ...@@ -344,7 +344,7 @@ EXPORT_SYMBOL_GPL(intel_pmic_install_opregion_handler);
int intel_soc_pmic_exec_mipi_pmic_seq_element(u16 i2c_address, u32 reg_address, int intel_soc_pmic_exec_mipi_pmic_seq_element(u16 i2c_address, u32 reg_address,
u32 value, u32 mask) u32 value, u32 mask)
{ {
struct intel_pmic_opregion_data *d; const struct intel_pmic_opregion_data *d;
int ret; int ret;
if (!intel_pmic_opregion) { if (!intel_pmic_opregion) {
......
...@@ -25,6 +25,8 @@ struct intel_pmic_opregion_data { ...@@ -25,6 +25,8 @@ struct intel_pmic_opregion_data {
int pmic_i2c_address; int pmic_i2c_address;
}; };
int intel_pmic_install_opregion_handler(struct device *dev, acpi_handle handle, struct regmap *regmap, struct intel_pmic_opregion_data *d); int intel_pmic_install_opregion_handler(struct device *dev, acpi_handle handle,
struct regmap *regmap,
const struct intel_pmic_opregion_data *d);
#endif #endif
...@@ -369,7 +369,7 @@ intel_bxtwc_pmic_update_policy(struct regmap *regmap, ...@@ -369,7 +369,7 @@ intel_bxtwc_pmic_update_policy(struct regmap *regmap,
return regmap_update_bits(regmap, reg, mask, val); return regmap_update_bits(regmap, reg, mask, val);
} }
static struct intel_pmic_opregion_data intel_bxtwc_pmic_opregion_data = { static const struct intel_pmic_opregion_data intel_bxtwc_pmic_opregion_data = {
.get_power = intel_bxtwc_pmic_get_power, .get_power = intel_bxtwc_pmic_get_power,
.update_power = intel_bxtwc_pmic_update_power, .update_power = intel_bxtwc_pmic_update_power,
.get_raw_temp = intel_bxtwc_pmic_get_raw_temp, .get_raw_temp = intel_bxtwc_pmic_get_raw_temp,
......
...@@ -271,7 +271,7 @@ static int intel_crc_pmic_update_policy(struct regmap *regmap, ...@@ -271,7 +271,7 @@ static int intel_crc_pmic_update_policy(struct regmap *regmap,
return 0; return 0;
} }
static struct intel_pmic_opregion_data intel_crc_pmic_opregion_data = { static const struct intel_pmic_opregion_data intel_crc_pmic_opregion_data = {
.get_power = intel_crc_pmic_get_power, .get_power = intel_crc_pmic_get_power,
.update_power = intel_crc_pmic_update_power, .update_power = intel_crc_pmic_update_power,
.get_raw_temp = intel_crc_pmic_get_raw_temp, .get_raw_temp = intel_crc_pmic_get_raw_temp,
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
* intel_soc_pmic_exec_mipi_pmic_seq_element work on devices with a * intel_soc_pmic_exec_mipi_pmic_seq_element work on devices with a
* CHT Crystal Cove PMIC. * CHT Crystal Cove PMIC.
*/ */
static struct intel_pmic_opregion_data intel_chtcrc_pmic_opregion_data = { static const struct intel_pmic_opregion_data intel_chtcrc_pmic_opregion_data = {
.pmic_i2c_address = 0x6e, .pmic_i2c_address = 0x6e,
}; };
......
...@@ -94,7 +94,7 @@ static int chtdc_ti_pmic_get_raw_temp(struct regmap *regmap, int reg) ...@@ -94,7 +94,7 @@ static int chtdc_ti_pmic_get_raw_temp(struct regmap *regmap, int reg)
return ((buf[0] & 0x03) << 8) | buf[1]; return ((buf[0] & 0x03) << 8) | buf[1];
} }
static struct intel_pmic_opregion_data chtdc_ti_pmic_opregion_data = { static const struct intel_pmic_opregion_data chtdc_ti_pmic_opregion_data = {
.get_power = chtdc_ti_pmic_get_power, .get_power = chtdc_ti_pmic_get_power,
.update_power = chtdc_ti_pmic_update_power, .update_power = chtdc_ti_pmic_update_power,
.get_raw_temp = chtdc_ti_pmic_get_raw_temp, .get_raw_temp = chtdc_ti_pmic_get_raw_temp,
......
...@@ -253,7 +253,7 @@ static int intel_cht_wc_exec_mipi_pmic_seq_element(struct regmap *regmap, ...@@ -253,7 +253,7 @@ static int intel_cht_wc_exec_mipi_pmic_seq_element(struct regmap *regmap,
* The thermal table and ops are empty, we do not support the Thermal opregion * The thermal table and ops are empty, we do not support the Thermal opregion
* (DPTF) due to lacking documentation. * (DPTF) due to lacking documentation.
*/ */
static struct intel_pmic_opregion_data intel_cht_wc_pmic_opregion_data = { static const struct intel_pmic_opregion_data intel_cht_wc_pmic_opregion_data = {
.get_power = intel_cht_wc_pmic_get_power, .get_power = intel_cht_wc_pmic_get_power,
.update_power = intel_cht_wc_pmic_update_power, .update_power = intel_cht_wc_pmic_update_power,
.exec_mipi_pmic_seq_element = intel_cht_wc_exec_mipi_pmic_seq_element, .exec_mipi_pmic_seq_element = intel_cht_wc_exec_mipi_pmic_seq_element,
......
...@@ -293,7 +293,7 @@ static int intel_xpower_exec_mipi_pmic_seq_element(struct regmap *regmap, ...@@ -293,7 +293,7 @@ static int intel_xpower_exec_mipi_pmic_seq_element(struct regmap *regmap,
return ret; return ret;
} }
static struct intel_pmic_opregion_data intel_xpower_pmic_opregion_data = { static const struct intel_pmic_opregion_data intel_xpower_pmic_opregion_data = {
.get_power = intel_xpower_pmic_get_power, .get_power = intel_xpower_pmic_get_power,
.update_power = intel_xpower_pmic_update_power, .update_power = intel_xpower_pmic_update_power,
.get_raw_temp = intel_xpower_pmic_get_raw_temp, .get_raw_temp = intel_xpower_pmic_get_raw_temp,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment