aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorRickard Strandqvist <rickard_strandqvist@spectrumdigital.se>2014-12-07 12:24:07 -0500
committerTony Lindgren <tony@atomide.com>2015-01-07 12:53:51 -0500
commit1bbc360bb7eb7c40d074c9279b3cff20755131ef (patch)
treecc0fb74a14b5f5c1333f934f46f921328a203a8f /arch/arm/mach-omap2
parentcecec93df8be3a2ad49b3fb519fa37dba357843e (diff)
ARM: OMAP2+: omap_hwmod.c: Remove some unused functions
Removes some functions that are not used anywhere: omap_hwmod_pad_route_irq() omap_hwmod_no_setup_reset() omap_hwmod_read_hardreset() omap_hwmod_del_initiator_dep() omap_hwmod_enable_clocks() omap_hwmod_reset() omap_hwmod_ocp_barrier() omap_hwmod_disable_clocks() omap_hwmod_add_initiator_dep() This was partially found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c232
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.h16
2 files changed, 0 insertions, 248 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index cbb908dc5cf0..e341e5dfff2d 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -3384,91 +3384,6 @@ int omap_hwmod_shutdown(struct omap_hwmod *oh)
3384 return 0; 3384 return 0;
3385} 3385}
3386 3386
3387/**
3388 * omap_hwmod_enable_clocks - enable main_clk, all interface clocks
3389 * @oh: struct omap_hwmod *oh
3390 *
3391 * Intended to be called by the omap_device code.
3392 */
3393int omap_hwmod_enable_clocks(struct omap_hwmod *oh)
3394{
3395 unsigned long flags;
3396
3397 spin_lock_irqsave(&oh->_lock, flags);
3398 _enable_clocks(oh);
3399 spin_unlock_irqrestore(&oh->_lock, flags);
3400
3401 return 0;
3402}
3403
3404/**
3405 * omap_hwmod_disable_clocks - disable main_clk, all interface clocks
3406 * @oh: struct omap_hwmod *oh
3407 *
3408 * Intended to be called by the omap_device code.
3409 */
3410int omap_hwmod_disable_clocks(struct omap_hwmod *oh)
3411{
3412 unsigned long flags;
3413
3414 spin_lock_irqsave(&oh->_lock, flags);
3415 _disable_clocks(oh);
3416 spin_unlock_irqrestore(&oh->_lock, flags);
3417
3418 return 0;
3419}
3420
3421/**
3422 * omap_hwmod_ocp_barrier - wait for posted writes against the hwmod to complete
3423 * @oh: struct omap_hwmod *oh
3424 *
3425 * Intended to be called by drivers and core code when all posted
3426 * writes to a device must complete before continuing further
3427 * execution (for example, after clearing some device IRQSTATUS
3428 * register bits)
3429 *
3430 * XXX what about targets with multiple OCP threads?
3431 */
3432void omap_hwmod_ocp_barrier(struct omap_hwmod *oh)
3433{
3434 BUG_ON(!oh);
3435
3436 if (!oh->class->sysc || !oh->class->sysc->sysc_flags) {
3437 WARN(1, "omap_device: %s: OCP barrier impossible due to device configuration\n",
3438 oh->name);
3439 return;
3440 }
3441
3442 /*
3443 * Forces posted writes to complete on the OCP thread handling
3444 * register writes
3445 */
3446 omap_hwmod_read(oh, oh->class->sysc->sysc_offs);
3447}
3448
3449/**
3450 * omap_hwmod_reset - reset the hwmod
3451 * @oh: struct omap_hwmod *
3452 *
3453 * Under some conditions, a driver may wish to reset the entire device.
3454 * Called from omap_device code. Returns -EINVAL on error or passes along
3455 * the return value from _reset().
3456 */
3457int omap_hwmod_reset(struct omap_hwmod *oh)
3458{
3459 int r;
3460 unsigned long flags;
3461
3462 if (!oh)
3463 return -EINVAL;
3464
3465 spin_lock_irqsave(&oh->_lock, flags);
3466 r = _reset(oh);
3467 spin_unlock_irqrestore(&oh->_lock, flags);
3468
3469 return r;
3470}
3471
3472/* 3387/*
3473 * IP block data retrieval functions 3388 * IP block data retrieval functions
3474 */ 3389 */
@@ -3723,52 +3638,12 @@ void __iomem *omap_hwmod_get_mpu_rt_va(struct omap_hwmod *oh)
3723 return oh->_mpu_rt_va; 3638 return oh->_mpu_rt_va;
3724} 3639}
3725 3640
3726/**
3727 * omap_hwmod_add_initiator_dep - add sleepdep from @init_oh to @oh
3728 * @oh: struct omap_hwmod *
3729 * @init_oh: struct omap_hwmod * (initiator)
3730 *
3731 * Add a sleep dependency between the initiator @init_oh and @oh.
3732 * Intended to be called by DSP/Bridge code via platform_data for the
3733 * DSP case; and by the DMA code in the sDMA case. DMA code, *Bridge
3734 * code needs to add/del initiator dependencies dynamically
3735 * before/after accessing a device. Returns the return value from
3736 * _add_initiator_dep().
3737 *
3738 * XXX Keep a usecount in the clockdomain code
3739 */
3740int omap_hwmod_add_initiator_dep(struct omap_hwmod *oh,
3741 struct omap_hwmod *init_oh)
3742{
3743 return _add_initiator_dep(oh, init_oh);
3744}
3745
3746/* 3641/*
3747 * XXX what about functions for drivers to save/restore ocp_sysconfig 3642 * XXX what about functions for drivers to save/restore ocp_sysconfig
3748 * for context save/restore operations? 3643 * for context save/restore operations?
3749 */ 3644 */
3750 3645
3751/** 3646/**
3752 * omap_hwmod_del_initiator_dep - remove sleepdep from @init_oh to @oh
3753 * @oh: struct omap_hwmod *
3754 * @init_oh: struct omap_hwmod * (initiator)
3755 *
3756 * Remove a sleep dependency between the initiator @init_oh and @oh.
3757 * Intended to be called by DSP/Bridge code via platform_data for the
3758 * DSP case; and by the DMA code in the sDMA case. DMA code, *Bridge
3759 * code needs to add/del initiator dependencies dynamically
3760 * before/after accessing a device. Returns the return value from
3761 * _del_initiator_dep().
3762 *
3763 * XXX Keep a usecount in the clockdomain code
3764 */
3765int omap_hwmod_del_initiator_dep(struct omap_hwmod *oh,
3766 struct omap_hwmod *init_oh)
3767{
3768 return _del_initiator_dep(oh, init_oh);
3769}
3770
3771/**
3772 * omap_hwmod_enable_wakeup - allow device to wake up the system 3647 * omap_hwmod_enable_wakeup - allow device to wake up the system
3773 * @oh: struct omap_hwmod * 3648 * @oh: struct omap_hwmod *
3774 * 3649 *
@@ -3889,33 +3764,6 @@ int omap_hwmod_deassert_hardreset(struct omap_hwmod *oh, const char *name)
3889} 3764}
3890 3765
3891/** 3766/**
3892 * omap_hwmod_read_hardreset - read the HW reset line state of submodules
3893 * contained in the hwmod module
3894 * @oh: struct omap_hwmod *
3895 * @name: name of the reset line to look up and read
3896 *
3897 * Return the current state of the hwmod @oh's reset line named @name:
3898 * returns -EINVAL upon parameter error or if this operation
3899 * is unsupported on the current OMAP; otherwise, passes along the return
3900 * value from _read_hardreset().
3901 */
3902int omap_hwmod_read_hardreset(struct omap_hwmod *oh, const char *name)
3903{
3904 int ret;
3905 unsigned long flags;
3906
3907 if (!oh)
3908 return -EINVAL;
3909
3910 spin_lock_irqsave(&oh->_lock, flags);
3911 ret = _read_hardreset(oh, name);
3912 spin_unlock_irqrestore(&oh->_lock, flags);
3913
3914 return ret;
3915}
3916
3917
3918/**
3919 * omap_hwmod_for_each_by_class - call @fn for each hwmod of class @classname 3767 * omap_hwmod_for_each_by_class - call @fn for each hwmod of class @classname
3920 * @classname: struct omap_hwmod_class name to search for 3768 * @classname: struct omap_hwmod_class name to search for
3921 * @fn: callback function pointer to call for each hwmod in class @classname 3769 * @fn: callback function pointer to call for each hwmod in class @classname
@@ -4025,86 +3873,6 @@ int omap_hwmod_get_context_loss_count(struct omap_hwmod *oh)
4025} 3873}
4026 3874
4027/** 3875/**
4028 * omap_hwmod_no_setup_reset - prevent a hwmod from being reset upon setup
4029 * @oh: struct omap_hwmod *
4030 *
4031 * Prevent the hwmod @oh from being reset during the setup process.
4032 * Intended for use by board-*.c files on boards with devices that
4033 * cannot tolerate being reset. Must be called before the hwmod has
4034 * been set up. Returns 0 upon success or negative error code upon
4035 * failure.
4036 */
4037int omap_hwmod_no_setup_reset(struct omap_hwmod *oh)
4038{
4039 if (!oh)
4040 return -EINVAL;
4041
4042 if (oh->_state != _HWMOD_STATE_REGISTERED) {
4043 pr_err("omap_hwmod: %s: cannot prevent setup reset; in wrong state\n",
4044 oh->name);
4045 return -EINVAL;
4046 }
4047
4048 oh->flags |= HWMOD_INIT_NO_RESET;
4049
4050 return 0;
4051}
4052
4053/**
4054 * omap_hwmod_pad_route_irq - route an I/O pad wakeup to a particular MPU IRQ
4055 * @oh: struct omap_hwmod * containing hwmod mux entries
4056 * @pad_idx: array index in oh->mux of the hwmod mux entry to route wakeup
4057 * @irq_idx: the hwmod mpu_irqs array index of the IRQ to trigger on wakeup
4058 *
4059 * When an I/O pad wakeup arrives for the dynamic or wakeup hwmod mux
4060 * entry number @pad_idx for the hwmod @oh, trigger the interrupt
4061 * service routine for the hwmod's mpu_irqs array index @irq_idx. If
4062 * this function is not called for a given pad_idx, then the ISR
4063 * associated with @oh's first MPU IRQ will be triggered when an I/O
4064 * pad wakeup occurs on that pad. Note that @pad_idx is the index of
4065 * the _dynamic or wakeup_ entry: if there are other entries not
4066 * marked with OMAP_DEVICE_PAD_WAKEUP or OMAP_DEVICE_PAD_REMUX, these
4067 * entries are NOT COUNTED in the dynamic pad index. This function
4068 * must be called separately for each pad that requires its interrupt
4069 * to be re-routed this way. Returns -EINVAL if there is an argument
4070 * problem or if @oh does not have hwmod mux entries or MPU IRQs;
4071 * returns -ENOMEM if memory cannot be allocated; or 0 upon success.
4072 *
4073 * XXX This function interface is fragile. Rather than using array
4074 * indexes, which are subject to unpredictable change, it should be
4075 * using hwmod IRQ names, and some other stable key for the hwmod mux
4076 * pad records.
4077 */
4078int omap_hwmod_pad_route_irq(struct omap_hwmod *oh, int pad_idx, int irq_idx)
4079{
4080 int nr_irqs;
4081
4082 might_sleep();
4083
4084 if (!oh || !oh->mux || !oh->mpu_irqs || pad_idx < 0 ||
4085 pad_idx >= oh->mux->nr_pads_dynamic)
4086 return -EINVAL;
4087
4088 /* Check the number of available mpu_irqs */
4089 for (nr_irqs = 0; oh->mpu_irqs[nr_irqs].irq >= 0; nr_irqs++)
4090 ;
4091
4092 if (irq_idx >= nr_irqs)
4093 return -EINVAL;
4094
4095 if (!oh->mux->irqs) {
4096 /* XXX What frees this? */
4097 oh->mux->irqs = kzalloc(sizeof(int) * oh->mux->nr_pads_dynamic,
4098 GFP_KERNEL);
4099 if (!oh->mux->irqs)
4100 return -ENOMEM;
4101 }
4102 oh->mux->irqs[pad_idx] = irq_idx;
4103
4104 return 0;
4105}
4106
4107/**
4108 * omap_hwmod_init - initialize the hwmod code 3876 * omap_hwmod_init - initialize the hwmod code
4109 * 3877 *
4110 * Sets up some function pointers needed by the hwmod code to operate on the 3878 * Sets up some function pointers needed by the hwmod code to operate on the
diff --git a/arch/arm/mach-omap2/omap_hwmod.h b/arch/arm/mach-omap2/omap_hwmod.h
index 35ca6efbec31..2678d2144ca8 100644
--- a/arch/arm/mach-omap2/omap_hwmod.h
+++ b/arch/arm/mach-omap2/omap_hwmod.h
@@ -702,13 +702,6 @@ int omap_hwmod_shutdown(struct omap_hwmod *oh);
702 702
703int omap_hwmod_assert_hardreset(struct omap_hwmod *oh, const char *name); 703int omap_hwmod_assert_hardreset(struct omap_hwmod *oh, const char *name);
704int omap_hwmod_deassert_hardreset(struct omap_hwmod *oh, const char *name); 704int omap_hwmod_deassert_hardreset(struct omap_hwmod *oh, const char *name);
705int omap_hwmod_read_hardreset(struct omap_hwmod *oh, const char *name);
706
707int omap_hwmod_enable_clocks(struct omap_hwmod *oh);
708int omap_hwmod_disable_clocks(struct omap_hwmod *oh);
709
710int omap_hwmod_reset(struct omap_hwmod *oh);
711void omap_hwmod_ocp_barrier(struct omap_hwmod *oh);
712 705
713void omap_hwmod_write(u32 v, struct omap_hwmod *oh, u16 reg_offs); 706void omap_hwmod_write(u32 v, struct omap_hwmod *oh, u16 reg_offs);
714u32 omap_hwmod_read(struct omap_hwmod *oh, u16 reg_offs); 707u32 omap_hwmod_read(struct omap_hwmod *oh, u16 reg_offs);
@@ -723,11 +716,6 @@ int omap_hwmod_get_resource_byname(struct omap_hwmod *oh, unsigned int type,
723struct powerdomain *omap_hwmod_get_pwrdm(struct omap_hwmod *oh); 716struct powerdomain *omap_hwmod_get_pwrdm(struct omap_hwmod *oh);
724void __iomem *omap_hwmod_get_mpu_rt_va(struct omap_hwmod *oh); 717void __iomem *omap_hwmod_get_mpu_rt_va(struct omap_hwmod *oh);
725 718
726int omap_hwmod_add_initiator_dep(struct omap_hwmod *oh,
727 struct omap_hwmod *init_oh);
728int omap_hwmod_del_initiator_dep(struct omap_hwmod *oh,
729 struct omap_hwmod *init_oh);
730
731int omap_hwmod_enable_wakeup(struct omap_hwmod *oh); 719int omap_hwmod_enable_wakeup(struct omap_hwmod *oh);
732int omap_hwmod_disable_wakeup(struct omap_hwmod *oh); 720int omap_hwmod_disable_wakeup(struct omap_hwmod *oh);
733 721
@@ -739,10 +727,6 @@ int omap_hwmod_for_each_by_class(const char *classname,
739int omap_hwmod_set_postsetup_state(struct omap_hwmod *oh, u8 state); 727int omap_hwmod_set_postsetup_state(struct omap_hwmod *oh, u8 state);
740int omap_hwmod_get_context_loss_count(struct omap_hwmod *oh); 728int omap_hwmod_get_context_loss_count(struct omap_hwmod *oh);
741 729
742int omap_hwmod_no_setup_reset(struct omap_hwmod *oh);
743
744int omap_hwmod_pad_route_irq(struct omap_hwmod *oh, int pad_idx, int irq_idx);
745
746extern void __init omap_hwmod_init(void); 730extern void __init omap_hwmod_init(void);
747 731
748const char *omap_hwmod_get_main_clk(struct omap_hwmod *oh); 732const char *omap_hwmod_get_main_clk(struct omap_hwmod *oh);