This is the pxa changes for v4.10 cycle.

This cycle is covering :
  - some clock fixes common with sa1100 architecture
  - the consequence of the pxa_camera conversion to v4l2
  - a small irq related fix for pxa25x device-tree only
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJYIkw2AAoJEAP2et0duMsSAVMP/1nQWA24IXAFMEVBroGHz1r/
 /RXS3eJ5sfGxVcvCMPTPiE18+jqGHtNgnZH2sFkwUqByTq5SkSZOS13q2gN6iUBs
 M2zSqYS6FKQvEdzMzqOq5acyRR02fyrvn4SoaUBNUUzqJ93G7ITJjLnUm4EJ1RdU
 rQ76MuHr/QB7q7L2OJtHwgoZt+CmxpioCRu+yW2UEhFNaJ6zRVrPyKtQNLzze7UB
 BSgS8pKR1a8lMRwkt8ciw40Pz5YDKOI7ZYgEwms50fu0GliFTt0RrbE7H5Gm9ur4
 mDR7m9puhLssAFIXIQc7mSMNI88CsUFhRmqeKfBOtWQ/1IKXSCZiAQrUY+DRH+fo
 xAOJlzF88V7nKpnkmN+fvZeOnUusPS2Avree0dZT8VyNa2FvdvBXOJmdZXAA81FG
 YIwpVV3ZLud5rT3eHWzpCInDUbjw0wBrDYcdHenJTmdtAb5oRVJtWlWmZuk3f3iG
 q9ILDAcVoWwI1orozbCcXS98hE74EPdUtkMzBnXCBYaplqsw2aAjbX5Usn30YEZz
 SkE2bMh0yyv2J3yUNUgFWgDYsbgT8zRLOvUoy9g6OlisL3ZOT4QLghRzbAiW7bXG
 UaK6ezzvK/oTABIS5gaWgRxR9oM2xNCST1CBBLX8g9o9NNj60AxSfVfh/i+iHp1B
 Y03pa/bFqOWeeK1shPmD
 =1WrE
 -----END PGP SIGNATURE-----

Merge tag 'pxa-for-4.10' of https://github.com/rjarzmik/linux into next/soc

This is the pxa changes for v4.10 cycle.

This cycle is covering :
 - some clock fixes common with sa1100 architecture
 - the consequence of the pxa_camera conversion to v4l2
 - a small irq related fix for pxa25x device-tree only

* tag 'pxa-for-4.10' of https://github.com/rjarzmik/linux:
  ARM: pxa: fix pxa25x interrupt init
  ARM: pxa: remove duplicated include from spitz.c
  ARM: pxa: em-x270: use the new pxa_camera platform_data
  ARM: pxa: ezx: use the new pxa_camera platform_data
  ARM: pxa: mioa701: use the new pxa_camera platform_data
  ARM: pxa: pxa_cplds: honor probe deferral
  ARM: sa11x0/pxa: get rid of get_clock_tick_rate
  watchdog: sa11x0/pxa: get rid of get_clock_tick_rate
  ARM: sa11x0/pxa: acquire timer rate from the clock rate
  clk: pxa25x: OSTIMER0 clocks from the main oscillator

Signed-off-by: Olof Johansson <olof@lixom.net>
This commit is contained in:
Olof Johansson 2016-11-17 23:15:25 -08:00
commit 9e27a0aac0
15 changed files with 162 additions and 237 deletions

View File

@ -35,7 +35,6 @@
#include <linux/mtd/sharpsl.h>
#include <linux/input/matrix_keypad.h>
#include <linux/gpio_keys.h>
#include <linux/module.h>
#include <linux/memblock.h>
#include <video/w100fb.h>

View File

@ -23,6 +23,7 @@
#include <linux/gpio.h>
#include <linux/mfd/da903x.h>
#include <linux/regulator/machine.h>
#include <linux/regulator/fixed.h>
#include <linux/spi/spi.h>
#include <linux/spi/tdo24m.h>
#include <linux/spi/libertas_spi.h>
@ -34,8 +35,6 @@
#include <linux/i2c/pxa-i2c.h>
#include <linux/regulator/userspace-consumer.h>
#include <media/soc_camera.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@ -958,8 +957,6 @@ static inline void em_x270_init_gpio_keys(void) {}
/* Quick Capture Interface and sensor setup */
#if defined(CONFIG_VIDEO_PXA27x) || defined(CONFIG_VIDEO_PXA27x_MODULE)
static struct regulator *em_x270_camera_ldo;
static int em_x270_sensor_init(void)
{
int ret;
@ -969,81 +966,53 @@ static int em_x270_sensor_init(void)
return ret;
gpio_direction_output(cam_reset, 0);
em_x270_camera_ldo = regulator_get(NULL, "vcc cam");
if (em_x270_camera_ldo == NULL) {
gpio_free(cam_reset);
return -ENODEV;
}
ret = regulator_enable(em_x270_camera_ldo);
if (ret) {
regulator_put(em_x270_camera_ldo);
gpio_free(cam_reset);
return ret;
}
gpio_set_value(cam_reset, 1);
return 0;
}
static struct regulator_consumer_supply camera_dummy_supplies[] = {
REGULATOR_SUPPLY("vdd", "0-005d"),
};
static struct regulator_init_data camera_dummy_initdata = {
.consumer_supplies = camera_dummy_supplies,
.num_consumer_supplies = ARRAY_SIZE(camera_dummy_supplies),
.constraints = {
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
},
};
static struct fixed_voltage_config camera_dummy_config = {
.supply_name = "camera_vdd",
.input_supply = "vcc cam",
.microvolts = 2800000,
.gpio = -1,
.enable_high = 0,
.init_data = &camera_dummy_initdata,
};
static struct platform_device camera_supply_dummy_device = {
.name = "reg-fixed-voltage",
.id = 1,
.dev = {
.platform_data = &camera_dummy_config,
},
};
struct pxacamera_platform_data em_x270_camera_platform_data = {
.flags = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
.mclk_10khz = 2600,
};
static int em_x270_sensor_power(struct device *dev, int on)
{
int ret;
int is_on = regulator_is_enabled(em_x270_camera_ldo);
if (on == is_on)
return 0;
gpio_set_value(cam_reset, !on);
if (on)
ret = regulator_enable(em_x270_camera_ldo);
else
ret = regulator_disable(em_x270_camera_ldo);
if (ret)
return ret;
gpio_set_value(cam_reset, on);
return 0;
}
static struct i2c_board_info em_x270_i2c_cam_info[] = {
{
I2C_BOARD_INFO("mt9m111", 0x48),
},
};
static struct soc_camera_link iclink = {
.bus_id = 0,
.power = em_x270_sensor_power,
.board_info = &em_x270_i2c_cam_info[0],
.i2c_adapter_id = 0,
};
static struct platform_device em_x270_camera = {
.name = "soc-camera-pdrv",
.id = -1,
.dev = {
.platform_data = &iclink,
},
.sensor_i2c_adapter_id = 0,
.sensor_i2c_address = 0x5d,
};
static void __init em_x270_init_camera(void)
{
if (em_x270_sensor_init() == 0) {
if (em_x270_sensor_init() == 0)
pxa_set_camera_info(&em_x270_camera_platform_data);
platform_device_register(&em_x270_camera);
}
platform_device_register(&camera_supply_dummy_device);
}
#else
static inline void em_x270_init_camera(void) {}

View File

@ -17,14 +17,14 @@
#include <linux/delay.h>
#include <linux/pwm.h>
#include <linux/pwm_backlight.h>
#include <linux/regulator/machine.h>
#include <linux/regulator/fixed.h>
#include <linux/input.h>
#include <linux/gpio.h>
#include <linux/gpio_keys.h>
#include <linux/leds-lp3944.h>
#include <linux/i2c/pxa-i2c.h>
#include <media/soc_camera.h>
#include <asm/setup.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@ -723,43 +723,33 @@ static struct platform_device a780_gpio_keys = {
};
/* camera */
static int a780_camera_init(void)
{
int err;
static struct regulator_consumer_supply camera_dummy_supplies[] = {
REGULATOR_SUPPLY("vdd", "0-005d"),
};
/*
* GPIO50_nCAM_EN is active low
* GPIO19_GEN1_CAM_RST is active on rising edge
*/
err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN");
if (err) {
pr_err("%s: Failed to request nCAM_EN\n", __func__);
goto fail;
}
static struct regulator_init_data camera_dummy_initdata = {
.consumer_supplies = camera_dummy_supplies,
.num_consumer_supplies = ARRAY_SIZE(camera_dummy_supplies),
.constraints = {
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
},
};
err = gpio_request(GPIO19_GEN1_CAM_RST, "CAM_RST");
if (err) {
pr_err("%s: Failed to request CAM_RST\n", __func__);
goto fail_gpio_cam_rst;
}
gpio_direction_output(GPIO50_nCAM_EN, 1);
gpio_direction_output(GPIO19_GEN1_CAM_RST, 0);
return 0;
fail_gpio_cam_rst:
gpio_free(GPIO50_nCAM_EN);
fail:
return err;
}
static int a780_camera_power(struct device *dev, int on)
{
gpio_set_value(GPIO50_nCAM_EN, !on);
return 0;
}
static struct fixed_voltage_config camera_dummy_config = {
.supply_name = "camera_vdd",
.microvolts = 2800000,
.gpio = GPIO50_nCAM_EN,
.enable_high = 0,
.init_data = &camera_dummy_initdata,
};
static struct platform_device camera_supply_dummy_device = {
.name = "reg-fixed-voltage",
.id = 1,
.dev = {
.platform_data = &camera_dummy_config,
},
};
static int a780_camera_reset(struct device *dev)
{
gpio_set_value(GPIO19_GEN1_CAM_RST, 0);
@ -769,35 +759,44 @@ static int a780_camera_reset(struct device *dev)
return 0;
}
static int a780_camera_init(void)
{
int err;
/*
* GPIO50_nCAM_EN is active low
* GPIO19_GEN1_CAM_RST is active on rising edge
*/
err = gpio_request(GPIO19_GEN1_CAM_RST, "CAM_RST");
if (err) {
pr_err("%s: Failed to request CAM_RST\n", __func__);
return err;
}
gpio_direction_output(GPIO19_GEN1_CAM_RST, 0);
a780_camera_reset(NULL);
return 0;
}
struct pxacamera_platform_data a780_pxacamera_platform_data = {
.flags = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN |
PXA_CAMERA_PCP,
.mclk_10khz = 5000,
.sensor_i2c_adapter_id = 0,
.sensor_i2c_address = 0x5d,
};
static struct i2c_board_info a780_camera_i2c_board_info = {
I2C_BOARD_INFO("mt9m111", 0x5d),
};
static struct soc_camera_link a780_iclink = {
.bus_id = 0,
.flags = SOCAM_SENSOR_INVERT_PCLK,
.i2c_adapter_id = 0,
.board_info = &a780_camera_i2c_board_info,
.power = a780_camera_power,
.reset = a780_camera_reset,
};
static struct platform_device a780_camera = {
.name = "soc-camera-pdrv",
.id = 0,
.dev = {
.platform_data = &a780_iclink,
static struct i2c_board_info a780_i2c_board_info[] = {
{
I2C_BOARD_INFO("mt9m111", 0x5d),
},
};
static struct platform_device *a780_devices[] __initdata = {
&a780_gpio_keys,
&camera_supply_dummy_device,
};
static void __init a780_init(void)
@ -811,19 +810,19 @@ static void __init a780_init(void)
pxa_set_stuart_info(NULL);
pxa_set_i2c_info(NULL);
i2c_register_board_info(0, ARRAY_AND_SIZE(a780_i2c_board_info));
pxa_set_fb_info(NULL, &ezx_fb_info_1);
pxa_set_keypad_info(&a780_keypad_platform_data);
if (a780_camera_init() == 0) {
if (a780_camera_init() == 0)
pxa_set_camera_info(&a780_pxacamera_platform_data);
platform_device_register(&a780_camera);
}
pwm_add_table(ezx_pwm_lookup, ARRAY_SIZE(ezx_pwm_lookup));
platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
platform_add_devices(ARRAY_AND_SIZE(a780_devices));
regulator_has_full_constraints();
}
MACHINE_START(EZX_A780, "Motorola EZX A780")
@ -1001,43 +1000,6 @@ static struct platform_device a910_gpio_keys = {
};
/* camera */
static int a910_camera_init(void)
{
int err;
/*
* GPIO50_nCAM_EN is active low
* GPIO28_GEN2_CAM_RST is active on rising edge
*/
err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN");
if (err) {
pr_err("%s: Failed to request nCAM_EN\n", __func__);
goto fail;
}
err = gpio_request(GPIO28_GEN2_CAM_RST, "CAM_RST");
if (err) {
pr_err("%s: Failed to request CAM_RST\n", __func__);
goto fail_gpio_cam_rst;
}
gpio_direction_output(GPIO50_nCAM_EN, 1);
gpio_direction_output(GPIO28_GEN2_CAM_RST, 0);
return 0;
fail_gpio_cam_rst:
gpio_free(GPIO50_nCAM_EN);
fail:
return err;
}
static int a910_camera_power(struct device *dev, int on)
{
gpio_set_value(GPIO50_nCAM_EN, !on);
return 0;
}
static int a910_camera_reset(struct device *dev)
{
gpio_set_value(GPIO28_GEN2_CAM_RST, 0);
@ -1047,30 +1009,33 @@ static int a910_camera_reset(struct device *dev)
return 0;
}
static int a910_camera_init(void)
{
int err;
/*
* GPIO50_nCAM_EN is active low
* GPIO28_GEN2_CAM_RST is active on rising edge
*/
err = gpio_request(GPIO28_GEN2_CAM_RST, "CAM_RST");
if (err) {
pr_err("%s: Failed to request CAM_RST\n", __func__);
return err;
}
gpio_direction_output(GPIO28_GEN2_CAM_RST, 0);
a910_camera_reset(NULL);
return 0;
}
struct pxacamera_platform_data a910_pxacamera_platform_data = {
.flags = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN |
PXA_CAMERA_PCP,
.mclk_10khz = 5000,
};
static struct i2c_board_info a910_camera_i2c_board_info = {
I2C_BOARD_INFO("mt9m111", 0x5d),
};
static struct soc_camera_link a910_iclink = {
.bus_id = 0,
.i2c_adapter_id = 0,
.board_info = &a910_camera_i2c_board_info,
.power = a910_camera_power,
.reset = a910_camera_reset,
};
static struct platform_device a910_camera = {
.name = "soc-camera-pdrv",
.id = 0,
.dev = {
.platform_data = &a910_iclink,
},
.sensor_i2c_adapter_id = 0,
.sensor_i2c_address = 0x5d,
};
/* leds-lp3944 */
@ -1122,10 +1087,14 @@ static struct i2c_board_info __initdata a910_i2c_board_info[] = {
I2C_BOARD_INFO("lp3944", 0x60),
.platform_data = &a910_lp3944_leds,
},
{
I2C_BOARD_INFO("mt9m111", 0x5d),
},
};
static struct platform_device *a910_devices[] __initdata = {
&a910_gpio_keys,
&camera_supply_dummy_device,
};
static void __init a910_init(void)
@ -1145,14 +1114,13 @@ static void __init a910_init(void)
pxa_set_keypad_info(&a910_keypad_platform_data);
if (a910_camera_init() == 0) {
if (a910_camera_init() == 0)
pxa_set_camera_info(&a910_pxacamera_platform_data);
platform_device_register(&a910_camera);
}
pwm_add_table(ezx_pwm_lookup, ARRAY_SIZE(ezx_pwm_lookup));
platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
platform_add_devices(ARRAY_AND_SIZE(a910_devices));
regulator_has_full_constraints();
}
MACHINE_START(EZX_A910, "Motorola EZX A910")

View File

@ -43,21 +43,6 @@ void clear_reset_status(unsigned int mask)
}
}
unsigned long get_clock_tick_rate(void)
{
unsigned long clock_tick_rate;
if (cpu_is_pxa25x())
clock_tick_rate = 3686400;
else if (machine_is_mainstone())
clock_tick_rate = 3249600;
else
clock_tick_rate = 3250000;
return clock_tick_rate;
}
EXPORT_SYMBOL(get_clock_tick_rate);
/*
* For non device-tree builds, keep legacy timer init
*/
@ -69,8 +54,7 @@ void __init pxa_timer_init(void)
pxa27x_clocks_init();
if (cpu_is_pxa3xx())
pxa3xx_clocks_init();
pxa_timer_nodt_init(IRQ_OST0, io_p2v(0x40a00000),
get_clock_tick_rate());
pxa_timer_nodt_init(IRQ_OST0, io_p2v(0x40a00000));
}
/*

View File

@ -303,8 +303,6 @@
*/
extern unsigned int get_memclk_frequency_10khz(void);
/* return the clock tick rate of the OS timer */
extern unsigned long get_clock_tick_rate(void);
#endif
#endif /* _ASM_ARCH_HARDWARE_H */

View File

@ -57,7 +57,6 @@
#include <linux/platform_data/media/camera-pxa.h>
#include <mach/audio.h>
#include <mach/smemc.h>
#include <media/soc_camera.h>
#include "mioa701.h"
@ -627,6 +626,8 @@ struct pxacamera_platform_data mioa701_pxacamera_platform_data = {
.flags = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
.mclk_10khz = 5000,
.sensor_i2c_adapter_id = 0,
.sensor_i2c_address = 0x5d,
};
static struct i2c_board_info __initdata mioa701_pi2c_devices[] = {
@ -643,12 +644,6 @@ static struct i2c_board_info mioa701_i2c_devices[] = {
},
};
static struct soc_camera_link iclink = {
.bus_id = 0, /* Match id in pxa27x_device_camera in device.c */
.board_info = &mioa701_i2c_devices[0],
.i2c_adapter_id = 0,
};
struct i2c_pxa_platform_data i2c_pdata = {
.fast_mode = 1,
};
@ -684,7 +679,6 @@ MIO_SIMPLE_DEV(mioa701_sound, "mioa701-wm9713", NULL)
MIO_SIMPLE_DEV(mioa701_board, "mioa701-board", NULL)
MIO_SIMPLE_DEV(wm9713_acodec, "wm9713-codec", NULL);
MIO_SIMPLE_DEV(gpio_vbus, "gpio-vbus", &gpio_vbus_data);
MIO_SIMPLE_DEV(mioa701_camera, "soc-camera-pdrv",&iclink);
static struct platform_device *devices[] __initdata = {
&mioa701_gpio_keys,
@ -696,7 +690,6 @@ static struct platform_device *devices[] __initdata = {
&power_dev,
&docg3,
&gpio_vbus,
&mioa701_camera,
&mioa701_board,
};
@ -761,6 +754,7 @@ static void __init mioa701_machine_init(void)
platform_add_devices(devices, ARRAY_SIZE(devices));
gsm_init();
i2c_register_board_info(0, ARRAY_AND_SIZE(mioa701_i2c_devices));
i2c_register_board_info(1, ARRAY_AND_SIZE(mioa701_pi2c_devices));
pxa_set_i2c_info(&i2c_pdata);
pxa27x_set_i2c_power_info(NULL);
@ -769,6 +763,7 @@ static void __init mioa701_machine_init(void)
regulator_register_always_on(0, "fixed-5.0V", fixed_5v0_consumers,
ARRAY_SIZE(fixed_5v0_consumers),
5000000);
regulator_has_full_constraints();
}
static void mioa701_machine_exit(void)

View File

@ -156,7 +156,7 @@ static int __init __init
pxa25x_dt_init_irq(struct device_node *node, struct device_node *parent)
{
pxa_dt_irq_init(pxa25x_set_wake);
set_handle_irq(ichp_handle_irq);
set_handle_irq(icip_handle_irq);
return 0;
}

View File

@ -120,13 +120,9 @@ static int cplds_probe(struct platform_device *pdev)
if (!fpga)
return -ENOMEM;
res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
if (res) {
fpga->irq = (unsigned int)res->start;
irqflags = res->flags;
}
if (!fpga->irq)
return -ENODEV;
fpga->irq = platform_get_irq(pdev, 0);
if (fpga->irq <= 0)
return fpga->irq;
base_irq = platform_get_irq(pdev, 1);
if (base_irq < 0)
@ -142,6 +138,7 @@ static int cplds_probe(struct platform_device *pdev)
writel(fpga->irq_mask, fpga->base + FPGA_IRQ_MASK_EN);
writel(0, fpga->base + FPGA_IRQ_SET_CLR);
irqflags = irq_get_trigger_type(fpga->irq);
ret = devm_request_irq(&pdev->dev, fpga->irq, cplds_irq_handler,
irqflags, dev_name(&pdev->dev), fpga);
if (ret == -ENOSYS)

View File

@ -31,7 +31,6 @@
#include <linux/input/matrix_keypad.h>
#include <linux/regulator/machine.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/reboot.h>
#include <linux/memblock.h>

View File

@ -378,7 +378,7 @@ void __init sa1100_map_io(void)
void __init sa1100_timer_init(void)
{
pxa_timer_nodt_init(IRQ_OST0, io_p2v(0x90000000), 3686400);
pxa_timer_nodt_init(IRQ_OST0, io_p2v(0x90000000));
}
static struct resource irq_resource =

View File

@ -43,10 +43,6 @@
# define __REG(x) (*((volatile unsigned long __iomem *)io_p2v(x)))
# define __PREG(x) (io_v2p((unsigned long)&(x)))
static inline unsigned long get_clock_tick_rate(void)
{
return 3686400;
}
#else
# define __REG(x) io_p2v(x)

View File

@ -230,7 +230,7 @@ static struct dummy_clk dummy_clks[] __initdata = {
DUMMY_CLK("GPIO11_CLK", NULL, "osc_3_6864mhz"),
DUMMY_CLK("GPIO12_CLK", NULL, "osc_32_768khz"),
DUMMY_CLK(NULL, "sa1100-rtc", "osc_32_768khz"),
DUMMY_CLK("OSTIMER0", NULL, "osc_32_768khz"),
DUMMY_CLK("OSTIMER0", NULL, "osc_3_6864mhz"),
DUMMY_CLK("UARTCLK", "pxa2xx-ir", "STUART"),
};

View File

@ -220,17 +220,16 @@ CLOCKSOURCE_OF_DECLARE(pxa_timer, "marvell,pxa-timer", pxa_timer_dt_init);
/*
* Legacy timer init for non device-tree boards.
*/
void __init pxa_timer_nodt_init(int irq, void __iomem *base,
unsigned long clock_tick_rate)
void __init pxa_timer_nodt_init(int irq, void __iomem *base)
{
struct clk *clk;
timer_base = base;
clk = clk_get(NULL, "OSTIMER0");
if (clk && !IS_ERR(clk))
if (clk && !IS_ERR(clk)) {
clk_prepare_enable(clk);
else
pxa_timer_common_init(irq, clk_get_rate(clk));
} else {
pr_crit("%s: unable to get clk\n", __func__);
pxa_timer_common_init(irq, clock_tick_rate);
}
}

View File

@ -22,6 +22,7 @@
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/clk.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/fs.h>
@ -155,12 +156,27 @@ static struct miscdevice sa1100dog_miscdev = {
};
static int margin __initdata = 60; /* (secs) Default is 1 minute */
static struct clk *clk;
static int __init sa1100dog_init(void)
{
int ret;
oscr_freq = get_clock_tick_rate();
clk = clk_get(NULL, "OSTIMER0");
if (IS_ERR(clk)) {
pr_err("SA1100/PXA2xx Watchdog Timer: clock not found: %d\n",
(int) PTR_ERR(clk));
return PTR_ERR(clk);
}
ret = clk_prepare_enable(clk);
if (ret) {
pr_err("SA1100/PXA2xx Watchdog Timer: clock failed to prepare+enable: %d\n",
ret);
goto err;
}
oscr_freq = clk_get_rate(clk);
/*
* Read the reset status, and save it for later. If
@ -176,11 +192,17 @@ static int __init sa1100dog_init(void)
pr_info("SA1100/PXA2xx Watchdog Timer: timer margin %d sec\n",
margin);
return ret;
err:
clk_disable_unprepare(clk);
clk_put(clk);
return ret;
}
static void __exit sa1100dog_exit(void)
{
misc_deregister(&sa1100dog_miscdev);
clk_disable_unprepare(clk);
clk_put(clk);
}
module_init(sa1100dog_init);

View File

@ -12,7 +12,6 @@
#ifndef _CLOCKSOURCE_PXA_H
#define _CLOCKSOURCE_PXA_H
extern void pxa_timer_nodt_init(int irq, void __iomem *base,
unsigned long clock_tick_rate);
extern void pxa_timer_nodt_init(int irq, void __iomem *base);
#endif