It may depend on the circumstances. Since you may not be discriminated against on the basis of your pregnancy, there is no reason why you should not declare it. In any event, if you perform a function for which a stand-in will have to be trained before you take maternity leave, then it is best to have those arrangements made well in advance.
Since top management is already aware, there should be no reason to tell your line supervisor - unless there is other information suggesting otherwise.