/* * Arizona core driver * * Copyright 2012 Wolfson Microelectronics plc * * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */#include<linux/clk.h>#include<linux/delay.h>#include<linux/err.h>#include<linux/gpio/consumer.h>#include<linux/interrupt.h>#include<linux/mfd/core.h>#include<linux/module.h>#include<linux/of.h>#include<linux/of_device.h>#include<linux/pm_runtime.h>#include<linux/regmap.h>#include<linux/regulator/consumer.h>#include<linux/regulator/machine.h>#include<linux/slab.h>#include<linux/platform_device.h>#include<linux/mfd/arizona/core.h>#include<linux/mfd/arizona/registers.h>#include"arizona.h"staticconstchar*constwm5102_core_supplies[]={"AVDD","DBVDD1",};intarizona_clk32k_enable(structarizona*arizona){intret=0;mutex_lock(&arizona->clk_lock);arizona->clk32k_ref++;if(arizona->clk32k_ref==1){switch(arizona->pdata.clk32k_src){caseARIZONA_32KZ_MCLK1:ret=pm_runtime_get_sync(arizona->dev);if(ret!=0)gotoerr_ref;ret=clk_prepare_enable(arizona->mclk[ARIZONA_MCLK1]);if(ret!=0)gotoerr_pm