1.1 --- a/pkg/devices/lib/cpm/include/cpm-x1600.h Tue Oct 24 18:52:06 2023 +0200
1.2 +++ b/pkg/devices/lib/cpm/include/cpm-x1600.h Fri Oct 27 18:02:49 2023 +0200
1.3 @@ -21,7 +21,7 @@
1.4
1.5 #pragma once
1.6
1.7 -#include <l4/devices/cpm.h>
1.8 +#include <l4/devices/clocks.h>
1.9 #include <l4/sys/types.h>
1.10 #include <stdint.h>
1.11
1.12 @@ -29,50 +29,12 @@
1.13
1.14 #ifdef __cplusplus
1.15
1.16 -#include <l4/devices/hw_register_block.h>
1.17 -#include <l4/devices/cpm-common.h>
1.18 -
1.19 -/* A simple abstraction for accessing the CPM registers.
1.20 - * A proper device could inherit from Hw::Device and use an
1.21 - * Int_property for _exclk_freq. */
1.22 +#include <l4/devices/cpm.h>
1.23
1.24 class Cpm_x1600_chip : public Cpm_chip
1.25 {
1.26 -private:
1.27 - Hw::Register_block<32> _regs;
1.28 - uint32_t _exclk_freq;
1.29 - Cpm_regs _cpm_regs;
1.30 -
1.31 public:
1.32 - Cpm_x1600_chip(l4_addr_t addr, uint32_t exclk_freq);
1.33 -
1.34 - const char *clock_type(enum Clock_identifiers clock);
1.35 -
1.36 - int have_clock(enum Clock_identifiers clock);
1.37 - void start_clock(enum Clock_identifiers clock);
1.38 - void stop_clock(enum Clock_identifiers clock);
1.39 -
1.40 - // Clock dividers.
1.41 -
1.42 - int get_parameters(enum Clock_identifiers clock, uint32_t parameters[]);
1.43 - int set_parameters(enum Clock_identifiers clock, int num_parameters,
1.44 - uint32_t parameters[]);
1.45 -
1.46 - // Clock sources.
1.47 -
1.48 - uint8_t get_source(enum Clock_identifiers clock);
1.49 - void set_source(enum Clock_identifiers clock, uint8_t source);
1.50 - enum Clock_identifiers get_source_clock(enum Clock_identifiers clock);
1.51 - void set_source_clock(enum Clock_identifiers clock, enum Clock_identifiers source);
1.52 -
1.53 - // Source frequencies.
1.54 -
1.55 - uint32_t get_source_frequency(enum Clock_identifiers clock);
1.56 -
1.57 - // Output clock frequencies.
1.58 -
1.59 - uint32_t get_frequency(enum Clock_identifiers clock);
1.60 - int set_frequency(enum Clock_identifiers clock, uint32_t frequency);
1.61 + explicit Cpm_x1600_chip(l4_addr_t addr);
1.62 };
1.63
1.64 #endif /* __cplusplus */